Fix 'ok' short predictions: add explicit instruction to agent_input#6
Merged
Merged
Conversation
…onses
Clone MCP kept returning single-word or bare-affirmation responses
("ok", "looks good", "go ahead") because the agent_input gave it context
but no guidance on what to produce. The ask-user-question hook already
appends an explicit instruction block ("Predict the exact natural-language
answer... Return only the answer text") and gets specific responses — the
stop hook had no equivalent.
Add a 5-rule instruction block at the end of formatConversationHistory():
- write as the user typing their next message
- reference concrete artifacts, file names, or test results
- minimum 1 full sentence — no bare affirmations
- if work is complete, ask for the next logical action
Live e2e result before: "yeah go ahead"
Live e2e result after: "Go ahead and write the supertest integration tests
for the validation error cases."
Since formatConversationHistory() is shared, this also improves the
AskUserQuestion hook context quality (the instruction is appended before
the question block, adding further specificity to the surrounding context).
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Problem
Clone MCP kept returning single-word or bare-affirmation predictions —
"ok", "looks good", "go ahead" — instead of specific, actionable next
prompts. This caused the loop to escalate to humans even on iterations
where the work was clearly proceeding well.
Root cause
formatConversationHistory()(shared by both hooks) dumped theconversation context and then just ended. Clone MCP had no guidance on
what kind of response to produce, so it defaulted to the shortest
plausible user reply — a terse approval.
The
ask-user-questionhook already appends:Fix
Append a 5-rule instruction block to
formatConversationHistory():Since
formatConversationHistory()is shared, both hooks get the fixin one change.
Evidence
Live e2e against
https://api.clone.is/mcp(demo token):predicted_response"yeah go ahead""Go ahead and write the supertest integration tests for the validation error cases."Reasoning also improved — now explicitly cites prior turns.
Test plan
pnpm test→ 23/23 passing, including new assertions that theinstruction block appears in
agent_input.node scripts/manual-e2e-multiturn.mjs→ specific full-sentenceprediction confirmed.
🤖 Generated with Claude Code