Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cli/__tests__/run-loop.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1353,12 +1353,15 @@ describe('performRun', () => {
// these name the comment route and the pod route separately.
describe('a comment @ (thread.mention)', () => {
const COMMENT_ROUTE = '/api/agents/runtime/threads/post-1/comments';
const FAILURE_LINE = 'If you can\'t do what someone asked of you, don\'t go silent: say in plain words what didn\'t work and what they can do next, '
+ 'without event types, checkpoints, deliveries, retries or other runtime terms unless they asked about them. '
+ 'If you already replied to this comment, reply to it again with the failure note: final text after such a reply is dropped.';
const FINAL_TEXT_ON_COMMENT = 'Your final text is posted as a reply to this comment unless it is exactly NO_REPLY. '
+ 'Do not also post it to pod chat. If you have nothing to add, or already replied with '
+ 'commonly_post_thread_comment, end with NO_REPLY alone, with no summary.';
+ `commonly_post_thread_comment, end with NO_REPLY alone, with no summary. ${FAILURE_LINE}`;
const FINAL_TEXT_ANSWERS_ON_COMMENT = 'Your final text is posted as a reply to this comment unless it is exactly NO_REPLY. '
+ 'Do not also post it to pod chat. '
+ 'Use NO_REPLY alone only after you replied with commonly_post_thread_comment, with no summary.';
+ `Use NO_REPLY alone only after you replied with commonly_post_thread_comment, with no summary. ${FAILURE_LINE}`;

const commentEvent = (overrides = {}) => makeEvent({
_id: 'evt-comment',
Expand Down
15 changes: 11 additions & 4 deletions cli/src/commands/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1580,9 +1580,14 @@ export const runMemoryImport = async ({
// would also eat a pod that is discussing these words. It speaks only to a
// request it can't meet, so it gives a heartbeat no reason to post. Every closing
// line carries it, and it says where the note goes once the agent has posted.
const FAILURE_IN_PLAIN_WORDS = 'If you can\'t do what someone asked of you, don\'t go silent: say in plain words what didn\'t work and what they can do next, '
+ 'without event types, checkpoints, deliveries, retries or other runtime terms unless they asked about them. '
const SAY_A_FAILURE = 'If you can\'t do what someone asked of you, don\'t go silent: say in plain words what didn\'t work and what they can do next, '
+ 'without event types, checkpoints, deliveries, retries or other runtime terms unless they asked about them. ';
const FAILURE_IN_PLAIN_WORDS = SAY_A_FAILURE
+ 'If you already posted in this turn, post the failure note through the tool as well: final text after a tool post is dropped.';
// A comment drops final text only after a threaded reply to that comment, so
// a tool post anywhere else would not save a second post (review of #3567).
const FAILURE_ON_COMMENT = SAY_A_FAILURE
+ 'If you already replied to this comment, reply to it again with the failure note: final text after such a reply is dropped.';

// TASK-293, and the rule AX entry 43 earned: a frame that says "otherwise
// return NO_REPLY" must also say what the otherwise costs. Silence here is an
Expand All @@ -1600,10 +1605,12 @@ const FINAL_TEXT_IS_POSTED = 'Your final text is posted to the pod unless it is
// A person who @'d the seat is not offered silence, only the tool's exit.
const FINAL_TEXT_ON_COMMENT = 'Your final text is posted as a reply to this comment unless it is exactly NO_REPLY. '
+ 'Do not also post it to pod chat. If you have nothing to add, or already replied with '
+ 'commonly_post_thread_comment, end with NO_REPLY alone, with no summary.';
+ 'commonly_post_thread_comment, end with NO_REPLY alone, with no summary. '
+ FAILURE_ON_COMMENT;
const FINAL_TEXT_ANSWERS_ON_COMMENT = 'Your final text is posted as a reply to this comment unless it is exactly NO_REPLY. '
+ 'Do not also post it to pod chat. '
+ 'Use NO_REPLY alone only after you replied with commonly_post_thread_comment, with no summary.';
+ 'Use NO_REPLY alone only after you replied with commonly_post_thread_comment, with no summary. '
+ FAILURE_ON_COMMENT;

// Prod walk, 2026-11-05: a person @mentioned a Claude Code seat with a
// top-level message, and the seat answered through commonly_post_message with
Expand Down
Loading