feat(harness): model catalog, connection test, edit matrix in the create/edit wizard (PHNX-2218) - #3293
Merged
Merged
Conversation
…ard (PHNX-2218) Fills the three remaining seams the RUSH-2219 wizard scaffold left open, landing the full interactive create/edit surface for `agents harness`: - PHNX-2220 param surface + model catalog: the model step is a catalog pick from the host's own `getModelCatalog` (with a free-text escape hatch + fallback); the endpoint step is gated to hosts that carry a base-URL slot. Wired via a new `harness-hooks.ts` `pickModel` hook, passed into the wizard runs. - PHNX-2221 connection test: a shared `harness-connection-test.ts` runs a real `agents run <name> "say alive in one word" --headless --timeout 60s` through the live resolution path and classifies the result (pass / auth / endpoint / model / unknown). Behind a confirm with `--test`/`--no-test`; on failure a TTY offers keep / edit / delete, never a silent block. - PHNX-2222 editability matrix: `harnessEditable(host)` sourced entirely from the resolver maps (baseUrl/auth env keys + isSelfUpdatingAgent), each disabled field carrying its reason; `defaultEditable` is now its boolean projection so they can't drift. Docs (profiles.md) + CHANGELOG updated; new unit tests for the classifier, the catalog choice builder, and the matrix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…view follow-up) Addresses the code-reviewer CHANGES-REQUESTED findings on PR #3293: - Extract the tri-state connection-test decision into a pure exported `connectionTestGate(testFlag, interactive)` and unit-test all six cases (--test/--no-test forced on/off, TTY-ask, non-interactive skip). - Extract `chooseModelFromCatalog` from `pickModel` and export both; test the pick / keep-current / custom-id branches with a scripted IO, plus pickModel's no-host free-text fallthrough. - Doc callout: a --test failure in a non-interactive shell warns and keeps (exit 0), not a hard CI gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
Non-author review —
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
muqsitnawaz
pushed a commit
that referenced
this pull request
Aug 30, 2026
…view follow-up) Addresses the code-reviewer CHANGES-REQUESTED findings on PR #3293: - Extract the tri-state connection-test decision into a pure exported `connectionTestGate(testFlag, interactive)` and unit-test all six cases (--test/--no-test forced on/off, TTY-ask, non-interactive skip). - Extract `chooseModelFromCatalog` from `pickModel` and export both; test the pick / keep-current / custom-id branches with a scripted IO, plus pickModel's no-host free-text fallthrough. - Doc callout: a --test failure in a non-interactive shell warns and keeps (exit 0), not a hard CI gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lands the harness create/edit wizard cluster — PHNX-2218 (parent) and its three open subtasks PHNX-2220 / 2221 / 2222 — by filling the typed no-op seams the RUSH-2219 wizard scaffold (
harness-wizard.ts) shipped. One worktree, built in ticket order.What each ticket delivered
getModelCatalog(same list behindagents models <host>) with a tier/alias hint and an always-present "type a custom model id…" escape hatch; a host with no probeable catalog falls back to free text. The endpoint step is gated to hosts that carry a base-URL slot. Newsrc/commands/harness-hooks.tsimplements thepickModelhook (+ purebuildModelChoices), passed into both wizard runs.src/lib/harness-connection-test.tsruns a realagents run <name> "say alive in one word" --headless --timeout 60sthrough the live path (resolveProfileForRun->resolveProfileEnv->buildExecEnv-> spawn) and classifies the outcome into pass / auth / endpoint / model / unknown. Behind a confirm (default yes) with--test/--no-test; non-interactive skips unless--test. A failure never blocks silently — on a TTY it offers keep / edit now / delete-and-cancel.harnessEditable(host)is sourced entirely from the resolver maps (baseUrlEnvKeyForHost/authEnvKeyForHost/isSelfUpdatingAgent), each disabled field carrying its reason;defaultEditableis now its boolean projection, so the wizard enable/disable can never drift from what a run honors.Run evidence
Real connection test on the live path (fresh HOME, claude unresolvable -> classified + non-interactive keep+hint):
Endpoint gating (opencode carries no base-URL slot, not asked/dropped):
Tests
src/lib/harness-connection-test.test.ts— classifier maps real provider stderr -> auth / model / endpoint / unknown / pass.src/commands/harness-hooks.test.ts— catalog -> select choices (escape hatch, keep-current, tier/alias hints).src/commands/harness-wizard.test.ts— extended forharnessEditable.Docs:
cli/docs/profiles.md+ CHANGELOG fragmentcli/.changelog/next/PHNX-2218.md.Closes PHNX-2220, PHNX-2221, PHNX-2222; advances PHNX-2218.
Generated with Claude Code