Skip to content

Commit 94f79ef

Browse files
committed
Share the ask_director wake prefix across leftover ingest and sent-message skip
Leftover ingest skip and sent-message skip both matched the wake prefix as a string literal. Export ASK_DIRECTOR_WAKE_PREFIX from fleet-report (the wake text source) and use it in queued-delivery and submit.
1 parent 7c75775 commit 94f79ef

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/subagent/fleet-report.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,16 @@ export function pendingAskSnapshot(
154154
return asks;
155155
}
156156

157+
export const ASK_DIRECTOR_WAKE_PREFIX = "ask_director wake";
158+
157159
/**
158160
* The wake turn text. It must read as the worker's question reaching the
159161
* parent, not as the operator being asked — the parent answers via
160162
* send_input itself and only escalates when it genuinely cannot.
161163
*/
162164
export function pendingAskWakeText(wake: PendingAskWake): string {
163165
return [
164-
`ask_director wake — worker ${wake.agentId} (${wake.description}) parked question ${wake.questionId} while this session was not collecting:`,
166+
`${ASK_DIRECTOR_WAKE_PREFIX} — worker ${wake.agentId} (${wake.description}) parked question ${wake.questionId} while this session was not collecting:`,
165167
"",
166168
wake.question,
167169
"",

src/tui/queued-delivery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import type { PendingImageAttachment } from "./image-attachments.js";
1212
import type { ProductHostDeliver } from "./product-host.js";
13+
import { ASK_DIRECTOR_WAKE_PREFIX } from "../subagent/fleet-report.js";
1314

1415
export interface RouteQueuedDeliveryArgs {
1516
send: (text: string, attachments?: readonly PendingImageAttachment[]) => void;
@@ -131,7 +132,7 @@ export function createLeftoverSend(
131132
...args,
132133
hop: args.send,
133134
ingest: async (text, pending) =>
134-
text.startsWith("ask_director wake")
135+
text.startsWith(ASK_DIRECTOR_WAKE_PREFIX)
135136
? { text, attachments: pending }
136137
: args.ingest(text, pending),
137138
});

src/tui/runner/submit.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import type { InferenceAttemptIdentity } from "./state.js";
3737
import { tuiSendFailureMessage } from "./send-failure-message.js";
3838
import type { ProviderFailureAttempt } from "../provider/failure-attempt.js";
3939
import type { Agent } from "@intx/agent";
40+
import { ASK_DIRECTOR_WAKE_PREFIX } from "../../subagent/fleet-report.js";
4041
import { hostOf, type RunnerServices, type RunnerState } from "./state.js";
4142
import { LOG_NAMESPACE_ROOT } from "../../branding.js";
4243

@@ -351,7 +352,7 @@ export function createDeliverRouting(
351352
},
352353
recordSent: (text) => {
353354
if (text.trim().length === 0) return;
354-
if (text.startsWith("ask_director wake")) return;
355+
if (text.startsWith(ASK_DIRECTOR_WAKE_PREFIX)) return;
355356
void appendSentMessage(state.config.cwd, state.sessionId, text).catch((err: unknown) => {
356357
tuiLogger.debug("sent-message append failed: {error}", {
357358
error: err instanceof Error ? err.message : String(err),

0 commit comments

Comments
 (0)