Skip to content

refactor(harness): tidy loop lifecycle seams and add a live turn-snapshot test - #109

Merged
sanchitrk merged 2 commits into
canaryfrom
claude/cod-124-review-e705d5
Oct 26, 2026
Merged

sanchitrk merged 2 commits into
canaryfrom
claude/cod-124-review-e705d5

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Follow-up review of #108 (loop lifecycle seams). No behaviour change in the loop.

Loop

  • A committed turn is { messageId, reason } or nothing. needsContinuation is gone from Hooks.Completed, since it was always reason === "toolUse".

Docs

  • About 30 comments still said plugin setup and config run "per exchange". They now say per turn, including the plugin SDK's shared-context docs (context.ts, plugin.ts).
  • Comments and test names describe behaviour without naming other projects. The license attribution in util/module.ts stays.

Tests

  • Loop tests for the hooks:
    • a prepareNextTurn snapshot reaches the next request, along with a steer queued while it ran;
    • prepareRequest sees promoted input, and a steer queued during it waits for the next turn;
    • "continue" after a tool batch adds no request;
    • "end" skips next-turn preparation.
  • New live E2E, runner.turns.live.test.ts. In one real tool chain, the first tool edits the host settings file and unlocks a second tool. The very next request of the same run must carry the new header revision and the new tool, and the reply must contain the second tool's token. It passes on openai, openai-codex, anthropic and OpenRouter (deepseek, gemini, muse), with one artifact per provider.
  • settings.llm.test.ts now uses github-copilot/gemini-3.8-flash, since models.dev no longer lists 3.6.

Verification

  • vp check and vp run typecheck pass.
  • The full harness suite passes with live keys and a freshly generated catalog: 563 passed, 12 skipped.

🤖 Generated with Claude Code

sanchitrk and others added 2 commits October 27, 2026 02:42
- A committed turn is `{ messageId, reason }` or nothing; `needsContinuation`
  was always `reason === "toolUse"`, so it is gone from `Hooks.Completed`.
- Docs that still said plugin setup and config run per exchange now say per
  turn, including the plugin SDK's shared-context docs.
- New loop tests: a `prepareNextTurn` snapshot reaches the next request, with
  a steer queued while it ran; `prepareRequest` sees promoted input and does
  not promote a steer queued during it; `continue` after a tool batch adds no
  request; `end` skips next-turn preparation.
- Comments and test names describe behaviour without naming other projects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One real tool chain per provider: the first tool edits the host settings
file and unlocks a second tool, and the very next request of the same run
must carry the new header revision and the new tool. The copilot settings
test now names gemini-3.8-flash, since models.dev no longer lists 3.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit f4c1464 into canary Oct 26, 2026
2 checks passed
@sanchitrk
sanchitrk deleted the claude/cod-124-review-e705d5 branch October 26, 2026 21:51
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