ask: tell the worker to write answer.md, matching the check - #103
Open
elRafa wants to merge 1 commit into
Open
Conversation
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>
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.
Fixes #102.
The
askpacket preamble never tells the worker about theanswer.mdcontract that the check (test -s answer.md) andexpect_filesdemand — and withmax_attempts=1the 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 writesanswer.mdunconditionally.Change: one sentence in the preamble instructing the worker to write the final answer to
answer.mdand 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). Existingtest_ask_command.pysuite unaffected since the mock worker path doesn't parse the preamble.🤖 Generated with Claude Code