Repository navigation
feat(settings): Add Development knobs for the Harness attachment - #537
Conversation
|
Rebased onto
Verification after the rebase: 333 tests in the shell, 463 in core, 23 and 2 in the smaller crates, 0 failed. Unchanged from the original: — Claude Code, on @omesser's behalf. |
3d1fea4 to
149e89a
Compare
Auth-retry interval and MCP server binary as Development rows with env overrides, and help text on the Completer timeout saying it budgets a Harness turn too. x11 and Windows renderers were edited blind: only aarch64-apple-darwin builds here, so CI compiles them first.
149e89a to
5e93131
Compare
Why
Three Harness knobs had nowhere to live but a shell export.
session/promptas well as an HTTP Completer request, and expiry cancels the turn. A reader had no way to know a cancelled Harness turn came from that field.harness.rs. A test or a smoke run that has to watch the retry cannot wait a minute for it.AI_BUDDY_MCP_BINwas env / beside-exe only, so pointing a run at a different stdio MCP server meant relaunching the app with the variable set.What changed
FormRow::TextFieldgainedhelp: Option<String>— the hint every other row kind already had. A label says what a row is and a placeholder says what blank means; neither had room for what the timeout costs. All three renderers draw it under the field, the same way they draw a checkbox's help. Section comments were the cheaper alternative and were rejected: the Win32 window does not render them at all.The two new rows sit in a new Harness attachment section on the Development tab, not on Director. Neither is a choice anyone makes to get a buddy working; both exist so a test or a CI job can be told where to look and how long to wait.
AI_BUDDY_HARNESS_AUTH_RETRY_SECS→Settings.harness_auth_retry_secs, seeded intodev_flags::harness_auth_retry_secs().Session::newreads it exactly where it already readsdev_flags::director_timeout_secs(), so a change lands on the next attach.AI_BUDDY_MCP_BIN→Settings.mcp_bin, seeded intodev_flags::mcp_bin().mcp_server()reads it at attach rather than at construction, so a path typed in the window is the one the next attach hands over. AMutex<String>rather than an atomic, because a path is not a number; it is locked on a seed and at attach only.Both follow the ownership pattern the other Completer limits use: the exported variable outranks the file, freezes the row and names itself in the label, and
dev_flags::seedre-reads the environment on every applied patch.Deliberately not done, per the issue's scope fence: spawn backoff first/cap and the attach-timeout floor stay hardcoded until #434 / #437 show they need dials. No credential row, no always-approve control.
How to verify
cargo test -p ai-buddy— 318 passed, 0 failed. The five written first, each watched red before it went green:every_development_row_has_a_value_in_the_viewalready covered the other half — a Development row whose id is missing from the view draws blank over a value that is in force — and it passes with both new rows on the tab.Then
cargo clippy --all-targets -- -D warningsclean, andpre-commit run --files <the eight touched>clean after staging onecargo fmtrewrite.Notes
CI is the first thing that compiles two of these files. Only
aarch64-apple-darwinis installed here, soplatform/x11/settings_window.rsandplatform/windows/settings_window.rswere edited by matching the existing rows and never built. The x11 change is thehelpfield in the destructuring plus onehelp_linecall; the Windows change is the same field plus a static hint copied from the checkbox arm — with the label arm'sCStringbinding rather than the checkbox arm's temporary, which dangles.Not verified by hand: the rendered look of the three windows. I did not launch the app, so the AppKit hint spacing under a text field is untested, and neither is the Win32 hint's
yadvance.Not verified end to end: that a Harness actually retries
session/newon a five-second interval typed into the row, or that a path typed into the MCP row reaches a real child. Both read sites are covered by unit tests on the value they receive; nothing here drove a live Harness.Collisions. #520 and #512 are open against the same surface. Neither moves the rows added here — #520 is the Director tab's endpoint picker and #512 is the capturable switch — but both touch
settings/form.rs, and #512 also touchesdev_flags.rs,settings.rsand thedocs/DEVELOPMENT.mdenv table. Expect textual conflicts on merge order, not semantic ones.Closes #447
— Claude Code, on @omesser's behalf.