Share the terminal-nudge marker so collectors can recognize the nudge#172
Open
arseniycodes wants to merge 1 commit into
Open
Share the terminal-nudge marker so collectors can recognize the nudge#172arseniycodes wants to merge 1 commit into
arseniycodes wants to merge 1 commit into
Conversation
A collector that treats every user.message as a turn reset wipes a terminal tool call that raced the nudge by milliseconds — the ack is never sent and the session wedges in requires_action. Exporting the nudge's opening sentence lets collectors classify it as a poke that never resets captured state.
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/worker/src/agent-outcome-tools.ts">
<violation number="1" location="apps/worker/src/agent-outcome-tools.ts:48">
P2: The `TERMINAL_NUDGE_MARKER` is exported for collectors to recognize nudge messages, but no collector or event-stream code in this repository actually consumes the constant. Without the consuming-side change that avoids resetting captured turn state on messages matching this marker, the race condition described in the PR remains unfixed by this change alone. Please confirm whether the collector logic is updated in a companion PR or planned follow-up.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| // collectors can recognize the nudge in a session's user.message stream and | ||
| // treat it as a poke (never a turn reset): a nudge that lands milliseconds | ||
| // after the model's own terminal call must not invalidate that call. | ||
| export const TERMINAL_NUDGE_MARKER = |
Contributor
There was a problem hiding this comment.
P2: The TERMINAL_NUDGE_MARKER is exported for collectors to recognize nudge messages, but no collector or event-stream code in this repository actually consumes the constant. Without the consuming-side change that avoids resetting captured turn state on messages matching this marker, the race condition described in the PR remains unfixed by this change alone. Please confirm whether the collector logic is updated in a companion PR or planned follow-up.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/worker/src/agent-outcome-tools.ts, line 48:
<comment>The `TERMINAL_NUDGE_MARKER` is exported for collectors to recognize nudge messages, but no collector or event-stream code in this repository actually consumes the constant. Without the consuming-side change that avoids resetting captured turn state on messages matching this marker, the race condition described in the PR remains unfixed by this change alone. Please confirm whether the collector logic is updated in a companion PR or planned follow-up.</comment>
<file context>
@@ -41,6 +41,13 @@ export type OutcomeToolDefinition = {
+// collectors can recognize the nudge in a session's user.message stream and
+// treat it as a poke (never a turn reset): a nudge that lands milliseconds
+// after the model's own terminal call must not invalidate that call.
+export const TERMINAL_NUDGE_MARKER =
+ "You ended your turn without calling a terminal outcome tool";
+
</file context>
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.
Observed in a live session: the model called
propose_pr; the idle-nudgeuser.messagelanded 14ms later in the event stream; a collector that resets captured turn state on everyuser.messagewiped both the captured terminal call AND its pending ack — the session then sat inrequires_actionforever (the ack never arrives), unreachable by the spent one-shot nudge.Two changes:
TERMINAL_NUDGE_MARKERexported fromagent-outcome-tools.ts(the shared contract module) and used as the nudge prompt's opening sentence, so collectors can recognize nudge messages and treat them as pokes that never reset state.Summary by cubic
Exports a shared
TERMINAL_NUDGE_MARKERand uses it to build the idle terminal nudge so collectors can spot nudgeuser.messages and avoid resetting turn state. This prevents the race where a terminal tool call is wiped and the session gets stuck inrequires_action.Written for commit e28a542. Summary will update on new commits.