agy-cli 0.1.76: a tool result buried under a client's own notice settles the round, not tool_state_conflict (#1208)
A client that answered the bridge's pending call and then wrote an assistant notice of its own and a new prompt (Hermes Agent's "This turn did not complete…" closer) carried the result in history, not the trailing. With no trailing results the request took the acquire path, lineageVerdict saw the carried tool_use and answered 400 tool_state_conflict on every resend until the 30-minute result timeout. Now, when every call of the pending turn that the request carries has a tool_result after it, the round is settled on the client's side: the turn is superseded (logged as lineage_answered) and the request replays as a new session, the buried result and the new prompt included. A carried call with no result is still a terminal conflict. Reported by 1468323775 with the exact request shape and a live repro. Run (mote, HOME=$(mktemp -d)): - packages/agy-cli: bun test: 36 pass, 0 fail (smoke 382 checks). - bun scripts/check.mjs agy-cli: ok. Broken by hand: origin/main's index.mjs with the new smoke checks: 3 fail, with the reporter's 400 tool_state_conflict body. Not tried: a real agy account (the local one answers 403) or Hermes Agent itself. The live session's prompt cache is not kept on this path: it replays as a new session, as an interrupted round already does.
This commit is contained in:
@@ -2946,6 +2946,26 @@ for (const location of ["inline", "system", "developer", "user"]) {
|
||||
check("terminal lineage conflicts leave the original tool turn usable", inits().length === before && stopOf(done.events) === "end_turn")
|
||||
}
|
||||
|
||||
{
|
||||
// #1208: the client answered the pending call, then wrote a notice of its own
|
||||
// and a new prompt, so the result is in history, not the trailing.
|
||||
const body = { model, metadata: { user_id: "buried-result" },
|
||||
messages: [{ role: "user", content: "TOOL buried result" }], tools: [echoTool] }
|
||||
const pending = (await readSSE(await callFetch(body))).events
|
||||
const answered = continuation(body, pending, "buried result text")
|
||||
const buried = { ...answered, messages: [...answered.messages,
|
||||
{ role: "assistant", content: "This turn did not complete. Some actions may already have run; verify their effects before resending." },
|
||||
{ role: "user", content: "continue after the notice" }] }
|
||||
const response = await callFetch(buried)
|
||||
const final = response.status === 200 ? (await readSSE(response)).events : []
|
||||
if (response.status !== 200) console.error("buried result:", response.status, await response.text())
|
||||
check("a result buried under a client notice continues instead of tool_state_conflict", response.status === 200 && final.length > 0)
|
||||
check("the replay carries the buried result and the new prompt", lastOf("user").text.includes("buried result text") && lastOf("user").text.includes("continue after the notice"))
|
||||
// The replayed opening still says TOOL, so the fake asks for a tool again.
|
||||
const done = await drive(buried, final)
|
||||
check("the conversation after a buried result runs to its end", stopOf(done.events) === "end_turn")
|
||||
}
|
||||
|
||||
{
|
||||
// The existing LONGTOOL fake repeats identical calls until told to stop.
|
||||
// Speed up its MCP deadline, keeping the production default repeat cap of 8.
|
||||
|
||||
Reference in New Issue
Block a user