Skip to content

feat(agent-harness): send each message once, without a Request line - #4604

Draft
wpfleger96 wants to merge 2 commits into
duncan/prompt-trimfrom
hayt/send-message-once
Draft

wpfleger96 wants to merge 2 commits into
duncan/prompt-trimfrom
hayt/send-message-once

Conversation

@wpfleger96

Copy link
Copy Markdown
Member

Every message that wakes an agent reached the model twice: once as the event JSON's content, and again as a Request: "..." line after it. This drops the line, so the event's content is the request. Turn Contract already says so.

  • eventBody no longer takes a request. Claude, Pi and goose already passed event.content.
  • Codex stops threading the textOf text through start, execute and turnInput. textOf stays only for Solo chat titles, which still strip a leading "🤖 " and "@name".
  • readEventBody, the Codex transcript and usage readers, the export scripts and session-model.mjs read the new form and still read the old one, so earlier sessions display as before. Without the line, a record counts as an event only when its kind is a number.

This saves the full message length on every mention and steer: about 750 chars at the median.

Stacked on #4603, since both change eventBody.

Merge order: squareup/buzz-plugin-security#32 has to merge, with its rebuilt plugin.js on main, before this PR. The plugin finds the current message by its Request: line. With an older plugin, turns are still inspected, just whole rather than message by message.

@wpfleger96
wpfleger96 force-pushed the hayt/send-message-once branch from dbc6c1f to 287529b Compare December 1, 2026 06:14
wpfleger96 and others added 2 commits December 1, 2026 01:25
A turn's event block followed the event JSON with a Request line that repeated its content, so every message reached the model twice. The event's content is now the request. Readers still accept the older form, so earlier sessions display as before.

Co-authored-by: Hayt <211b96e6a2b7f45fd4047988976c7bbbeeda0c15f3ae7b32eec20834b5a55118@buzz.block.builderlab.xyz>
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
The Codex export script and usage titles now read the event block first, with or without its Request line, and only then an older input's bare Request line.

Co-authored-by: Hayt <211b96e6a2b7f45fd4047988976c7bbbeeda0c15f3ae7b32eec20834b5a55118@buzz.block.builderlab.xyz>
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
@wpfleger96
wpfleger96 force-pushed the hayt/send-message-once branch from def2fc5 to 5c5a385 Compare December 1, 2026 06:28

This branch has not been deployed

No deployments
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.

1 participant