Rebase onto dev: reconcile code-mode + direct mode on its own runtime

Rebased new-runtime onto dev (which added code-mode on the old runs-based
runtime). Reconciliation: kept the generic event-log + bus (runs/repo.ts,
runs/bus.ts, a trimmed runs.ts = createRun + fetchRun only) decoupled from the
retired LLM runtime; restored the runsRepo DI registration and the
bus -> runs:events forwarder.

Step 1 of the code-mode migration — direct mode on its own dedicated runtime:
- new SQLite-backed CodeEventStore (migration 0008 + code_session_events) replaces
  the runs JSONL log for code sessions
- dedicated codeEventBus (InMemoryBus) + codeSession:events feed +
  codeSession:getEvents history channel, replacing the shared bus / runs:events /
  runs:fetch for code
- CodeSessionService mints its own id (drops createRun) and writes to
  codeEventStore / codeEventBus; status-tracker subscribes to codeEventBus
- renderer (use-code-chat) loads history via codeSession:getEvents and streams via
  codeSession:events

Rowboat mode is temporarily disabled in the UI (its old copilot-LLM path is
retired); it moves onto the new sessions runtime in step 2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ramnique Singh 2026-06-15 10:39:20 +05:30
parent 251a462686
commit d0ba9fa4a6
12 changed files with 201 additions and 175 deletions

View file

@ -19,9 +19,9 @@ import { RowboatApiConfig } from './rowboat-account.js';
import { ZListToolkitsResponse } from './composio.js';
import { BrowserStateSchema } from './browser-control.js';
import { BillingInfoSchema } from './billing.js';
import { EmailBlockSchema, GmailThreadSchema } from './blocks.js';
import { GmailThreadSchema } from './blocks.js';
import { PermissionDecision, ApprovalPolicy, CodingAgent } from './code-mode.js';
import { Run } from './runs.js';
import { Run, RunEvent } from './runs.js';
import { NotificationSettingsSchema } from './notification-settings.js';
import { CodeProject, CodeSession, CodeSessionMode, CodeSessionStatus, GitRepoInfo, GitStatusFile } from './code-sessions.js';
@ -572,6 +572,17 @@ const ipcSchemas = {
}),
res: z.null(),
},
// Code-mode's own transcript history (replaces the generic runs:fetch).
'codeSession:getEvents': {
req: z.object({ sessionId: z.string() }),
res: z.object({ events: z.array(RunEvent) }),
},
// main → renderer: code-mode's live event feed (replaces runs:events). Carries
// the session's RunEvents (code-run-event, message, processing, …).
'codeSession:events': {
req: RunEvent,
res: z.null(),
},
// ==========================================================================
// Embedded terminal (Code section): one PTY per coding session
// ==========================================================================