Skip to content

Start Run with Agentic Harness on the change it was opened for - #201

Closed
VeryComplexAndLongName wants to merge 3 commits into
mainfrom
feat/run-with-harness-prefills-the-run
Closed

Start Run with Agentic Harness on the change it was opened for#201
VeryComplexAndLongName wants to merge 3 commits into
mainfrom
feat/run-with-harness-prefills-the-run

Conversation

@VeryComplexAndLongName

Copy link
Copy Markdown
Owner

Two commits: the archive move that was blocking npm run lint, and the prefill itself.

The prefill — one defect, three symptoms

Right-clicking a change and choosing Run with Agentic Harness opened a panel with nothing filled in: command list, no change selected, default agent.

Everything needed was already there. runWithHarness passes the change:

revealAiPanel({ ...dashboardContext(workspaceRoot, item.changeDir), startChain })

and AiPanel takes changeDir as a prop. It simply started from useState<CommandKind>("list") and useState<string>("") and never consulted it.

The agent is the same fact one step further on. AiPanel already pre-selects from stepAgents, keyed on the command kind through COMMAND_KIND_TO_HARNESS_STAGE. With the kind stuck at list there is no stage, so no entry is looked up and the picker keeps DEFAULT_AGENT_ID.

Seeding the kind fixes the agent as a consequence — the configured agent was never unavailable, only unreachable.

What the test caught

Seeding the selection alone was not enough:

expected '' to be 'demo'

A <select> cannot hold a value it has no <option> for, so the seeded change silently fell back to empty until a list had run. The option list is seeded too now, and the existing reconciling effect replaces it with the real list while keeping the selection.

Nothing is enforced — every seeded value stays editable, the same way the stepAgents recommendation already was. The chain path is untouched: runChange is set only for the picker target, since HarnessChainPanel has one button and nothing to pre-select.

The archive move

dispatch-to-chat-integration-coverage was implemented and its directory moved to archive/ on disk, but the deletion of the original path was left unstaged — so the old files stayed git-tracked while missing from the working tree, and check-english.mjs died with ENOENT before eslint ever ran.

That is the same failure that made npm run lint expected-red for days earlier this week, from the same cause: an archive move committed halfway. Staged both halves; 31/31 tasks complete, archive copy verified intact.

Staging it also surfaced a real no-useless-escape error in my own new test, which had been hidden behind that ENOENT — the precise reason this matters.

Test plan

  • npm run typecheck — clean
  • npm run lint — clean (0 errors), once the archive move was staged
  • AiPanel 43/43, extension-context 7/7
  • openspec change validate --strict — valid
  • Only failing suite is git.push.test.ts, tracked as core-test-worker-contention
  • CI green
  • Human: right-click a change → Run with Agentic Harness → confirm the change, implement and the configured agent are already selected, and that changing any of them still works

🤖 Generated with Claude Code

The change was implemented and its directory moved to archive/ on disk,
but the deletion of the original path was left unstaged - so the old
files stayed git-tracked while missing from the working tree, and
check-english.mjs died with ENOENT before eslint ever ran.

That is the same failure that made npm run lint expected-red for days
earlier this week, from the same cause: an archive move committed
halfway. Staging both halves together is what keeps the check meaningful.

31 of 31 tasks complete, archive copy verified intact.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Right-clicking a change and choosing Run with Agentic Harness opened a
panel with nothing filled in: command `list`, no change selected, default
agent. The user re-entered what they had just said by right-clicking.

Everything needed was already there. runWithHarness passes the change -
revealAiPanel({ ...dashboardContext(workspaceRoot, item.changeDir),
startChain }) - and AiPanel takes changeDir as a prop. It simply started
from useState("list") and useState("") and never consulted it.

The agent is the same fact one step further on. AiPanel already
pre-selects from stepAgents, keyed on the command kind through
COMMAND_KIND_TO_HARNESS_STAGE. With the kind stuck at `list` there is no
stage, so no entry is looked up and the picker keeps DEFAULT_AGENT_ID.
Seeding the kind fixes the agent as a consequence - the configured agent
was never unavailable, only unreachable. One defect, three symptoms.

Seeding the selection alone was not enough, and the test caught it: a
<select> cannot hold a value it has no option for, so the seeded change
silently fell back to empty until a `list` had run. The option list is
seeded too, and the existing reconciling effect replaces it with the real
list while keeping the selection.

Nothing is enforced. Every seeded value stays editable, the same way the
stepAgents agent recommendation already was. The chain path is untouched:
a config resolving to `chain` mounts HarnessChainPanel, which has one
button and nothing to pre-select, so `runChange` is set only for the
picker target.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@VeryComplexAndLongName

Copy link
Copy Markdown
Owner Author

Superseded by a branch rebased onto main. The original branch was cut from a sibling branch whose commit later landed on main as #200 (squashed), so the same content appeared twice and the pull request conflicted before CI could start.

@VeryComplexAndLongName
VeryComplexAndLongName deleted the feat/run-with-harness-prefills-the-run branch September 5, 2026 05:44
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.

1 participant