Skip to content

feat(settings): Choose the Completer source in Settings, not only the env (#436) - #452

Merged
omesser merged 7 commits into
mainfrom
feat/436-harness-settings-row
Sep 7, 2026
Merged

omesser merged 7 commits into
mainfrom
feat/436-harness-settings-row

Conversation

@omesser

@omesser omesser commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Closes #436.

What changed

  • A Completer source section on the Director tab: a picker for Off, claude, hermes and opencode, plus a text field for a custom command line. It binds AI_BUDDY_HARNESS with the same env-ownership pattern as the other Director rows, so a variable that owns the row shows its value, names itself, and takes no edit.
  • The HTTP rows freeze only for a Harness that answers. Presence of a configured Harness is not enough. A Harness that never spawned, or whose wire has been lost, leaves Base URL, Model and the API key live, because otherwise a missing binary took the HTTP Completer out of use while the Director had quietly fallen back to Static, and the only way back was hand-editing the settings file. The state line separates set-but-not-running from attached.
  • An exported but empty variable means Off, as it did before, while an unexported one falls through to the saved row. The same rule decides the row's ownership, so a blank export freezes the row it silences.
  • Picking the entry already shown is a no-op. The catch-all drew a command line held in the source field inside the command-line row, which writes a different field, so re-picking Custom used to leave the command empty and silently turn the Harness off.
  • A custom command line is never logged verbatim. The patch debug prints the program name and an argument count, not the line and not a fingerprint, since ADR-0010's seventh rule forbids fingerprinting a credential too. Anyone who puts a token in a command line is covered.
  • The row says what it will do, including for Off, so a pending change explains why the HTTP rows above stay out of use until the next launch.

What it looks like

The Director tab on AppKit, in the three states the section can be in. Click a shot for full size. Checked in under docs/pr/ and linked by commit SHA, per docs/agents/writing.md.

Completer source with no Harness Completer source with hermes attached Completer source with a Harness that never started
Nothing configured. The picker reads Off and the state line says Not attached. The HTTP Completer above is the Director's mind. Its rows above stay live, so Apply is enabled. A Harness that answers. The state line names the live session, hermes attached, session 655092d4… The HTTP rows above are frozen, which shows in Apply and Cancel going grey. Set but not running, here a custom command line whose binary does not exist. nosuchharness is set but not running… and the HTTP rows stay live. This is the review finding: a missing binary cannot leave the Director with no reachable Completer.

In the last two the picker is frozen and labelled because AI_BUDDY_HARNESS was exported to force the state for the photograph. With the variable unset the picker is the editable control the first shot shows.

Restart, not live switching

The row's help says any change takes the next launch. The attached Session is a process-global held for the app's lifetime by ADR-0008, so live switching means a re-initialisable global plus shutdown ordering in files two sibling pull requests are editing. The issue's fourth item is satisfied structurally instead: the source rows are absent from the retarget set, so a Retarget never touches the attached handle and keeps handing the Completer the Session already up. A test pins that.

ADR-0010

No credential field anywhere, asserted by a test. The login command is display-only text and is never run. Nothing writes a provider key into the child environment.

Platforms, plainly

AppKit is built and tested here, and the picker, the state line and the command line all work there.

  • GTK commits the command line. Its text-field arm is generic and honours the frozen flag, so the row works; the picker and the state line do not draw, and are deferred with a note in the code.
  • Windows draws the command line editable and drops what is typed. Its text-change handler commits one known id only, and its edit builder never marks a field read-only. This row adds no new gap: it joins the wake interval and both Completer limits, which already behave that way. There is no third declarative option, because that renderer ignores the frozen flag entirely. The fix is one generic commit handler plus honouring frozen, which repairs all four rows at once and belongs with Windows Shell furniture for tray, settings, and opener #197, where I have left the concrete list.

How to verify

cargo test -p ai-buddy

253 tests pass, sixteen of them new. cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace, and pre-commit run --all-files all pass.

One known limit

A dead attachment still counts as configured deeper in model.rs, so a key typed into the now-live HTTP rows is not used until relaunch. Making HTTP take over live would contradict ADR-0008's failure-to-Static policy and sits in files the sibling pull requests own. What this change guarantees is a way back that does not need a text editor.

Conflicts to expect

This edits ADR-0017 at its old path and #449 renames that file. It also changes harness::attach and its caller, which #450 and #451 both touch. Whichever of the four lands last wants a rebase, and the ADR one is a rename against an edit rather than a textual clash.

— Claude Code, on @omesser's behalf.

omesser added a commit that referenced this pull request Sep 7, 2026
Six review findings on #452. A configured Harness that never spawned left a
handle, which froze the three HTTP rows and hid the only Completer left; the
state line now separates set-from-answering and names what the row will do on
the next launch. An exported blank AI_BUDDY_HARNESS is the kill switch again.
A command line in the source field moves to the row that writes it, so
re-picking Custom is not a silent Off, a pick of the entry already shown
writes nothing, and the patch debug prints the program name rather than a
command line that may carry a token (ADR-0010 rule 7).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
omesser and others added 6 commits September 7, 2026 09:34
… env

One picker over the four values `AI_BUDDY_HARNESS` already takes, frozen
while the variable is exported. The three HTTP rows say so when a Harness
is attached: it is the Completer, so they drive nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A popup reached by tag, like every field already is, so a second one needs
no selector of its own.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Six review findings on #452. A configured Harness that never spawned left a
handle, which froze the three HTTP rows and hid the only Completer left; the
state line now separates set-from-answering and names what the row will do on
the next launch. An exported blank AI_BUDDY_HARNESS is the kill switch again.
A command line in the source field moves to the row that writes it, so
re-picking Custom is not a silent Off, a pick of the entry already shown
writes nothing, and the patch debug prints the program name rather than a
command line that may carry a token (ADR-0010 rule 7).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ntence

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@omesser
omesser force-pushed the feat/436-harness-settings-row branch from 60dd300 to bd9a28a Compare September 7, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(settings): Director Completer source — HTTP vs Harness picker

1 participant