Skip to content

Commit 95611e1

Browse files
committed
fix: use provider-specific running fallback titles
1 parent 7c38a59 commit 95611e1

File tree

7 files changed

+44
-15
lines changed

7 files changed

+44
-15
lines changed

packages/agents/test/claude-stream-status.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ describe("claude stream status parsing", () => {
378378
expect(text).not.toContain(longResponse);
379379
});
380380

381-
it("falls back to opencode header when title is unavailable", () => {
381+
it("falls back to claude header when title is unavailable", () => {
382382
const now = Date.now();
383383
const state = buildSessionMessageState([
384384
rawEvent(now, {
@@ -403,6 +403,6 @@ describe("claude stream status parsing", () => {
403403
"minimum"
404404
);
405405

406-
expect(text).toContain("*Opencode is running...*");
406+
expect(text).toContain("*Claude Code is running...*");
407407
});
408408
});

packages/agents/test/gemini-stream-status.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe("gemini stream status parsing", () => {
5454
expect(state.phaseStatus).toBe("Drafting response");
5555
});
5656

57-
it("uses opencode fallback header when title is missing", () => {
57+
it("uses gemini fallback header when title is missing", () => {
5858
const now = Date.now();
5959
const state = buildSessionMessageState([
6060
rawEvent(now, {
@@ -77,6 +77,6 @@ describe("gemini stream status parsing", () => {
7777
"medium"
7878
);
7979

80-
expect(text).toContain("*Opencode is running...*");
80+
expect(text).toContain("*Gemini is running...*");
8181
});
8282
});

packages/core/runtime/open-request.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ export async function runOpenRequest(params: {
5555
publishFinalText,
5656
} = params;
5757

58+
const providerLabel = deps.agent.getDisplayNameForSession(sessionId);
59+
5860
const statusTs = await deps.im.sendMessage(
5961
context.channelId,
6062
context.replyThreadId,
61-
"Opencode is running...",
63+
`${providerLabel} is running...`,
6264
false
6365
);
6466

packages/core/runtime/selection-reply.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ export async function handleSelectionReply(params: HandleSelectionReplyParams):
7070
markMessageProcessed(channelId, threadId, messageTs);
7171

7272
const providerId = deps.agent.getProviderForSession(sessionId);
73+
const providerLabel = deps.agent.getDisplayNameForSession(sessionId);
7374

74-
const statusTs = await deps.im.sendMessage(channelId, threadId, "Opencode is running...", false);
75+
const statusTs = await deps.im.sendMessage(channelId, threadId, `${providerLabel} is running...`, false);
7576
if (!statusTs) {
7677
log.error("Failed to send status message for button selection");
7778
return;

packages/core/test/status-message.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("buildStatusMessageForAgent", () => {
4444
expect(text).not.toBe("custom status");
4545
});
4646

47-
it("uses opencode fallback header when title is missing", () => {
47+
it("uses provider fallback header when title is missing", () => {
4848
const agent = {
4949
getProviderForSession: () => "codex",
5050
buildStatusMessage: () => "custom status",
@@ -61,7 +61,7 @@ describe("buildStatusMessageForAgent", () => {
6161
statusMessageFormat: "medium",
6262
});
6363

64-
expect(text).toContain("*Opencode is running...*");
64+
expect(text).toContain("*Codex is running...*");
6565
});
6666

6767
it("uses fallback header for opencode when title is missing", () => {

packages/live-status-harness/test/render-status.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe("live status harness renderer", () => {
6565
const joined = statuses.map((status) => status.text).join("\n\n");
6666

6767
expect(statuses.length).toBeGreaterThanOrEqual(2);
68-
expect(joined).toContain("Opencode is running...");
68+
expect(joined).toContain("Goose is running...");
6969
expect(joined).toContain("Finished tool: Read");
7070
});
7171

@@ -120,7 +120,7 @@ describe("live status harness renderer", () => {
120120
const joined = statuses.map((status) => status.text).join("\n\n");
121121

122122
expect(statuses.length).toBeGreaterThanOrEqual(2);
123-
expect(joined).toContain("Opencode is running...");
123+
expect(joined).toContain("Gemini is running...");
124124
expect(joined).toContain("Running tool: read_file");
125125
});
126126
});

packages/utils/status.ts

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ export type StatusRequest = {
1414
};
1515

1616
export type AgentStatusProvider = "opencode" | "claudecode" | "codex" | "kimi" | "kiro" | "kilo" | "qwen" | "goose" | "gemini";
17-
const DEFAULT_FALLBACK_TITLE = "Opencode is running...";
17+
18+
const PROVIDER_FALLBACK_TITLES: Record<AgentStatusProvider, string> = {
19+
opencode: "Opencode is running...",
20+
claudecode: "Claude Code is running...",
21+
codex: "Codex is running...",
22+
kimi: "Kimi is running...",
23+
kiro: "Kiro is running...",
24+
kilo: "Kilo is running...",
25+
qwen: "Qwen is running...",
26+
goose: "Goose is running...",
27+
gemini: "Gemini is running...",
28+
};
1829

1930
type StatusTodo = {
2031
content: string;
@@ -285,7 +296,7 @@ export function buildLiveStatusMessage(
285296
if (request.statusFrozen && request.currentText) {
286297
return request.currentText;
287298
}
288-
return `${DEFAULT_FALLBACK_TITLE} (${formatElapsedTime(request.startedAt)})`;
299+
return `_Working_ (${formatElapsedTime(request.startedAt)})`;
289300
}
290301

291302
if (request.statusFrozen && request.currentText) {
@@ -298,7 +309,7 @@ export function buildLiveStatusMessage(
298309
if (state.sessionTitle) {
299310
lines.push(`*${state.sessionTitle}* (${headerDetails})`);
300311
} else {
301-
lines.push(`*${DEFAULT_FALLBACK_TITLE}* (${headerDetails})`);
312+
lines.push(`_${headerDetails}_`);
302313
}
303314

304315
if (state.phaseStatus) {
@@ -323,11 +334,26 @@ export function buildLiveStatusMessage(
323334
}
324335

325336
export function buildStatusMessageByProvider(
326-
_provider: AgentStatusProvider,
337+
provider: AgentStatusProvider,
327338
request: StatusRequest,
328339
workingPath: string,
329340
state?: SessionMessageState,
330341
statusMessageFormat: StatusMessageFormat = "medium"
331342
): string {
332-
return buildLiveStatusMessage(request, workingPath, state, statusMessageFormat);
343+
const fallbackTitle = PROVIDER_FALLBACK_TITLES[provider];
344+
345+
const effectiveState: SessionMessageState = state
346+
? {
347+
...state,
348+
sessionTitle: state.sessionTitle || fallbackTitle,
349+
}
350+
: {
351+
sessionTitle: fallbackTitle,
352+
currentText: request.currentText,
353+
tools: [],
354+
todos: [],
355+
startedAt: request.startedAt,
356+
};
357+
358+
return buildLiveStatusMessage(request, workingPath, effectiveState, statusMessageFormat);
333359
}

0 commit comments

Comments
 (0)