test(core): align tool contract expectations - #39172
Merged
Merged
Conversation
kitlangton
enabled auto-merge (squash)
July 27, 2026 19:36
kitlangton
force-pushed
the
v2-unit-failures
branch
from
July 28, 2026 00:17
04c18b1 to
b6299d0
Compare
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.
What
Restore the V2 unit suite after the consolidated tool architecture changed the runner request envelope, tool result shape, and required test services.
Before / After
Before: Core tests expected direct tool definitions without the built-in Code Mode
executetool or empty-catalog guidance, asserted removed result status fields and legacytool.unknownerrors, and built Code Mode fixtures without the now-required Location service. This produced 29 consistent core failures on Linux and Windows.After: Runner tests isolate their subject from the orthogonal Code Mode envelope, assertions use the canonical tool result and
tool.executioncontracts, obsolete tests for deleted injection/persistence seams are removed, and Code Mode fixtures provide Location. The full core suite passes.How
session-runner.test.tsby removing only the built-in empty Code Mode guidance andexecutedefinition before runner-specific assertions./projectLocation in standalone Code Mode test layers.Scope
executedefinition and catalog guidance.Testing
env OPENCODE_CONFIG_DIR=/tmp/opencode-v2-unit-config OPENCODE_TEST_HOME=/tmp/opencode-v2-unit-home bun run testfrompackages/core(1472 pass,6 skip,0 fail)bun typecheckfrompackages/core32 successful,32 total)Update after rebase onto latest v2
Rebased onto
4333a44e65and added two commits for failures the rebase exposed (base CI stops atcore:test, so these were masked until this PR made core green):fix(core): omit undefined exit from shell tool output— fix(core): simplify tool schemas #39184 changed the shell Output schema toSchema.optionalKey, which rejects a present-but-undefinedexitkey; a timed-out command finishes withexit: undefined, so output encoding failed andShellTool > returns a useful timeout outcomebroke on base. The tool now omitsexitwhen the process has no exit code.test(cli): use read tool path input in acp fixtures— feat(core): improve read tool parity #39126 renamed the read tool input fromfilePathtopathbut left the synthetic read fixtures intest/acp/event-behavior.test.tsandtest/acp/permission-behavior.test.tson the old key, sotoLocationsderived empty locations.chore(sdk): regenerate promise client typesandchore(www): regenerate openapi documents— theCheck generated client/Check generated documentationsteps were also masked on base for the same reason; upstream schema changes (LLMToolContent→ToolContent, nullable filename, new/api/agent/{agentID}endpoint) left the generated surfaces stale. Regenerated viabun run generate, updated the two type-only consumers inpackages/cli.Local:
packages/core1478 pass / 0 fail,packages/cli161 pass / 0 fail,bun typecheckclean in core, cli, and client.