Skip to content

ask: tell the worker to write answer.md, matching the check - #103

Open
elRafa wants to merge 1 commit into
NateBJones-Projects:mainfrom
elRafa:fix-ask-answer-contract
Open

ask: tell the worker to write answer.md, matching the check#103
elRafa wants to merge 1 commit into
NateBJones-Projects:mainfrom
elRafa:fix-ask-answer-contract

Conversation

@elRafa

@elRafa elRafa commented Aug 9, 2026

Copy link
Copy Markdown

Fixes #102.

The ask packet preamble never tells the worker about the answer.md contract that the check (test -s answer.md) and expect_files demand — and with max_attempts=1 the retry that would surface the filename never fires. Any engine that answers inline (i.e. all of them, absent an instruction to write a file) fails every run. The existing tests can't catch it because their mock worker writes answer.md unconditionally.

Change: one sentence in the preamble instructing the worker to write the final answer to answer.md and also print it. The print keeps the raw-output/token-regex path unchanged.

Verified: opencode engine, openrouter/z-ai/glm-5.2 — deterministic FAIL before (two runs, both machines), PASS after (both machines; worker tool-calls the file write on attempt 1). Existing test_ask_command.py suite unaffected since the mock worker path doesn't parse the preamble.

🤖 Generated with Claude Code

The one-request manifest's check requires a non-empty answer.md
(expect_files declares it too), but the packet preamble never
instructs the worker to create any file — it says 'return only
the answer'. With max_attempts=1 the retry that would surface
the filename in failure context never fires, so every real-engine
ask fails attempt 1 with 'missing expected files: answer.md'.
The unit tests mask this: their mock worker writes answer.md
unconditionally.

Fix: one sentence in the preamble naming the contract file.
Verified with the opencode engine (GLM-5.2): FAIL before, PASS after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

ask: every real-engine run fails — check demands answer.md but the packet never instructs writing it

1 participant