fix-new-chat

Fix: new-chat dialog should allow ad-hoc endpoint URL entry without pre-registration

Metadata

Statusdone
Assignedagent-1194
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-29T21:52:31.028146932+00:00
Started2026-04-29T21:52:56.319902553+00:00
Completed2026-04-29T22:22:01.150687199+00:00
Tagsfix,tui,ux,chat,endpoint, eval-scheduled
Eval score0.86
└ blocking impact0.88
└ completeness0.83
└ coordination overhead0.87
└ correctness0.87
└ downstream usability0.85
└ efficiency0.86
└ intent fidelity0.86
└ style adherence0.88

Description

Description

The new-chat dialog currently requires endpoints to be pre-registered via wg endpoint add before they can be selected. If a user wants to spawn a chat against an ad-hoc endpoint (e.g., a tailnet URL they're trying for the first time), they have to drop out of the TUI, run a CLI command, then come back.

User report 2026-04-29:

'Endpoint No endpoints registered. wg endpoint add ... to add one.

do i really have to register an endpoint or can this system allow me to drop it in?'

The friction defeats the point of having a TUI dialog — the dialog should let you specify everything inline.

Spec

Add a 'Custom URL' option to the endpoint section

Mirror the existing 'Custom: [enter value]' pattern that's already in the Model section of the same dialog:

Endpoint
  ○ openrouter           https://openrouter.ai/api/v1
  ○ lambda01             https://lambda01.tail334fe6.ts.net:30000
  ● Custom URL: [https://my-endpoint.example.com:8080________]
  
    Optional: also register this endpoint with name [_____________]
                                                    (leave blank for one-shot)

Behavior

  • 'Custom URL' option focuses an editable text input
  • Pressing Enter / Launch with custom URL filled creates the chat using that URL inline
  • The optional 'register with name' field saves the endpoint to the user's endpoint registry (~/.wg/config.toml [[llm_endpoints.endpoints]]) so it'll show up in future dialogs as a regular pre-registered option
  • If left blank, endpoint is used for THIS chat only — not saved
  • API key entry: if the chat needs auth, the same dialog should expose an api_key_ref input (referencing a stored secret via keyring:<name>) or accept a one-shot env var name

Discovery + persistence

A chat created with a one-shot URL should still be persisted (the chat task in graph keeps its endpoint config), so reattaches work. The endpoint just doesn't go into the global registry.

Validation

  • Failing test: new-chat dialog shows 'Custom URL' option even with no registered endpoints
  • Live smoke: enter a custom URL, click Launch, confirm chat spawns against that URL (verify via daemon log or wg agents)
  • Live smoke: enter a custom URL AND a registration name, click Launch, confirm chat spawns AND endpoint appears in wg endpoint list afterward
  • Reattach test: spawn a chat with one-shot URL, kill TUI, restart, confirm chat reattaches with the same URL (per implement-tmux-wrapped persistence)
  • No regression: pre-registered endpoints still appear in the list as before
  • cargo build + cargo test pass
  • cargo install --path . was run before claiming done

Depends on

Required by

Log