docs/cmd/ez-agent-configurator.md
ez-agent-configurator
Interactive TUI for editing EzAgent’s layered YAML configuration and probing provider model endpoints. It is not the client (ez-agent), daemon (ez-agent-service), or capability provider (ez-agent-builtin). For configuration schema, paths, merge rules, and runtime loading, see pkg/service/config; for OAuth credential types, see pkg/oauth.
Which configuration am I editing?
At startup, choose Global User Config or Current Working Directory. The latter edits <dir>/.ez-agent/config.yaml, where <dir> is the selected working directory; -cwd selects that directory. -config-dir overrides XDG_CONFIG_HOME (the configurator then uses its ez-agent subdirectory for user files).
Values layer in this order: builtin → user → project. The editor shows an effective view but writes an overlay for the selected layer, so a project save does not copy user or builtin values into the project file. When editing the user layer, the view excludes project values; the project view shows all three layers. Authentication remains user-global, even while editing a project configuration.
When loading the builtin layer, missing shipped programs are filtered from its service entries before overlays are merged. The editor uses that same loaded baseline for effective values and edit diffs throughout the editing session. User and project service entries are not filtered by program availability.
What can I change here?
| Area | What the TUI manages |
|---|---|
| Providers and models | Provider profiles and connection fields, including sparse first-output and stream-idle inactivity timeouts; configured/catalog models; model discovery where listing is enabled; a per-model Require ZDR toggle for Wafer models; provider and model Send output token limit toggles for OpenAI Responses API-key routes |
| Services | Executable path, JSON-array arguments, Ruby/direct JSONL/start settings, timeout, and capability assignments |
| Modes and skills | Named modes and flags; <<default>> for no-mode flags; local skill paths (inherited paths are shown, not editable) |
| General settings | Default/small/audit models, daemon idle timeout and auto-vacuum days, compact percentage, default capabilities, and triggers |
Global Parameters includes a Background Triggers picklist for
defaults.triggers.on_background, alongside the existing outcome and idle
triggers. on_success and on_error remain per-model-run outcomes, even with
background work remaining. on_background reports stopped model processing with
provider-owned background activity remaining; on_idle reports real quiescence.
These notifications do not tell subscribers to terminate.
The picker loads the selected layer's effective attachments and saves on Back or
Escape. Unchanged inherited selections create no override. Clearing inherited
attachments writes ~macro removal markers, so an explicitly disabled list stays
disabled after saving. Restoring the inherited selection removes the override;
Revert to Defaults also restores inheritance for the selected layer.
List pages fit the terminal width. Introductory guidance, including on Remote models and Starting presets, wraps and reflows when the terminal resizes. On short terminals, action navigation and height changes keep the selected option in view; the mouse wheel can scroll back through the guidance. Wrapped guidance is separate from the list, while ordinary list rows retain native navigation, borders and padding.
Remote provider hosts
Open Global User Config → Model sources & sharing for connection defaults and host export policy. Starting presets offers three optional starting points:
- Stand alone starts with local providers and sharing off.
- Local with sharing starts local and shares all local providers.
- Remote provider relay chooses an existing remote as the default source, or opens the connection form if none exists.
Presets change ordinary settings. They never delete providers, model selections, logins, remote connections, or saved sharing selections. All three allow mixing local providers, sharing, and additional remotes afterward.
The Sharing control is None, All local providers, or Selected
providers. Use the provider picker for Selected. All is a persistent policy
that includes future supported local providers and their configured models.
None withdraws exports without deleting the saved selection or provider setup.
Existing remote_eligible settings retain their effective behavior until you
change the policy. They do not become All merely because every current provider
was selected. Remote descriptors cannot be re-exported.
Sharing is provider-wide, not a per-model ACL. Separate profiles such as
openai-cheap and openai-expensive are the intended granularity. Policy and
connections are user-global, never controlled by project config. Credentials
stay on the model host. Socket access grants the full daemon API, so expose it
only to trusted machines.
Choose a remote under Default model source or use Use as default model
source in its connection form. All its exported models then use ordinary
provider/model names with no client-side allowlist or copied catalog. Saved
favorites do not add duplicate source-prefixed rows. Explicit remote entries
remain visible when the ordinary name selects a local model or another source. General
settings offers Refresh default source models for its Default, Small, and Audit
pickers; opening General does not wait for a connection. The remote model browser
also offers those selections. Refresh discovers new exports without configuration
edits. An exact configured local model wins
on a matching name, but merely configuring a provider does not hide its other
remote models. A local failure does not fall back to the remote. Explicit
source/provider/model names deliberately choose that source and bypass local
overrides. The browser's Choose this source explicitly action saves that
form, which stays valid if the default source changes or is cleared. Locally
overridden catalog entries offer the explicit remote reference directly.
Choose source aliases distinct from exported provider names. An alias
collision appears with its explicit source prefix, never a reference that could
select another source. Further slashes in model IDs are preserved. Unavailable
sources fail explicitly rather than switching credentials or hosts. To delete
the current default remote, first choose another source or Local providers.
In Global User Config, add the Remote EzAgent provider host profile. Give
it a unique Host alias, which prefixes model references. Choose SSH or
Local socket under Connection; only that method's fields are shown.
For SSH, enter SSH host, using user@hostname:2323, hostname, an SSH
config alias, or bracketed IPv6 such as user@[2001:db8::1]:2323, and
the absolute Socket on host path. The socket example uses UID 1000; use the
host account's actual runtime path rather than assuming that UID. For a local
or mounted socket, enter Socket path. Its initial value is the current
account's $XDG_RUNTIME_DIR/ez-agent/ez-agent.sock, when available. Switching
methods preserves unsaved field values but saves only the selected method.
Models / Refresh saves
the descriptor in the editor and opens live discovery. Save and Exit writes
the user configuration to disk. Remote destination and selection edits are
unavailable in the project editor.
The setup probe automatically starts a temporary noninteractive SSH forward
when needed, or connects directly. It sends hello, waits for hello_ack, requests
the unfiltered macro inventory, validates exact tunnel.llmprovider.<provider>
names, and calls each provider's IFO and LIST. It never opens INIT, creates a
leaf, starts a bridge, performs inference, or resolves LLM credentials. Opening
the model view refreshes rather than reusing a previous setup catalog. Escape
cancels the bounded probe; results from dismissed or changed destinations do
not replace the current view.
For an additional, non-default remote, toggle individual provider/model names
to save browser favorites. The YAML model list contains only those names, not host
adapter metadata. Empty saves no favorites; explicit source/provider/model
references can still use every exported model without a saved entry.
Discovery never imports the entire catalog or removes saved selections.
The default remote uses all exported models automatically, with no selection
checkboxes. Its browser says Choose a model to set its role. Selecting a
model opens the existing Default, Small, and Audit submenu. Other sources say
Toggle browser favorites. Their checkboxes do not assign roles.
Compact [D], [S], and [A] markers identify Default, Small, and Audit for the routed
source, provider, and model, so a local override does not mark the matching
remote model. Unset Small falls back to Default; unset Audit falls back to Small.
These markers describe configuration defaults without a per-leaf override,
not live availability, and update when returning from role selection. Explicit
saved references keep their source even after the default source changes.
The browser's Help action explains naming, exact local overrides, explicit
sources, favorites, and role fallbacks. Help opens at the beginning and supports
arrow/page-key scrolling, Home/End, and Escape or Enter to return to the browser.
Discovery diagnostics stay visible on the browser itself, separate from the
short action guidance.
Opening or refreshing its catalog does not write model entries.
Saved entries absent from a successful refresh show not found; failed
discovery shows unavailable and retains them. Access/SSH failures, hello
failures, incompatible exports, no advertised exports and exported empty
catalogs have separate diagnostics. No advertised exports does not distinguish
an older host from a host with all exports disabled.
Setup checks reachability in the configurator process's environment. The
consumer daemon must independently have socket access or prepared SSH keys,
unlocked identities, agent access, host trust and forwarding authorization.
Closing setup stops only its temporary connection; runtime establishes and
owns a separate connection and forward. There is no preparatory ssh -L
command or consumer LLM login. The forwarded socket grants the full host daemon
API, not a provider-only API. Trust every environment into which it is exposed.
See configuration,
destination ownership and the
export contract.
Tool selections
The Tools picker under Global Parameters edits defaults.tools. It keeps
its known-tool checkboxes and offers + Add tool by name for tools absent from
the catalog. The existing-service and new-service Tools pickers use the same
entry form. Type one exact tool name and choose Add to select it. Entering an
existing name selects its existing row without adding a duplicate. Cancel or
Escape in the entry form discards that entry; Done or Escape in the picker
keeps its selection in memory. Save and Exit writes the configuration.
Known choices come from effective service capability assignments, not a live
query of connected processes. Saved or manually entered names absent from those
choices remain visible as [not discovered]. That label is not a syntax error
or an access check. Such names survive opening the picker, unrelated edits, and
save/reload verbatim, including saved commas or surrounding whitespace. Tool
selections are stored separately from their display text. Removing an inherited
tool writes a ~name removal marker; removed inherited names stay in the picker
so they can be selected again without re-entering them. Restoring the inherited
selection removes the override, regardless of picker order.
New manual entries must be nonempty UTF-8 without control characters or Unicode
format controls. The entry form also rejects leading or trailing whitespace,
commas, and a leading ~, which has removal-marker meaning. It preserves case,
internal spaces, punctuation, and Unicode rather than applying a model provider's
naming pattern or length limit. Existing selections are not revalidated against
the catalog.
A default tool does not need a services.*.tools mapping. For example, a Ruby
process started with on_start: true may connect to the daemon and announce a
tool at runtime. Add that announced name directly to the default Tools picker.
The name selects a tool; it does not register one, launch a provider, or guarantee
availability. The connected process must supply its runtime announcement and
tool metadata. A service capability assignment remains a separate setting and
does not replace announcements for a background peer.
Modes and flags
Flags edits the top-level mode_flags catalog. Use + Add New Mode Flag
to declare a name. Modes edits named definitions with a description and a
Flags picklist. To attach a new flag to Plan, open the existing plan mode
and select it there while retaining its description and existing flags.
Declaring a flag does not attach it automatically or implement its behavior.
Tools and plugins must consume and enforce the flags they support.
An inherited mode editor starts from its effective description and flags; saving creates a complete named-entry override in the chosen layer. Hand-edited YAML must also preserve both fields because modes replace by name rather than deep-merge. See mode configuration.
The first Modes entry, <<default>>, edits defaults.flags for leaves with
no selected mode. It reuses the Flags picklist but has no mode description or
delete action. Back or Escape saves the selection in memory; Revert to
Defaults or Ctrl+D removes only the selected layer's defaults.flags
override. Other defaults and named-mode instructions remain unchanged.
Clearing inherited flags writes ~flag removal markers; restoring the inherited
selection removes the override regardless of picker order. Save and Exit
persists these edits. Global Parameters' Revert to Defaults resets that
screen's fields without removing these no-mode flags.
<<default>> is a menu entry, not a named mode, a default mode selection, or a
base inherited by named modes. Named modes use only their own flags. An empty
leaf selection is no mode, not an implicit Build or Plan. The client /mode
picker offers Clear Mode.
Keyboard controls
- Up/Down arrows move between menu entries and form controls. In an open dropdown, they move through that dropdown's choices instead.
- Tab moves to the next form control; Shift-Tab moves to the previous one.
- Enter selects a menu entry or dropdown choice and activates the focused checkbox, picklist, or button.
- Escape closes an open dropdown or returns to the previous screen. At the main menu it exits, prompting first if there are unsaved changes.
How does auth work finish at shutdown?
Login completion saves under the app lifetime, not the already-completed browser attempt. Closing the successful handoff therefore cannot cancel its protected save. Shutdown cancels UI delivery, rejects new auth workers, and waits up to 15 seconds for owned login, sign-out, rejected-login cleanup, and model discovery workers, including discovery dismissed before exit. External discovery joins child retirement and scratch removal without requiring the stopped UI loop. A timeout is reported as incomplete cleanup. This does not extend the login or renewal deadline.
How are models found?
Choose Muse Code (subscription login) to prefill muse-code and the
executable bridge beside the physical configurator, if present. Otherwise the
command defaults to ezagent-muse-code-bridge on PATH. Choose Advanced
command settings to edit the command and other external-provider settings,
or Custom external command for another integration. Muse uses its official
subscription login, not a supplied API key. Selecting a profile does not run
the command or save settings. Saving or choosing Edit Models on an old bare
bridge preset replaces it with the sibling path when available.
When re-adding a deleted provider, saving blank authentication fields clears
any retained provider authentication; cancelling leaves it unchanged.
Choose Claude Code (subscription login) for the included Claude bridge, or its
PATH basename when no executable sibling is available. Install Claude Code and
sign in through the official app first, with claude on PATH. The profile uses
that existing login, with no API-key fields, installer or credential-management
flow. Normal use stays in EzAgent; exceptional reauthentication can require the
native app. The Muse profile also requires prior native installation and sign-in.
Claude discovery reads the native initialization model list without sending a
prompt or making an inference request. Native aliases and supported thinking
settings remain advisory, not proof of subscription access. Older versions may
return no models. Manual model entry remains available; leaving token/thinking
fields blank preserves native defaults. See the
Claude bridge guide.
The external command form configures an executable, JSON argv and
options, explicitly passed environment names, optional API-key credentials,
and startup and stream timeouts. It does not require an HTTP URL or API key.
Opening its model list does not run the command. Choose Discover external
models / Refresh to run --list-models with the selected provider's configured
command, arguments and options. This explicit action authorizes discovery for
included native bridges and configured custom commands alike; there is no second
trust/command confirmation or credential prompt. Results are discarded if the
provider settings change while discovery runs.
The list reports not-yet-discovered, empty and failed results. When a catalog
states a source other than providerCatalog (for example the bundled
fallback), the list shows that source and that the catalog may be incomplete. The source
is shown as a single printable line of at most 40 characters: control and
whitespace runs become one space and longer values end in an ellipsis. The
stored value is not altered. The list still offers the listed models and manual
entry. When a provider reports no
source (the Claude bridge today), the list says "Discovery finished." and
"Catalog provenance not reported." without calling the list complete or
incomplete. providerCatalog keeps "Discovery complete." None of these says
anything about account entitlement. Host command
lookup or launch-setup failures point to Advanced command settings →
Executable: use an absolute executable path or correct PATH to include its
absolute directory. Relative PATH entries and the current directory are not
used for lookup. Other failures suggest reviewing settings and retrying, or
adding a model manually. The Muse bridge does not accept supplied API-key settings.
Discovery is cancellable and advisory: failed or partial catalogs do not
remove saved models or prevent manual model entry. A listed operating budget
and a hard ceiling are shown separately; unknown limits are not unlimited.
Selecting a model opens the ordinary model editor; discovery alone saves
nothing. Existing model, alias and provider overrides remain authoritative.
For the included Muse and Claude bridges, Max Context is EzAgent's operating
budget, separate from native output and thinking defaults. With no effective
context budget, the editor seeds the known catalog ceiling or 1,000,000 when
the ceiling is unknown. The fallback is an EzAgent policy, not a discovered
native capacity. Activate or explicit Save persists the seed; leaving
an unchanged editor with Back does not. Claude's blank Max Tokens keeps
the native output default. The wrapped current thinking list shows the full
editable value, using per-model discovery or saved settings rather than a
generic list of choices. Muse still ignores max_tokens.
Inactivating an external model retains its sparse local settings in a removal
record, so an inherited model with higher limits cannot become active instead.
These dormant saved IDs remain inactive rows even in an empty or partial catalog;
reactivation restores their alias identity, limits and thinking settings. Manual
entry of an already saved ID directs you to its existing row instead of replacing
those settings from a blank editor.
Provider-local aliases are authored in YAML with name and base_model, not
through a separate creation form. Existing model editors preserve both fields
and custom saved names. Alias catalog metadata is looked up by base_model;
saved aliases remain selectable even when discovery omits them. See
configuration.
For ordinary providers, has_listing controls probing; other providers use configured or embedded metadata. OpenAI API-key profiles probe their configured HTTPS base URL with that profile's key. Subscription profiles always discover using the explicitly selected, usable ChatGPT registration, regardless of has_listing.
Subscription discovery calls only authenticated GET https://api.openai.com/v1/models, parses .models, keeps visibility: "list", preserves server order, displays display_name, and saves slug. Discovery can omit models that still accept inference. Its cache lives only in configurator RAM and includes validated registration identity, credential generation and provider-selection generation. A changed account, grant, local authorization or token set cannot reuse an older catalog. Use Refresh ChatGPT model availability for a fresh response.
The single maintained known-model file is pkg/service/config/provider_defaults.yaml, accessed through the shared config loaders. The subscription picker supplements discovery with non-unlisted models from its openai section and with saved configuration. Live entries stay first; remaining names sort alphabetically. Repository additions show [known] and can be activated normally. Saved names omitted by a successful catalog show [saved; not listed], which does not mean they are unusable. unlisted: true retains settings metadata but prevents general suggestions; such a model still appears when returned by discovery or saved explicitly. No duplicate subscription roster is maintained.
Add model by name allows explicit configuration without editing YAML, including models not yet in the maintained file. Names are bounded to 256 UTF-8 bytes without spaces, control characters, or Unicode format controls. Unknown names retain generic editable defaults; EzAgent does not invent context or output limits. Every model uses the same public Responses API, regardless of authentication. Existing saved model settings remain unchanged.
On discovery failure, saved and repository-known configuration choices remain selectable. Saved entries say discovery unavailable rather than suggesting access was denied. Neither a listing nor a known-model entry grants authorization; credentials and local consent still gate runtime, and OpenAI accepts or rejects each inference request. Picker selection performs no inference probe.
Model discovery details displays bounded model-name and visibility fields from the last successful response, including non-list entries. It makes no extra request and never displays credentials, raw bodies, or provider prose. This RAM-only snapshot is checked against the current account/session before opening. A failed refresh preserves the last successful snapshot for the same credential/selection generation and marks it as earlier data; stale live choices are not presented as a fresh discovery result. Returning from an editor never retries discovery implicitly, even after failure or cache loss. The view is capped at 1,000 records and reports truncation. It helps distinguish omitted names from hidden entries without using discovery as an access test.
Escape cancels abandoned ordinary and subscription discovery requests; app
shutdown also cancels them. Each loading operation owns its page and animation;
completion uses the cancellable app-lifetime UI queue, so a request timeout can
close its page without blocking a worker after shutdown. A late callback cannot
pop a different editor or publish an abandoned model list/cache. The retired
pushLoadingView, startAnimDots and stopAnimTimer helpers and their shared
animation fields are removed. Sign-out still finishes if its loading page is dismissed,
without disturbing the page or animation the user has since opened. An
unconfirmed-revocation warning still appears in the status bar.
The shared loader supplies known-model capabilities for both auth routes.
Public Responses requests share developer instructions and additional_tools.
There is no dialect selection or protocol roster. The routes differ only in
bearer authentication, authorization and admission, endpoint enforcement, and
the subscription exception for max_output_tokens. User capability overrides
and opaque metadata remain intact, including old dialect keys with no runtime effect.
Wafer metadata initializes ZDR only for newly imported records. Its Require ZDR toggle remains available for discovered, catalog and custom models; other provider editors preserve irrelevant saved zdr_supported values without displaying them.
Send output token limit defaults to on and appears in provider and model
editors for type: openai. It
controls responses.send_max_output_tokens: an absent value means true, and a
model value overrides the provider value, including explicit false. Turning it
off omits max_output_tokens without deleting saved Max Tokens. Unchanged saves
preserve sparse overlays, explicit false, and opaque Responses metadata. Other
non-subscription provider types use different adapters and do not show this toggle.
All Responses requests use store: false. The configurator has no
remote response storage controls. Legacy remote_response_storage metadata stays
unchanged on save but has no effect at runtime. Prompt-prefix caching is separate
from Response-object storage.
OpenAI API-key and subscription model editors group cyber access variants under one base-model row. The ordinary settings form shows a short access summary, usually Auto. Configure access programs opens the optional checklist:
- Auto omits
access_programs, leaving selection to OpenAI. - Standard sends
access_programs: {cyber: standard}. - Blue sends
access_programs: {cyber: daybreak_blue}. - Red sends
access_programs: {cyber: daybreak_red}.
Several selections may be enabled at once. Auto uses the base-model entry;
explicit selections create provider-local aliases with base_model and
access_programs. New aliases use -STANDARD, -BLUE or -RED, with a numeric
suffix and a notice if a name is already occupied. Existing matching aliases
keep their saved names, including manually customized names. Each enabled entry
appears separately in the app's ordinary model listings.
The configurator's grouped row summarizes context across all enabled entries it
represents, including custom-named duplicates. It shows one ctx value when all
effective context lengths match, or ctx:variable when known lengths differ.
Alias catalog metadata and provider fallback follow runtime precedence; disabled
entries do not count. If any enabled entry has no positive effective context
length, the row shows ctx:unknown instead. Inactive groups have no context label.
Max Context in the group editor shows that same effective value, variable,
or unknown. Changing it to a positive token count applies an explicit
max_context override to every enabled entry represented by the row, including
custom-named duplicates. Pending program selections apply first, so disabled
entries remain untouched and Auto is not added. Leaving context unchanged
preserves differing values, unresolved limits and sparse inheritance. Opening
the chooser does not write anything. For dormant groups, context edits apply
when activating the restored entries, including Activate and edit variant
settings.
Back or Escape in the checklist returns to the same model form with its pending field edits and selections intact. Opening and closing it without changes does not activate anything or write defaults. Save, Back or Escape in the model form applies edits in memory; Save and Exit persists them. Activate on a new or known inactive model with no advanced choice uses Auto. Existing Blue-only groups stay Blue-only on unrelated edits.
Inactivate disables every enabled entry represented by the group, not manual aliases or unrecognized program maps. Removal records preserve names and metadata, including inherited variants. Activate restores the exact previously enabled entries during the same configurator session, without resurrecting individually disabled duplicates. If every checklist choice was cleared just before pressing Inactivate, the group still remembers the entries enabled when its form was opened; a nonempty pending selection becomes the set to restore. After restart, removal records cannot identify that exact subset: reactivation restores dormant explicit variants when no dormant Auto exists, or Auto when it is the only recorded choice. If both Auto and explicit variants are dormant, use Configure access programs to choose rather than silently adding Auto. Dormant duplicates of a selected program may all return after restart. Explicit checklist changes always apply to all entries for that program; unmodified choices leave their records untouched.
The grouped row's Max Tokens, thinking and output-limit controls apply to Auto and newly created variants, not to saved aliases. When only explicit variants are enabled or will be restored by Activate, those base-setting controls are hidden; Max Context remains available for the whole group. Use Edit variant settings to select an enabled entry by its saved name and edit its own settings. For an inactive saved-variant group, Activate and edit variant settings restores the group and opens that picker directly. Save, Back and Escape save that entry without changing other variants, including duplicate entries for the same program. The entry editor shows effective limits, thinking levels and output-limit policy, including base-model catalog defaults. Unchanged inherited fields stay absent from the edit layer, so later lower-layer or catalog changes still apply. Explicit saved overrides are preserved. Clearing the thinking field explicitly saves an empty list to disable thinking selection; an existing empty list stays empty. Deactivate individual programs through Configure access programs, or use Inactivate to disable the whole represented group.
Grouping uses explicit model metadata, never suffixes. General aliases,
explicit-program entries without base_model, and entries with future or
multiple categories remain separate and unchanged. The configurator is a
convenient subset, not a generic alias manager; edit YAML for these cases.
Program controls are absent from other provider types. OpenAI
checks eligibility and access for either authentication mode. EzAgent does not
silently change the selected program after a rejection.
How do layered edits and deletions work?
Do not treat an overlay as a complete replacement. Mappings deep-merge; ordinary scalar lists append and deduplicate. A ~value list item masks an inherited value, _removed: true masks an inherited named entry, and YAML null can remove an inherited scalar. skills.paths is an exception: a literal path such as ~/shared is a path, not a removal marker; paths append and deduplicate across layers.
Service args are opaque: an upper-layer value replaces the entire array, preserving order, duplicates, empty strings, whitespace, and literal ~. Model and mode editing also preserves the overlay conventions and model response metadata rather than rewriting the configuration as a typed runtime config.
When is anything written?
Provider/model configuration and API-key edits stay in memory until Save and Exit. Leaving with unsaved edits prompts for a decision. Configuration uses a temporary file followed by rename. Auth saves use the shared short mutation lock, reread disk, and merge only explicitly edited API-key fields or deleted profiles. Saving a stale in-memory auth document never restores old tokens. Pending API-key edits also survive account-driven reloads and editor reentry; fresh disk state does not replace an explicit unsaved key or environment edit.
Validated ChatGPT sign-in, account selection, authorization withdrawal and
sign-out are immediate protected transactions, not deferred to Save and Exit.
Each uses config's fresh-read/merge/write owner and private atomic writes. Unix
auth files are owner-only 0600; Windows uses the private-file protection.
How do I connect and control my ChatGPT account?
Choose the subscription provider's Continue with ChatGPT action. Select a
retained registration to return to that account, explicitly select an already
connected account, or choose a new sign-in. Registrations remain distinct even
when their emails match. Use selects directly; Reconnect opens sign-in.
Matching emails get a local human index, not a client ID/hash or guessed workspace
name. The selected verified display identity appears in status, escaped for tview.
There is no automatic account rotation or silent switch
to API-key billing. Old Codex type: oauth records are nonoperational and remain
unchanged until an explicit successful replacement or removal.
The compact subscription editor shows connection guidance as wrapped, read-only text and starts on Continue with ChatGPT. With no retained registrations, that action goes directly to the privacy notice. Otherwise it opens explicit account selection. Status distinguishes a usable plan, withdrawn local authorization, missing plan permission, an incomplete connection and a signed-out registration. Withdrawal appears only for an accepted local authorization with a complete session; sign-out appears only when there are local tokens or session state to clear. A retained registration alone does not offer sign-out. Account changes refresh both guidance and actions without discarding unsaved settings.
Edit Models remains available for saved records without a connection. Live
discovery needs a usable ChatGPT plan. Advanced settings holds Max Context,
first-output and idle timeouts, and extra headers. Configured inherited values
remain visible. Blank timeouts inherit lower-layer settings, otherwise using
one minute before first output and five minutes between stream events. Ordinary
provider editors keep their tuning fields on the main form. Subscription provider and model forms
do not offer Max Tokens or Send output token limit. Existing max_tokens,
responses.send_max_output_tokens, legacy storage settings, and opaque metadata
are retained, not treated as an enforced subscription output cap. See the configuration reference.
The account menu refreshes on focus and after auth mutations. Returning sign-in rereads the chosen registration after local acceptance, rather than using the menu's older credential snapshot. Before opening the browser it stages the provider's selected registration and generation along with that account. Both new-account and returning attempts compare this ownership at commit, so a newer selection/login, withdrawal, sign-out, or session replacement defeats the pending transaction. A rejected validated session is not activated; bounded remote cleanup runs independently of the UI page and reports unconfirmed revocation.
Before browser sign-in processes identity data, EzAgent presents a scrollable privacy/service-access notice and obtains affirmative background authorization. The notice fits the current terminal and rewraps on resize. Up/Down and Page Up/Page Down scroll the text. Tab moves to the actions; Shift+Tab returns to the notice. The actions wrap as needed on narrow terminals. Short terminals hide the keyboard hint to leave room for the notice. If the text and full action labels cannot fit, the UI requests a resize and disables acceptance. Escape still cancels. Cancel or Escape does not start sign-in. Accept and continue authorizes accepted tasks to continue after the UI disconnects and expressly authorized background workflows to use this user's plan. The protected registration records notice version 1 and the acceptance flag. This is separate from OpenAI's actual granted scopes; missing plan permission or local acceptance disables inference.
The notice covers necessary account identity and protected local credentials; conversation context, source content, attachments and tool results sent to OpenAI; local archives and relevant diagnostics retained until deletion; backups and external-service deletion limits; user-configured external-service processing; and the single-user automation boundary. EzAgent does not collect credentials through an operator-hosted service or read the user's ChatGPT history. Its BSD license grants software rights, not authorization to use OpenAI's service.
Sign in from SSH, Docker, or a phone
After privacy acceptance, EzAgent binds its private 127.0.0.1 listener and
opens a compact dialog. Copy link and Show link appear first, with the
status directly below. The long URL is hidden in the dialog. Three short steps,
a masked Callback URL field, input feedback, and Finish sign-in / Cancel
fit a 45-column, 20-row terminal. Buttons stack when narrower; Page Up/Down
scrolls when shorter. Tab and Shift+Tab move between controls. Initial focus is
Copy link, so Enter requests copying rather than submitting an empty callback.
Pasting does not auto-submit. Finish sign-in remains an explicit action.
Copy link writes the exact URL using OSC 52 on a terminal, including under
screen or tmux terminfo. Native non-terminal screens use their clipboard
method. Copy never reads the clipboard back or claims that the terminal accepted
the request. Terminal or tmux policy can block it.
Show link is the selection fallback. It suspends tview, prints the exact URL on its own unbroken line on the controlling terminal's normal screen, and waits for Enter before resuming the same dialog. Only the terminal soft-wraps the line; there is no label, border, indent, or inserted newline within the URL. This explicit action deliberately leaves the sign-in URL in terminal scrollback. The screen warns about that retention. It does not print to redirected stdout, log files, status messages, or conversation history. Clear private scrollback when no longer needed. Paste the returned callback only into the dialog, never into this temporary selection screen. Expiry unblocks the wait; Escape or Ctrl+C there cancels sign-in after restoring the TUI.
Open browser appears only when a system opener is found and, on Linux,
DISPLAY or WAYLAND_DISPLAY is set. Detection is best-effort, not proof the
browser can reach the callback. Launch failure leaves Copy and Show link usable.
QR and the unused terminal QR fork have been removed.
Copy, Show link, and Open browser use the same hint-free authorization URL.
No access, refresh or ID tokens, id_token_hint, or login_hint appear in it,
including when returning to an account. Callback input is never echoed or saved.
- Choose Copy link and paste it into any browser. If clipboard access is blocked, use Show link to select the raw URL instead. A reachable local callback finishes automatically.
- On another device, approval may end at an unreachable loopback page. Copy the full returned address from its address bar, not a bare code or the original authorization link. Some phone browsers may not expose that failed redirect; do not assume every phone/browser combination supports this step.
- Paste the returned address privately into the pending configurator's masked Callback URL input and choose Finish sign-in. A phone also needs a private way to paste back into this terminal. Do not use review chat, public logs or support to carry the address. EzAgent never fetches pasted input.
The callback must exactly match this attempt's scheme, loopback host, port, path,
state and issued client registration. Wrong addresses/states leave the attempt
pending. Denial and matching-state malformed terminal data consume it once.
Automatic HTTP callback and paste race through the same validator and one-use
result. Sign-in has a five-minute total limit; one invalid_grant may produce a
fresh link with new state, nonce and PKCE without extending that limit.
No SSH tunnel or Docker port publishing is required. SSH forwarding is an optional
convenience; Docker -p does not expose a listener bound only to container loopback.
This is EzAgent manual completion of the existing native authorization-code/PKCE
flow, not an OpenAI device flow or a claim that upstream documents pasted callbacks.
OpenAI's self-hosted VM guide
describes a different registration-transfer procedure. No credential export,
transfer, relay or public callback listener is implemented.
Escape, Cancel, page dismissal and app shutdown cancel exactly the pending
attempt and clear its in-memory link and callback state. A URL explicitly printed
by Show link remains in terminal scrollback and cannot be recalled by the app. Rejected submission, accepted
submission before verification, and a fresh authorization generation also discard
the entire private callback editor and its undo/redo history. Focus, navigation,
and event handlers retain only a resettable wrapper, not a retired editor. Copy/cut
is blocked; masked terminal paste preserves the exact input with a 16 KiB bound.
This disposes UI references, not Go-managed memory through secure zeroing.
UI updates use a bounded,
cancellable queue rather than leaving workers blocked after shutdown. A covered
or abandoned attempt cannot pop a newer page or publish credentials. Validated
uncommitted credentials go through guarded, bounded DiscardSubscriptionLogin
cleanup; it never revokes an already committed token set. Successful one-use
completion is marked before its page closes.
Explicitly reconnecting an account that declined plan use adds the supported
OAuth prompt=consent; ordinary returning sign-in does not force it. EzAgent
does not send force_reconsent=true before OpenAI confirms rollout.
The first successful enabled-plan connection displays You're using your
ChatGPT plan with a dismissible Got it action. The protected installation
welcome marker prevents repetition on later sign-ins. Provider status says
Using ChatGPT plan only for usable authorization. Usage management belongs
in the client's Usage page and quota-error guidance, not the account editor.
Login validation, first-use confirmation and connection status do not make
inference requests. A quota rejection is an inference error, not a sign-in error;
valid credentials, granted scopes and local consent remain intact. /usage is a
read-only source/usage view and link, not quota API data.
The terminal uses the published plain-text
Continue with ChatGPT format, without logos or claims of OpenAI endorsement.
See OpenAI's UI/UX guidance
and sign-in button example.
Withdraw local authorization immediately disables new subscription requests, and admitted inference observes the protected authorization change. It only withdraws permission in EzAgent; it does not cancel the OpenAI account or ChatGPT subscription. Abort or stop running tasks in the client when needed; local cancellation cannot undo a request already processed remotely. Sign out of ChatGPT withdraws local authorization before waiting for renewal, then clears local access/refresh/ID tokens and attempts bounded revocation of the latest token. Account/client mappings and the stable host identity remain. A changed provider selection returns a conflict instead of claiming another account was signed out; retry the explicit action for the desired account. If revocation cannot be confirmed, disconnect EzAgent in ChatGPT settings as the error explains. Neither operation can be undone by an old configurator save or late refresh.
The retired runOAuthLoginAsync, tviewOAuthUI/newTviewOAuthUI, and
saveAuthOAuthEntry wrappers and exported OpenAICodexModels stub were removed.
AuthEntryInfo carries current SIWC credentials and display state, not copied
flat legacy secret fields. Sign-in always uses a staged account transaction.
The redundant subscriptionBrowserFor consent wrapper is gone; the OAuth owner
constructs both private and handoff URLs with the appropriate consent parameter.
The prefix-based closeOAuthModal is replaced by exact per-attempt page ownership.
How should maintainers report a SIWC security incident?
For a discovered EzAgent/SIWC vulnerability or breach that may affect users, promptly contact OpenAI with relevant details as required by SIWC Terms section 3. Use the official OpenAI Security page's reporting section, which directs reports to its Bug Bounty Program submission channel. Do not invent a deadline or rely on source availability as a safeguard. Notify EzAgent maintainers privately as well; keep credentials, authorization URLs, token bodies and unnecessary personal data out of public issues, logs and support transcripts. Share sanitized impact, affected versions and reproduction details through the private reporting channel, then coordinate remediation and user notification as appropriate.
Where do implementation details live?
| Need | Authority |
|---|---|
| Startup, layers, save behavior | main.go, app.go, startup.go |
| Editors and provider/model workflow | profiles.go, providers.go, models.go, probe.go, oauth_login.go, services.go |
| ChatGPT account controls and account-specific discovery | subscription.go, subscription_models.go |
| Compact sign-in handoff, explicit terminal link fallback, private input disposal, and cancellable UI delivery | oauth_login.go, oauth_handoff_view.go, show_signin_link.go, private_callback_input.go, auth_dispatch.go |
| Modes, skills, general settings | globals.go, modes.go, skills.go |
| Merge and typed runtime configuration | pkg/service/config and its tests |
| General project navigation | docs/index.md |