Merge pull request #674 from rowboatlabs/code-mode-fixes

Code mode fixes
This commit is contained in:
Ramnique Singh 2026-07-06 14:06:41 +05:30 committed by GitHub
commit 1050614295
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 686 additions and 259 deletions

View file

@ -73,3 +73,11 @@ export const RunPromptResult = z.object({
sessionId: z.string(),
});
export type RunPromptResult = z.infer<typeof RunPromptResult>;
// One item on the ephemeral CodeRunFeed (`codeRun:events` broadcast): a live
// code-run event tagged with the tool call it belongs to. Fire-and-forget —
// the durable record is the code-run-events-batch written when the run settles.
export type CodeRunFeedEvent = {
toolCallId: string;
event: CodeRunEvent;
};

View file

@ -21,7 +21,7 @@ import { ZListToolkitsResponse } from './composio.js';
import { BrowserStateSchema, HttpAuthRequestSchema } from './browser-control.js';
import { BillingInfoSchema } from './billing.js';
import { EmailBlockSchema, GmailThreadSchema } from './blocks.js';
import { PermissionDecision, ApprovalPolicy, CodingAgent } from './code-mode.js';
import { PermissionDecision, ApprovalPolicy, CodingAgent, type CodeRunFeedEvent } from './code-mode.js';
import { NotificationSettingsSchema } from './notification-settings.js';
import { CodeProject, CodeSession, CodeSessionMode, CodeSessionStatus, GitRepoInfo, GitStatusFile, CodeAgentModelOptions } from './code-sessions.js';
import { ChannelsConfig, ChannelsStatus } from './channels.js';
@ -450,6 +450,14 @@ const ipcSchemas = {
req: z.null(),
res: z.null(),
},
// Ephemeral code-run stream (CodeRunFeed): per-event broadcast of a
// code_agent_run's live ACP activity, keyed by toolCallId. Never persisted —
// the durable record is the code-run-events-batch tool progress written when
// the run settles. Typed via z.custom like the other broadcast feeds.
'codeRun:events': {
req: z.custom<CodeRunFeedEvent>(),
res: z.null(),
},
// ── New runtime: sessions + turns (session-design.md) ────────────────────
// Turn-mutating calls return quickly; the renderer follows progress through
// the sessions:events feed and the shared reduceTurn reducer.

View file

@ -130,6 +130,17 @@ export const CodeRunPermissionRequestEvent = BaseRunEvent.extend({
ask: PermissionAsk,
});
// The complete, ordered code-run timeline, published ONCE when the coding turn
// settles (consecutive agent message chunks coalesced — display-lossless, the
// timeline concatenates them anyway). This is the durable record; the live
// per-event stream travels over the ephemeral CodeRunFeed (`codeRun:events`)
// and is never persisted.
export const CodeRunEventsBatchEvent = BaseRunEvent.extend({
type: z.literal("code-run-events-batch"),
toolCallId: z.string(),
events: z.array(CodeRunEventSchema),
});
export const ToolPermissionAutoDecisionEvent = BaseRunEvent.extend({
type: z.literal("tool-permission-auto-decision"),
toolCallId: z.string(),
@ -165,6 +176,7 @@ export const RunEvent = z.union([
ToolPermissionResponseEvent,
CodeRunStreamEvent,
CodeRunPermissionRequestEvent,
CodeRunEventsBatchEvent,
ToolPermissionAutoDecisionEvent,
RunErrorEvent,
RunStoppedEvent,