diff --git a/CLAUDE.md b/CLAUDE.md index b1f8a294ed..e1ac653338 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,7 @@ Paseo is a mobile app for monitoring and controlling your local AI coding agents from anywhere. Your dev environment, in your pocket. Connects directly to your actual development environment — your code stays on your machine. -**Supported agents:** Claude Code, Codex, GitHub Copilot, OpenCode, and Pi. +**Supported agents:** Claude Code, Codex, GitHub Copilot, OpenCode, Pi, Antigravity, and Muse Code. ## Repository map diff --git a/README.md b/README.md index 120672746b..aa0a841e7e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@

-

One interface for Claude Code, Codex, Copilot, OpenCode, and Pi agents.

+

One interface for Claude Code, Codex, Copilot, OpenCode, Pi, Antigravity, and Muse Code agents.

Paseo app screenshot @@ -42,7 +42,7 @@ Run agents in parallel on your own machines. Ship from your phone or your desk. - **Self-hosted:** Agents run on your machine with your full dev environment. Use your tools, your configs, and your skills. -- **Multi-provider:** Claude Code, Codex, Copilot, OpenCode, and Pi through the same interface. Pick the right model for each job. +- **Multi-provider:** Claude Code, Codex, Copilot, OpenCode, Pi, Antigravity, and Muse Code through the same interface. Pick the right model for each job. - **Voice control:** Dictate tasks or talk through problems in voice mode. Hands-free when you need it. - **Cross-device:** iOS, Android, desktop, web, and CLI. Start work at your desk, check in from your phone, script it from the terminal. - **Privacy-first:** Paseo doesn't have any telemetry, tracking, or forced log-ins. @@ -68,6 +68,8 @@ You need at least one agent CLI installed and configured with your credentials: - [GitHub Copilot](https://github.com/features/copilot/cli/) - [OpenCode](https://github.com/anomalyco/opencode) - [Pi](https://pi.dev) +- [Antigravity](https://paseo.sh/docs/supported-providers#antigravity) +- [Muse Code](https://paseo.sh/docs/muse-code) ### Desktop app (recommended) diff --git a/docs/plugins.md b/docs/plugins.md index f3c0572689..a354a20374 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -88,12 +88,23 @@ never deletes it. The global `pluginsEnabled` switch remains available. ## Built-in plugins -Built-in plugins live in `plugins//` and ship with the daemon. Add a directory and one ID to -`builtinPlugins` in `packages/server/src/server/plugins/builtin/index.ts`. The workspace, build -copy, and CI checks cover every listed directory; unlisted directories do not load. Built-ins run -in process, ignore `pluginsEnabled`, and do not appear in `config.json` or the installed plugin -list. Their client bundles appear in the plugin catalog. Editing one in development requires a -daemon restart. Directory, Git, and npm installs cannot use a built-in ID. +Built-in plugins ship from `plugins//`, with `paseo-plugin.json`, `index.server.ts`, +`server/`, and optional client entry and icon. Add the plugin ID to `builtinPlugins` in +`packages/server/src/server/plugins/builtin/index.ts`; the workspace, build copy, and CI +checks cover that registry. Unlisted directories do not load. + +Built-ins run in process and remain active independently of `pluginsEnabled`. They are +absent from the installed plugin list and source configuration; their client bundles +appear in the plugin catalog. Editing one in development requires a daemon restart. +Directory, Git, and npm installs cannot use a built-in ID. + +Provider plugins use separate installation and provider IDs. `muse-provider` registers the +selectable `muse` provider (Muse Code) and a usage source. Its `status({ launch })` reports +availability and a diagnostic after the daemon resolves the executable. Configure command, +environment, or enablement overrides under `agents.providers.muse`. Omit `extends` to keep +the bundled integration; an entry with `extends` shadows it with a custom provider. See +[provider contributions](#contribute-a-provider) for the contract and +[Muse Code](../public-docs/muse-code.md) for setup, settings, and version limitations. ## Install a Git source diff --git a/docs/providers.md b/docs/providers.md index d44a886674..917c2512d1 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -6,7 +6,7 @@ server integrations. ## Plugin providers Keep a bundled provider in `plugins//` and register it through -`@getpaseo/plugin/server/provider`. Antigravity follows this pattern. Built-in loading and SDK +`@getpaseo/plugin/server/provider`. Antigravity and Muse Code follow this pattern. Built-in loading and SDK import rules belong to [plugins.md](plugins.md#built-in-plugins); the [public provider guide](../public-docs/plugins/providers.md) covers the provider contract. @@ -15,8 +15,10 @@ executable resolution and applies `agents.providers..command` and ` connecting. Register the provider's icon with the plugin rather than adding it to the app's provider icon map. You do not need a core manifest entry or provider factory. -For Antigravity installation, modes, and limitations, see -[Supported providers](../public-docs/supported-providers.md#antigravity). +| Provider | Transport | Setup and limitations | +| ----------- | ------------------------------------------ | ---------------------------------------------------------------- | +| Antigravity | Installed `agy` CLI | [Antigravity](../public-docs/supported-providers.md#antigravity) | +| Muse Code | MSP over one `muse serve` host per session | [Muse Code](../public-docs/muse-code.md) | ## Provider-native session options @@ -85,7 +87,7 @@ model; it does not override the model list returned by a resolver. Implement the `AgentClient` and `AgentSession` interfaces from `agent-sdk-types.ts` yourself. This gives full control but requires you to handle process management, streaming, permissions, and session persistence from scratch. -Existing direct providers: `claude` (in `providers/claude/agent.ts`), `codex` (`codex-app-server-agent.ts`), `opencode` (`opencode/runtime-client.ts`), `pi` (`providers/pi/agent.ts`), and `omp` (`providers/omp/agent.ts`). The dev-only `mock` provider (`mock-load-test-agent.ts`) is also direct. +Core direct providers: `claude` (in `providers/claude/agent.ts`), `codex` (`codex-app-server-agent.ts`), `opencode` (`opencode/runtime-client.ts`), `pi` (`providers/pi/agent.ts`), and `omp` (`providers/omp/agent.ts`). The dev-only `mock` provider (`mock-load-test-agent.ts`) is also direct. Claude first-party model metadata lives in `packages/server/src/server/agent/providers/claude/model-manifest.ts`. When adding or updating a Claude model, update that manifest only; the model picker thinking options and Claude-specific feature gates are derived from the manifest. Do not add model-specific Claude capability lists in feature code. diff --git a/packages/cli/tests/25-daemon-restart-supervisor.test.ts b/packages/cli/tests/25-daemon-restart-supervisor.test.ts index f38caa5601..d3ae10e19c 100644 --- a/packages/cli/tests/25-daemon-restart-supervisor.test.ts +++ b/packages/cli/tests/25-daemon-restart-supervisor.test.ts @@ -21,6 +21,7 @@ import { runLocalPaseo } from "./helpers/local-cli.ts"; import { getAvailablePort } from "./helpers/network.ts"; const pollIntervalMs = 100; +const daemonReadyTimeoutMs = 120_000; const testEnv = { PASEO_LOCAL_SPEECH_AUTO_DOWNLOAD: process.env.PASEO_LOCAL_SPEECH_AUTO_DOWNLOAD ?? "0", PASEO_DICTATION_ENABLED: process.env.PASEO_DICTATION_ENABLED ?? "0", @@ -135,7 +136,7 @@ import('node:fs').then(({appendFileSync}) => { supervisor = await readDaemonInstance(paseoHome); return supervisor?.pid === supervisorProcess?.pid && Boolean(supervisor?.listen); }, - 120000, + daemonReadyTimeoutMs, "daemon did not publish its bound endpoint in time", ); assert(supervisor?.listen, "owned supervisor should publish its bound endpoint"); @@ -176,7 +177,8 @@ import('node:fs').then(({appendFileSync}) => { "restart request should be acknowledged", ); - const deadline = Date.now() + 20000; + // A restart includes worker startup and client reconnection, as initial readiness does. + const deadline = Date.now() + daemonReadyTimeoutMs; let statusAfterRestart = statusBeforeRestart; await waitFor( async () => { @@ -193,7 +195,7 @@ import('node:fs').then(({appendFileSync}) => { throw error; } }, - 20000, + daemonReadyTimeoutMs, "worker pid did not change after restart request", ); assert.notStrictEqual( diff --git a/packages/server/src/server/daemon-e2e/muse.real.e2e.test.ts b/packages/server/src/server/daemon-e2e/muse.real.e2e.test.ts new file mode 100644 index 0000000000..d9d473511a --- /dev/null +++ b/packages/server/src/server/daemon-e2e/muse.real.e2e.test.ts @@ -0,0 +1,95 @@ +import { execFileSync } from "node:child_process"; +import { mkdtemp, rm, writeFile } from "node:fs/promises"; +import os from "node:os"; +import path from "node:path"; +import { expect, test } from "vitest"; +import { isCommandAvailable } from "../../executable-resolution/executable-resolution.js"; +import { loadPersistedConfig } from "../persisted-config.js"; +import { resolvePaseoHome } from "../paseo-home.js"; +import { BuiltinPluginLoader } from "../plugins/builtin/index.js"; +import { createTestPaseoDaemon } from "../test-utils/paseo-daemon.js"; +import { DaemonClient } from "../test-utils/daemon-client.js"; + +test("Muse publishes its client settings bundle while installed plugins are disabled", async () => { + const daemon = await createTestPaseoDaemon({ + builtinPlugins: new BuiltinPluginLoader(undefined, ["muse-provider"]), + }); + const client = new DaemonClient({ + url: `ws://127.0.0.1:${daemon.port}/ws`, + appVersion: "0.10.0", + }); + try { + await client.connect(); + const muse = (await client.getPluginCatalog()).find((plugin) => plugin.id === "muse-provider"); + expect(muse?.clientBundle).toBeTypeOf("string"); + expect(muse?.clientBundle).not.toBe(""); + } finally { + await client.close(); + await daemon.close(); + } +}); + +test("Muse creates an agent, streams a text reply, and executes a real tool", async (context) => { + if (!(await isCommandAvailable("muse"))) { + context.skip(); + return; + } + const cwd = await mkdtemp(path.join(os.tmpdir(), "paseo-muse-e2e-")); + await writeFile(path.join(cwd, "f"), "MUSE_TOOL_E2E_OK\n"); + execFileSync("git", ["init", cwd], { stdio: "ignore" }); + const configured = loadPersistedConfig(resolvePaseoHome()).agents?.providers?.muse; + const daemon = await createTestPaseoDaemon({ + builtinPlugins: new BuiltinPluginLoader(undefined, ["muse-provider"]), + providerOverrides: { muse: { ...configured, enabled: true } }, + }); + const client = new DaemonClient({ + url: `ws://127.0.0.1:${daemon.port}/ws`, + appVersion: "0.10.0", + }); + try { + await client.connect(); + await client.fetchAgents({ subscribe: {} }); + const agent = await client.createAgent({ provider: "muse", cwd, modeId: "allowAll" }); + await client.sendMessage(agent.id, "Reply exactly MUSE_TEXT_E2E_OK. Do not use tools."); + expect((await client.waitForFinish(agent.id, 120000)).status).toBe("idle"); + const reply = await client.fetchAgentTimeline(agent.id, { + direction: "tail", + limit: 0, + projection: "canonical", + }); + expect( + reply.entries.some( + (entry) => + entry.item.type === "assistant_message" && entry.item.text.includes("MUSE_TEXT_E2E_OK"), + ), + ).toBe(true); + await client.sendMessage( + agent.id, + "Read the file f with the read_file tool and report its contents.", + ); + expect((await client.waitForFinish(agent.id, 120000)).status).toBe("idle"); + const tools = await client.fetchAgentTimeline(agent.id, { + direction: "tail", + limit: 0, + projection: "canonical", + }); + expect( + tools.entries.some( + (entry) => + entry.item.type === "tool_call" && + entry.item.name === "read_file" && + entry.item.status === "completed", + ), + ).toBe(true); + expect( + tools.entries.some( + (entry) => + entry.item.type === "assistant_message" && entry.item.text.includes("MUSE_TOOL_E2E_OK"), + ), + ).toBe(true); + } finally { + await client.close(); + await daemon.close(); + await rm(cwd, { recursive: true, force: true }); + } +}, 300000); diff --git a/packages/server/src/server/plugins/builtin/index.ts b/packages/server/src/server/plugins/builtin/index.ts index 52f9c9df3c..eb6aab147e 100644 --- a/packages/server/src/server/plugins/builtin/index.ts +++ b/packages/server/src/server/plugins/builtin/index.ts @@ -11,6 +11,7 @@ export const builtinPlugins = [ "grok-usage-source", "kimi-usage-source", "minimax-usage-source", + "muse-provider", "opencode-go-usage-source", "zai-usage-source", ] as const; diff --git a/packages/website/src/components/agent-icons.tsx b/packages/website/src/components/agent-icons.tsx index 7b6b66146d..8488050b12 100644 --- a/packages/website/src/components/agent-icons.tsx +++ b/packages/website/src/components/agent-icons.tsx @@ -82,3 +82,37 @@ export function PiIcon(props: React.SVGProps) { ); } + +export function MuseCodeIcon(props: React.SVGProps) { + return ( + + ); +} + +export function AntigravityIcon(props: React.SVGProps) { + return ( + + ); +} diff --git a/packages/website/src/components/landing-page.tsx b/packages/website/src/components/landing-page.tsx index d2d6684c93..6a29c62235 100644 --- a/packages/website/src/components/landing-page.tsx +++ b/packages/website/src/components/landing-page.tsx @@ -78,6 +78,8 @@ import { CursorIcon, OpenCodeIcon, PiIcon, + MuseCodeIcon, + AntigravityIcon, } from "~/components/agent-icons"; import { DiscordIcon, GitHubIcon, SlackIcon } from "~/components/brand-icons"; import { ClaudeIcon, MobileChat, MobileDiff, MobileSidebar, PhoneFrame } from "~/components/mockup"; @@ -161,6 +163,8 @@ function Hero({ title, subtitle }: { title: React.ReactNode; subtitle: React.Rea const CLAUDE_CODE_BADGE_ICON = ; const CODEX_BADGE_ICON = ; +const ANTIGRAVITY_BADGE_ICON = ; +const MUSE_CODE_BADGE_ICON = ; const OPENCODE_BADGE_ICON = ; const PI_BADGE_ICON = ; const CURSOR_BADGE_ICON = ; @@ -432,6 +436,8 @@ function MultiProviderSection() { { name: "Claude Code", icon: }, { name: "Codex", icon: }, { name: "OpenCode", icon: }, + { name: "Antigravity", icon: }, + { name: "Muse Code", icon: }, { name: "Pi", icon: }, { name: "Cursor", icon: }, ]; @@ -900,7 +906,8 @@ const PRINCIPLES: ReadonlyArray<{ icon: LucideIcon; title: string; description: { icon: Merge, title: "Unified", - description: "Claude Code, Codex, OpenCode, Pi, and more, all used the same way.", + description: + "Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, and more, all used the same way.", }, { icon: Blocks, @@ -962,6 +969,8 @@ function GetStarted() { + + @@ -1207,10 +1216,15 @@ function FAQ() { Paseo supports many providers. It has custom implementations for Claude, Codex, OpenCode, - Pi, and OMP, and supports many more via ACP. See the full list here:{" "} + Pi, OMP, Antigravity, and Muse Code, and supports many more via ACP. See the full list + here:{" "} all supported providers + . See{" "} + + Muse Code setup and limitations + . diff --git a/packages/website/src/components/site-footer.tsx b/packages/website/src/components/site-footer.tsx index f73192c98a..ba092410da 100644 --- a/packages/website/src/components/site-footer.tsx +++ b/packages/website/src/components/site-footer.tsx @@ -86,6 +86,18 @@ export function SiteFooter({ width = "default" }: SiteFooterProps) { > OpenCode + + Antigravity + + + Muse Code + rootRouteImport, } as any); +const MuseCodeRoute = MuseCodeRouteImport.update({ + id: "/muse-code", + path: "/muse-code", + getParentRoute: () => rootRouteImport, +} as any); const MistralVibeRoute = MistralVibeRouteImport.update({ id: "/mistral-vibe", path: "/mistral-vibe", @@ -296,6 +303,11 @@ const AuggieRoute = AuggieRouteImport.update({ path: "/auggie", getParentRoute: () => rootRouteImport, } as any); +const AntigravityRoute = AntigravityRouteImport.update({ + id: "/antigravity", + path: "/antigravity", + getParentRoute: () => rootRouteImport, +} as any); const AmpRoute = AmpRouteImport.update({ id: "/amp", path: "/amp", @@ -384,6 +396,7 @@ export interface FileRoutesByFullPath { "/agents": typeof AgentsRoute; "/agoragentic": typeof AgoragenticRoute; "/amp": typeof AmpRoute; + "/antigravity": typeof AntigravityRoute; "/auggie": typeof AuggieRoute; "/autohand": typeof AutohandRoute; "/blog": typeof BlogRouteWithChildren; @@ -416,6 +429,7 @@ export interface FileRoutesByFullPath { "/kimi": typeof KimiRoute; "/minion-code": typeof MinionCodeRoute; "/mistral-vibe": typeof MistralVibeRoute; + "/muse-code": typeof MuseCodeRoute; "/nova": typeof NovaRoute; "/omp": typeof OmpRoute; "/opencode": typeof OpencodeRoute; @@ -447,6 +461,7 @@ export interface FileRoutesByTo { "/agents": typeof AgentsRoute; "/agoragentic": typeof AgoragenticRoute; "/amp": typeof AmpRoute; + "/antigravity": typeof AntigravityRoute; "/auggie": typeof AuggieRoute; "/autohand": typeof AutohandRoute; "/changelog": typeof ChangelogRoute; @@ -477,6 +492,7 @@ export interface FileRoutesByTo { "/kimi": typeof KimiRoute; "/minion-code": typeof MinionCodeRoute; "/mistral-vibe": typeof MistralVibeRoute; + "/muse-code": typeof MuseCodeRoute; "/nova": typeof NovaRoute; "/omp": typeof OmpRoute; "/opencode": typeof OpencodeRoute; @@ -509,6 +525,7 @@ export interface FileRoutesById { "/agents": typeof AgentsRoute; "/agoragentic": typeof AgoragenticRoute; "/amp": typeof AmpRoute; + "/antigravity": typeof AntigravityRoute; "/auggie": typeof AuggieRoute; "/autohand": typeof AutohandRoute; "/blog": typeof BlogRouteWithChildren; @@ -541,6 +558,7 @@ export interface FileRoutesById { "/kimi": typeof KimiRoute; "/minion-code": typeof MinionCodeRoute; "/mistral-vibe": typeof MistralVibeRoute; + "/muse-code": typeof MuseCodeRoute; "/nova": typeof NovaRoute; "/omp": typeof OmpRoute; "/opencode": typeof OpencodeRoute; @@ -574,6 +592,7 @@ export interface FileRouteTypes { | "/agents" | "/agoragentic" | "/amp" + | "/antigravity" | "/auggie" | "/autohand" | "/blog" @@ -606,6 +625,7 @@ export interface FileRouteTypes { | "/kimi" | "/minion-code" | "/mistral-vibe" + | "/muse-code" | "/nova" | "/omp" | "/opencode" @@ -637,6 +657,7 @@ export interface FileRouteTypes { | "/agents" | "/agoragentic" | "/amp" + | "/antigravity" | "/auggie" | "/autohand" | "/changelog" @@ -667,6 +688,7 @@ export interface FileRouteTypes { | "/kimi" | "/minion-code" | "/mistral-vibe" + | "/muse-code" | "/nova" | "/omp" | "/opencode" @@ -698,6 +720,7 @@ export interface FileRouteTypes { | "/agents" | "/agoragentic" | "/amp" + | "/antigravity" | "/auggie" | "/autohand" | "/blog" @@ -730,6 +753,7 @@ export interface FileRouteTypes { | "/kimi" | "/minion-code" | "/mistral-vibe" + | "/muse-code" | "/nova" | "/omp" | "/opencode" @@ -762,6 +786,7 @@ export interface RootRouteChildren { AgentsRoute: typeof AgentsRoute; AgoragenticRoute: typeof AgoragenticRoute; AmpRoute: typeof AmpRoute; + AntigravityRoute: typeof AntigravityRoute; AuggieRoute: typeof AuggieRoute; AutohandRoute: typeof AutohandRoute; BlogRoute: typeof BlogRouteWithChildren; @@ -794,6 +819,7 @@ export interface RootRouteChildren { KimiRoute: typeof KimiRoute; MinionCodeRoute: typeof MinionCodeRoute; MistralVibeRoute: typeof MistralVibeRoute; + MuseCodeRoute: typeof MuseCodeRoute; NovaRoute: typeof NovaRoute; OmpRoute: typeof OmpRoute; OpencodeRoute: typeof OpencodeRoute; @@ -910,6 +936,13 @@ declare module "@tanstack/react-router" { preLoaderRoute: typeof NovaRouteImport; parentRoute: typeof rootRouteImport; }; + "/muse-code": { + id: "/muse-code"; + path: "/muse-code"; + fullPath: "/muse-code"; + preLoaderRoute: typeof MuseCodeRouteImport; + parentRoute: typeof rootRouteImport; + }; "/mistral-vibe": { id: "/mistral-vibe"; path: "/mistral-vibe"; @@ -1134,6 +1167,13 @@ declare module "@tanstack/react-router" { preLoaderRoute: typeof AuggieRouteImport; parentRoute: typeof rootRouteImport; }; + "/antigravity": { + id: "/antigravity"; + path: "/antigravity"; + fullPath: "/antigravity"; + preLoaderRoute: typeof AntigravityRouteImport; + parentRoute: typeof rootRouteImport; + }; "/amp": { id: "/amp"; path: "/amp"; @@ -1278,6 +1318,7 @@ const rootRouteChildren: RootRouteChildren = { AgentsRoute: AgentsRoute, AgoragenticRoute: AgoragenticRoute, AmpRoute: AmpRoute, + AntigravityRoute: AntigravityRoute, AuggieRoute: AuggieRoute, AutohandRoute: AutohandRoute, BlogRoute: BlogRouteWithChildren, @@ -1310,6 +1351,7 @@ const rootRouteChildren: RootRouteChildren = { KimiRoute: KimiRoute, MinionCodeRoute: MinionCodeRoute, MistralVibeRoute: MistralVibeRoute, + MuseCodeRoute: MuseCodeRoute, NovaRoute: NovaRoute, OmpRoute: OmpRoute, OpencodeRoute: OpencodeRoute, diff --git a/packages/website/src/routes/agents.tsx b/packages/website/src/routes/agents.tsx index 884752b622..03548fe3bf 100644 --- a/packages/website/src/routes/agents.tsx +++ b/packages/website/src/routes/agents.tsx @@ -10,7 +10,7 @@ export const Route = createFileRoute("/agents")({ head: () => pageMeta( "Supported agents – Every coding agent Paseo runs", - "Run Claude Code, Codex, Copilot, OpenCode, Cursor CLI, Gemini CLI, and dozens more coding agents from your phone. Self-hosted, your code stays on your machine.", + "Run Claude Code, Codex, Copilot, OpenCode, Antigravity, Muse Code, Cursor CLI, Gemini CLI, and dozens more coding agents from your phone. Self-hosted, your code stays on your machine.", "/agents", ), component: AgentsPage, diff --git a/packages/website/src/routes/antigravity.tsx b/packages/website/src/routes/antigravity.tsx new file mode 100644 index 0000000000..3d821de7b9 --- /dev/null +++ b/packages/website/src/routes/antigravity.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from "@tanstack/react-router"; +import { agentRouteOptions } from "~/components/agent-route"; + +export const Route = createFileRoute("/antigravity")(agentRouteOptions("antigravity")); diff --git a/packages/website/src/routes/muse-code.tsx b/packages/website/src/routes/muse-code.tsx new file mode 100644 index 0000000000..1a936492a9 --- /dev/null +++ b/packages/website/src/routes/muse-code.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from "@tanstack/react-router"; +import { agentRouteOptions } from "~/components/agent-route"; + +export const Route = createFileRoute("/muse-code")(agentRouteOptions("muse-code")); diff --git a/plugins/muse-provider/client/settings.tsx b/plugins/muse-provider/client/settings.tsx new file mode 100644 index 0000000000..b057cf2cb0 --- /dev/null +++ b/plugins/muse-provider/client/settings.tsx @@ -0,0 +1,103 @@ +import { useCallback, useMemo } from "react"; +import { Text } from "react-native"; +import { useSettings, type PluginScreenProps, type SettingsState } from "@getpaseo/plugin/client"; +import { + SettingsAction, + SettingsCard, + SettingsSection, + SettingsSelect, + SettingsSwitch, +} from "@getpaseo/plugin/client/ui"; +import { museSettings } from "../shared/settings.js"; + +const networks = [ + { label: "Proxy only", value: "proxy-only" }, + { label: "Restricted", value: "restricted" }, + { label: "Enabled", value: "enabled" }, +] as const; +type ReadySettings = Extract, { status: "ready" }>; + +function Controls({ + settings, + theme, +}: { + settings: ReadySettings; + theme: PluginScreenProps["theme"]; +}) { + const style = useMemo(() => ({ color: theme.colors.foreground }), [theme]); + const changeSandbox = useCallback( + (sandbox: boolean) => { + void settings.save({ ...settings.values, sandbox }, settings.revision); + }, + [settings], + ); + const changeNetwork = useCallback( + (network: ReadySettings["values"]["network"]) => { + void settings.save({ ...settings.values, network }, settings.revision); + }, + [settings], + ); + const changeTrust = useCallback( + (trustWorkspace: boolean) => { + void settings.save({ ...settings.values, trustWorkspace }, settings.revision); + }, + [settings], + ); + return ( + + + + + + + + Changes apply to new Muse sessions. Disabling the sandbox enables full network access. Trust + workspace lets Muse load project skills and configuration. + + {settings.saveError ? ( + + {settings.saveError} + + ) : null} + + ); +} + +export function MuseSettings({ theme }: PluginScreenProps) { + const settings = useSettings(museSettings); + const style = useMemo(() => ({ color: theme.colors.foreground }), [theme]); + if (settings.status === "loading") return Loading settings…; + if (settings.status !== "ready") + return ( + + + {settings.error} + + + {settings.status === "invalid" ? ( + + ) : null} + + ); + return ; +} diff --git a/plugins/muse-provider/icon.svg b/plugins/muse-provider/icon.svg new file mode 100644 index 0000000000..4d0eb0cf45 --- /dev/null +++ b/plugins/muse-provider/icon.svg @@ -0,0 +1 @@ + diff --git a/plugins/muse-provider/index.client.tsx b/plugins/muse-provider/index.client.tsx new file mode 100644 index 0000000000..98db6de7a4 --- /dev/null +++ b/plugins/muse-provider/index.client.tsx @@ -0,0 +1,20 @@ +import type { PluginClientContext } from "@getpaseo/plugin/client"; +import { MuseSettings } from "./client/settings.js"; + +export default function contribute(client: PluginClientContext) { + client.addScreen({ + id: "muse", + title: "Muse Code", + Component: MuseSettings, + }); + client.addCommandCenterItem({ + id: "settings", + title: "Configure Muse Code", + icon: "Settings", + context: "global", + onSelect({ openScreen }) { + openScreen({ screenId: "muse" }); + }, + }); + return () => {}; +} diff --git a/plugins/muse-provider/index.server.ts b/plugins/muse-provider/index.server.ts new file mode 100644 index 0000000000..b5e988c23a --- /dev/null +++ b/plugins/muse-provider/index.server.ts @@ -0,0 +1,18 @@ +import type { PluginServerContext } from "@getpaseo/plugin/server"; +import { createMuseProvider } from "./server/provider.js"; + +import { museSettings } from "./shared/settings.js"; +import { Usage } from "./server/usage.js"; + +export default function contribute( + server: Pick< + PluginServerContext, + "registerProvider" | "registerSettings" | "registerUsageSource" + >, +) { + const settings = server.registerSettings(museSettings); + const usage = new Usage(); + server.registerUsageSource(usage.registration()); + server.registerProvider(createMuseProvider(settings, usage)); + return () => {}; +} diff --git a/plugins/muse-provider/paseo-plugin.json b/plugins/muse-provider/paseo-plugin.json new file mode 100644 index 0000000000..a53be3fef5 --- /dev/null +++ b/plugins/muse-provider/paseo-plugin.json @@ -0,0 +1 @@ +{ "id": "muse-provider", "requirements": { "paseo": ">=0.10.0" } } diff --git a/plugins/muse-provider/server/catalog.ts b/plugins/muse-provider/server/catalog.ts new file mode 100644 index 0000000000..d4e483ed79 --- /dev/null +++ b/plugins/muse-provider/server/catalog.ts @@ -0,0 +1,91 @@ +import type { ProviderCatalog, ProviderLaunch } from "@getpaseo/plugin/server/provider"; +import type { z } from "zod"; +import { createHash } from "node:crypto"; +import { MspConnection } from "./connection.js"; +import { catalogSchema, effortSchema } from "./wire.js"; + +export const modes = [ + { id: "onRequest", label: "Default", icon: "ShieldCheck", colorTier: "safe" }, + { id: "promptUnmatched", label: "Ask", icon: "ShieldAlert", colorTier: "moderate" }, + { id: "denyUnmatched", label: "Strict", icon: "ShieldCheck", colorTier: "safe" }, + { + id: "allowAll", + label: "Full access", + icon: "ShieldOff", + colorTier: "dangerous", + isUnattended: true, + }, +]; +export const efforts = effortSchema.options.filter((effort) => effort !== "none"); + +export function launchKey(launch: ProviderLaunch): string { + // Hash values so credential-dependent cache identity never exposes credentials. + const routingKeys = Object.keys(launch.env) + .filter((key) => /^(META_|MUSE_|XDG_|HOME$|PATH$|HTTP_PROXY$|HTTPS_PROXY$|NO_PROXY$)/.test(key)) + .sort(); + const environment = routingKeys.map((key) => [key, launch.env[key]]); + return createHash("sha256") + .update(JSON.stringify([launch.command, launch.args, environment])) + .digest("hex"); +} + +export class Catalog { + private readonly cache = new Map(); + private readonly hosts = new Set(); + private closed = false; + async read(launch: ProviderLaunch): Promise { + if (this.closed) throw new Error("Muse catalogue is closed"); + const key = launchKey(launch); + const cached = this.cache.get(key); + if (cached && cached.expires > Date.now()) return cached.catalog; + const host = new MspConnection({ launch, timeoutMs: 5000 }); + this.hosts.add(host); + try { + await host.initialize(); + const response = await host.request("model/list", {}, catalogSchema); + const catalog = presentCatalog(response); + if (!this.closed) { + if (this.cache.size >= 8) this.cache.delete(this.cache.keys().next().value!); + this.cache.set(key, { expires: Date.now() + 60000, catalog }); + } + return catalog; + } finally { + await host.close(); + this.hosts.delete(host); + } + } + async close(): Promise { + this.closed = true; + this.cache.clear(); + await Promise.all([...this.hosts].map((host) => host.close())); + } +} + +export function presentCatalog(response: z.infer): ProviderCatalog { + const models = response.models.map((model) => { + let supported: z.infer[] = efforts; + if (Array.isArray(model.reasoningEffortVariants) && model.reasoningEffortVariants.length > 0) + supported = model.reasoningEffortVariants; + else if (model.variants.length > 0) supported = model.variants; + return { + id: model.modelId, + label: model.displayLabel, + isDefault: model.isDefault, + contextWindowMaxTokens: model.contextLimit ?? undefined, + thinkingOptions: supported.map((id) => ({ + id, + label: id, + isDefault: id === model.defaultReasoningEffort, + })), + defaultThinkingOptionId: model.defaultReasoningEffort ?? undefined, + metadata: { providerId: model.providerId }, + }; + }); + const defaultModel = models.find((model) => model.isDefault); + return { + models, + modes, + defaultMode: "onRequest", + defaultModel: defaultModel?.id, + }; +} diff --git a/plugins/muse-provider/server/children.ts b/plugins/muse-provider/server/children.ts new file mode 100644 index 0000000000..69e0f4a855 --- /dev/null +++ b/plugins/muse-provider/server/children.ts @@ -0,0 +1,94 @@ +import type { ProviderEvent } from "@getpaseo/plugin/server/provider"; +import { MspConnection, type Notification } from "./connection.js"; +import { Timeline } from "./timeline.js"; +import { + childSessionSchema, + pageSchema, + itemNotificationSchema, + notificationSchema, + deltaSchema, + type WireItem, +} from "./wire.js"; + +interface Child { + timeline: Timeline; + cursor: string | undefined; +} +export class Children { + private readonly children = new Map(); + constructor( + private readonly host: MspConnection, + private readonly parentId: string, + private readonly cwd: string, + private readonly emit: (event: ProviderEvent) => void, + ) {} + + async update(item: WireItem): Promise { + if ( + !item.childSessionId || + !( + item.kind === "subagent" || + item.kind === "workflow" || + item.tool === "workflow" || + item.tool.startsWith("subagent_") + ) + ) + return; + const id = item.childSessionId; + if (!this.children.has(id)) { + const { session } = await this.host.request( + "session/read", + { sessionId: id }, + childSessionSchema, + ); + this.emit({ + type: "session.opened", + sessionId: id, + parentSessionId: this.parentId, + toolCallId: item.callId ?? item.itemId, + capabilities: [], + restoration: "parent", + cwd: session.workspaceRoot ?? this.cwd, + title: session.title, + }); + this.children.set(id, { + timeline: new Timeline(this.host, id, id, this.emit), + cursor: undefined, + }); + } + await this.page(id); + } + async notify(id: string, event: Notification): Promise { + const child = this.children.get(id); + if (!child) return; + if (["item/started", "item/updated", "item/completed"].includes(event.method)) { + const { item } = itemNotificationSchema.parse(event.params); + await child.timeline.fold(item); + } else if (event.method === "item/delta") child.timeline.delta(deltaSchema.parse(event.params)); + } + async refresh(): Promise { + for (const id of this.children.keys()) await this.page(id); + } + private async page(id: string): Promise { + const child = this.children.get(id)!; + let next: string | null; + do { + const page = await this.host.request( + "view/page", + { sessionId: id, cursor: child.cursor, limit: 1000, direction: "forward" }, + pageSchema, + ); + for (const event of page.events) { + await this.notify(id, event); + const envelope = notificationSchema.parse(event.params); + if (envelope.viewCursor) child.cursor = envelope.viewCursor; + } + next = page.nextCursor; + if (next !== null) child.cursor = next; + } while (next !== null); + } + close(): void { + for (const sessionId of this.children.keys()) this.emit({ type: "session.closed", sessionId }); + this.children.clear(); + } +} diff --git a/plugins/muse-provider/server/commands.ts b/plugins/muse-provider/server/commands.ts new file mode 100644 index 0000000000..df62f72537 --- /dev/null +++ b/plugins/muse-provider/server/commands.ts @@ -0,0 +1,56 @@ +import type { ProviderEvent, ProviderPrompt } from "@getpaseo/plugin/server/provider"; +import type { TurnStartParams } from "./msp.js"; +import { MspConnection } from "./connection.js"; +import { ackSchema, skillsSchema } from "./wire.js"; +import { MuseError } from "./errors.js"; + +export class Commands { + private selectors = new Set(); + constructor( + private readonly host: MspConnection, + private readonly sessionId: string, + private readonly id: string, + private readonly emit: (event: ProviderEvent) => void, + ) {} + + async refresh(): Promise { + const { skills } = await this.host.request( + "skill/list", + { sessionId: this.sessionId }, + skillsSchema, + ); + this.selectors = new Set(skills.map((skill) => skill.selector)); + this.emit({ + type: "session.commands", + sessionId: this.id, + commands: [ + { name: "compact", description: "Compact conversation context" }, + ...skills + .filter((skill) => skill.selector !== "compact") + .map((skill) => ({ + name: skill.selector, + description: skill.description, + argumentHint: skill.argumentHint, + })), + ], + }); + } + async compact(prompt: ProviderPrompt): Promise { + if (prompt.input.type !== "command" || prompt.input.name !== "compact") return false; + await this.host.command("session/compact", { sessionId: this.sessionId }, ackSchema); + this.emit({ + type: "session.prompt_result", + sessionId: this.id, + clientMessageId: prompt.clientMessageId, + result: { type: "completed" }, + }); + return true; + } + input( + command: Extract, + ): TurnStartParams["input"][number] { + if (!this.selectors.has(command.name)) + throw new MuseError("unknownCommand", `Muse skill is unavailable: ${command.name}`); + return { type: "skill", selector: command.name, arguments: command.arguments }; + } +} diff --git a/plugins/muse-provider/server/connection.ts b/plugins/muse-provider/server/connection.ts new file mode 100644 index 0000000000..100bd101c7 --- /dev/null +++ b/plugins/muse-provider/server/connection.ts @@ -0,0 +1,193 @@ +import type { ProviderLaunch } from "@getpaseo/plugin/server/provider"; +import { spawn } from "node:child_process"; +import { randomBytes } from "node:crypto"; +import { createInterface } from "node:readline"; +import { setTimeout as delay } from "node:timers/promises"; +import { z } from "zod"; +import { MuseError, classifyExit } from "./errors.js"; +import { frameSchema, initializedSchema, fingerprint } from "./wire.js"; + +export function commandId(): string { + const bytes = randomBytes(16); + bytes.writeUIntBE(Date.now(), 0, 6); + bytes[6] = 0x70 | (bytes[6]! & 0x0f); + bytes[8] = 0x80 | (bytes[8]! & 0x3f); + const hex = bytes.toString("hex"); + return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`; +} + +interface PendingRequest { + resolve(value: unknown): void; + reject(error: Error): void; + timer: ReturnType; +} +export interface Notification { + method: string; + params: unknown; +} + +export class MspConnection { + private readonly child; + private readonly pending = new Map(); + private readonly listeners = new Set<(notification: Notification) => void>(); + private readonly exitListeners = new Set<(error: MuseError) => void>(); + private sequence = 0; + private stderr = ""; + private failure: MuseError | null = null; + private closing = false; + private readonly exited: Promise; + + constructor( + private readonly options: { + launch: ProviderLaunch; + cwd?: string; + timeoutMs?: number; + serveArgs?: string[]; + }, + ) { + const { launch, cwd } = options; + this.child = spawn(launch.command, [...launch.args, "serve", ...(options.serveArgs ?? [])], { + env: launch.env, + cwd, + stdio: "pipe", + }); + this.child.stderr.setEncoding("utf8"); + this.child.stderr.on("data", (chunk: string) => { + this.stderr = (this.stderr + chunk).slice(-8192); + }); + const lines = createInterface({ input: this.child.stdout }); + lines.on("line", (line) => { + try { + this.receive(frameSchema.parse(JSON.parse(line))); + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + this.fail(new MuseError("invalidFrame", `Invalid MSP frame: ${message}`)); + this.child.kill(); + } + }); + this.child.stdin.on("error", () => { + /* Process exit owns the diagnostic and pending requests. */ + }); + this.child.on("error", (error) => this.fail(new MuseError("spawn", error.message))); + this.exited = new Promise((resolve) => { + this.child.once("close", (code, signal) => { + lines.close(); + this.fail(classifyExit(code, signal, this.stderr)); + resolve(); + }); + }); + } + + async initialize(): Promise { + const response = await this.request( + "initialize", + { + clientInfo: { name: "paseo", version: "1" }, + capabilities: { + experimentalApi: true, + requestedCapabilities: ["sessionMcp", "sessionListStream"], + }, + }, + initializedSchema, + ); + if (response.schema.fingerprint !== fingerprint) { + process.stderr.write( + `Muse MSP fingerprint mismatch: expected ${fingerprint}, received ${response.schema.fingerprint}\n`, + ); + } + this.write({ jsonrpc: "2.0", method: "initialized", params: {} }); + } + + onNotification(listener: (notification: Notification) => void): () => void { + this.listeners.add(listener); + return () => this.listeners.delete(listener); + } + onExit(listener: (error: MuseError) => void): () => void { + this.exitListeners.add(listener); + return () => this.exitListeners.delete(listener); + } + async command(method: string, params: P, schema: z.ZodType): Promise { + const id = + "commandId" in params && typeof params.commandId === "string" + ? params.commandId + : commandId(); + const input = { ...params, commandId: id }; + for (let attempt = 0; ; attempt++) { + try { + return await this.request(method, input, schema); + } catch (error) { + const retryable = + error instanceof MuseError && ["overloaded", "backpressured"].includes(error.kind); + if (!retryable || attempt === 2) throw error; + await delay(100 * (attempt + 1)); + } + } + } + async request(method: string, params: object, schema: z.ZodType): Promise { + if (this.failure) throw this.failure; + if (this.closing) throw new MuseError("closed", "Muse host is closing"); + const id = ++this.sequence; + const response = await new Promise((resolve, reject) => { + const timer = setTimeout(() => { + this.pending.delete(id); + reject(new MuseError("timeout", `Muse ${method} timed out`)); + }, this.options.timeoutMs ?? 10000); + this.pending.set(id, { resolve, reject, timer }); + this.write({ jsonrpc: "2.0", id, method, params }); + }); + return schema.parse(response); + } + async close(): Promise { + if (this.closing) return this.exited; + this.closing = true; + this.child.stdin.end(); + const drained = await Promise.race([ + this.exited.then(() => true), + delay(1000).then(() => false), + ]); + if (!drained) this.child.kill("SIGKILL"); + await this.exited; + } + private write(frame: object): void { + this.child.stdin.write(JSON.stringify(frame) + "\n"); + } + private receive(frame: z.infer): void { + if (frame.method) { + if (frame.id !== undefined) { + if (["approval/request", "userInput/request"].includes(frame.method)) { + this.write({ jsonrpc: "2.0", id: frame.id, result: {} }); + } else { + this.write({ + jsonrpc: "2.0", + id: frame.id, + error: { code: -32601, message: "Unsupported server request" }, + }); + } + return; + } + for (const listener of this.listeners) + listener({ method: frame.method, params: frame.params }); + return; + } + if (frame.id === undefined) throw new MuseError("invalidFrame", "MSP response has no id"); + const pending = this.pending.get(frame.id); + if (!pending) return; + clearTimeout(pending.timer); + this.pending.delete(frame.id); + if (frame.error) { + let kind = frame.error.data?.kind ?? "rpc"; + if (frame.error.code === -32020) kind = "sessionNotFound"; + pending.reject(new MuseError(kind, frame.error.message, undefined, frame.error.data?.reason)); + } else pending.resolve(frame.result); + } + private fail(error: MuseError): void { + if (this.failure) return; + this.failure = error; + for (const pending of this.pending.values()) { + clearTimeout(pending.timer); + pending.reject(error); + } + this.pending.clear(); + if (!this.closing) for (const listener of this.exitListeners) listener(error); + } +} diff --git a/plugins/muse-provider/server/errors.ts b/plugins/muse-provider/server/errors.ts new file mode 100644 index 0000000000..86f6254af6 --- /dev/null +++ b/plugins/muse-provider/server/errors.ts @@ -0,0 +1,81 @@ +import type { ProviderError, ProviderLaunch } from "@getpaseo/plugin/server/provider"; +import path from "node:path"; + +export class MuseError extends Error { + constructor( + readonly kind: string, + message: string, + readonly diagnostic?: string, + readonly reason?: string, + ) { + super(message); + this.name = "MuseError"; + } + toProviderError(): ProviderError { + return { code: this.kind, message: this.message, diagnostic: this.diagnostic }; + } +} + +export function classifyExit( + code: number | null, + signal: string | null, + stderr: string, +): MuseError { + const kinds: Record = { + 0: "cleanExit", + 2: "usage", + 3: "credentials", + 4: "leaseHeld", + 5: "surfaceOff", + }; + const kind = code === null ? "crash" : (kinds[code] ?? "crash"); + return new MuseError(kind, `Muse host exited (${code ?? signal}). ${stderr}`); +} + +function isUnavailableReviewer(message: string): boolean { + return message.includes("automated reviewer is unavailable"); +} + +export function actionableError(error: unknown, launch: ProviderLaunch): ProviderError { + if (!(error instanceof Error)) return { code: "muse", message: String(error) }; + // Muse 1.4.1 reports this profile failure as internal, without a specific error kind. + if ( + error instanceof MuseError && + error.kind === "internal" && + isUnavailableReviewer(error.message) + ) { + const configHome = launch.env.XDG_CONFIG_HOME ?? path.join(launch.env.HOME ?? "~", ".config"); + return { + code: "defaultProfileUnavailable", + message: `Change permissions.default_profile in ${path.join(configHome, "muse/settings.json")}: the automated reviewer is unavailable on this host.`, + }; + } + if (error instanceof MuseError && error.reason === "compaction_unavailable") { + return { + code: error.kind, + message: + "Muse cannot compact this session with its current model configuration. Ensure Muse has a context limit for the selected model (context_compaction.provider_context_limit_tokens).", + diagnostic: error.message, + }; + } + if (error instanceof MuseError && error.kind === "sessionNotFound") { + return { code: error.kind, message: "This Muse session no longer exists. Create a new agent." }; + } + if (error instanceof MuseError && error.kind === "authRequired") { + return { code: error.kind, message: "Run `muse login` or set META_API_KEY." }; + } + // Muse 1.4.1 reports this bootstrap failure as internal, without a specific error kind. + if ( + error instanceof MuseError && + error.kind === "internal" && + error.message.includes("UnsafePath") + ) { + const dataHome = launch.env.XDG_DATA_HOME ?? path.join(launch.env.HOME ?? "~", ".local/share"); + return { + code: "unsafePath", + message: `Muse data directory ${path.join(dataHome, "muse")} requires mode 0700. Set its permissions before retrying.`, + }; + } + if (error instanceof MuseError) return error.toProviderError(); + return { code: "muse", message: error.message }; +} diff --git a/plugins/muse-provider/server/msp.d.ts b/plugins/muse-provider/server/msp.d.ts new file mode 100644 index 0000000000..8f2180932d --- /dev/null +++ b/plugins/muse-provider/server/msp.d.ts @@ -0,0 +1,2690 @@ +// Vendored from Muse Code 1.4.1 via muse schema generate-ts. +// Stable fingerprint: sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f +// Muse Session Protocol (MSP) v1 TypeScript declarations. +// STABLE surface only; experimental twin: experimental/msp.d.ts. +// Generated by tbh-protocol (spec 206) from the same schema model as +// the JSON Schema bundle (INV-017). Do not edit by hand. + +export interface ApprovalAmendment { + durability: ApprovalAmendmentDurability; + rulePreview: string; +} + +export type ApprovalAmendmentDurability = "session" | "localPersistent" | (string & {}); + +export interface ApprovalChange { + choiceId?: string; + decision?: ApprovalDecision; + executable?: boolean; + kind: string; + reason?: string; + reparsed?: boolean; + requirementId?: ApprovalRequirementRef; + status?: ApprovalPersistenceStatus; +} + +export interface ApprovalChoice { + acceptsFeedback?: boolean; + choiceId: string; + decision: ApprovalDecision; + label: string; + rulePreview?: string; + scope: ApprovalChoiceScope; +} + +export type ApprovalChoiceScope = "once" | "session" | "localPersistent" | (string & {}); + +/** `approval/decide` params (tdd SS5.4): the decision. A standard SS3 command — requires the session loaded on this host, requires `commandId`, durable intake before ack, value-identical replay. */ +export interface ApprovalDecideParams { + /** The approval being decided. */ + approvalId: string; + /** One of the current `availableChoices`; else -32052. */ + choiceId: string; + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** Free-text guidance delivered to the model with the denial. Only valid on choices with `acceptsFeedback`. Never persisted in the durable audit record (live steer only), so it is absent from `approval/resolved` (tdd SS5.4). Omitted and explicit `null` both mean "no feedback" (#23468). */ + feedback?: string | null; + /** Must equal the approval's `currentRequirementId`. The multi-stage race guard: a decision aimed at stage 1 can never accidentally satisfy stage 2, and a stale value is -32053 (tdd SS5.4). */ + requirementId: ApprovalRequirementRef; + /** The target session. */ + sessionId: string; +} + +/** `approval/decide` result (tdd SS5.4). Admission-ack rules still apply: the authoritative outcome is `approval/resolved` / `approval/updated` on the view stream. */ +export interface ApprovalDecideResult { + /** The approval this decision was applied to. */ + approvalId: string; + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** `false` when the choice satisfied a stage but further requirements remain (the approval stays pending and an updated `approval/request` follows); `true` when this decision produced the terminal `DecisionApplied` (tdd SS5.4). */ + terminal: boolean; +} + +export type ApprovalDecision = + | "approved" + | "approvedForSession" + | "approvedPolicyAmendment" + | "denied" + | "deniedPolicyAmendment" + | "timedOut" + | "abort" + | (string & {}); + +/** `approval/listPending` params (tdd SS5.7): the pull dual of the re-issued requests. A log-fold read — no lease, works on loaded and unloaded sessions, never subscribes. */ +export interface ApprovalListPendingParams { + /** The session to read. */ + sessionId: string; +} + +/** `approval/listPending` result (tdd SS5.7). Ordering is by opening `viewCursor`; empty arrays when nothing is pending. The result is point-in-time — to act on it race-safely, `approval/decide` carries the `requirementId` guard regardless of how the client learned the state. */ +export interface ApprovalListPendingResult { + /** Exactly the `approval/request` params of tdd SS5.3, one per pending approval. */ + approvals: ApprovalRequestParams[]; + /** Exactly the `userInput/request` params of tdd SS5.10, one per pending prompt. */ + userInputs: UserInputRequestParams[]; +} + +/** The approval enforcement modes (tdd SS5.12, camelCased `ApprovalBackendMode`). **Closed** by design (D-006, select-never-create): a client selects a preconfigured mode and can never construct one; widening this enum is a deliberate, gate-visible protocol change. */ +export type ApprovalMode = "allowAll" | "promptUnmatched" | "onRequest" | "denyUnmatched"; + +/** Whether a mode change did anything (tdd SS5.12), mirroring `ApprovalReconfigureApplyOutcome`. Apply failures are `commandRejected`. */ +export type ApprovalModeApplyOutcome = "completed" | "noop" | (string & {}); + +/** How an approval mode took effect (tdd SS5.12, the effective-mode projection's `source` vocabulary). Open. */ +export type ApprovalModeSource = "startup" | "replay" | "approvalReconfigure" | (string & {}); + +export interface ApprovalOrigin { + command?: string; + kind: string; + url?: string; +} + +export type ApprovalPersistenceStatus = "succeeded" | "failed" | (string & {}); + +export type ApprovalPolicyResult = "allow" | "deny" | (string & {}); + +/** Full params shared by `approval/request` and `approval/requested`. */ +export interface ApprovalRequestParams { + approvalId: string; + availableChoices: ApprovalChoice[]; + currentRequirementId: ApprovalRequirementRef; + itemId: string; + judgeEscalated: boolean; + protectedWrite: boolean; + rawArgs: string; + sessionId: string; + sourceRange: SourceRange; + /** Present only for a child (native subagent) approval projected onto the parent session's plane (ADR 36182); parent-own approvals omit it. */ + subagentOrigin?: ApprovalSubagentOrigin; + subject: ApprovalSubject; + taskId: string; + toolCallId: string; + toolName: string; + turnId: string; + viewCursor: string; +} + +/** Approval-stage token carried in SS5 params and stale-requirement errors. */ +export interface ApprovalRequirementRef { + approvalId: string; + sourceIndex: number; +} + +/** Winning terminal returned to a losing `approval/decide` command. */ +export interface ApprovalResolutionSummary { + decision: string; + resolvedBy: string; + viewCursor: string; +} + +export type ApprovalResolvedBy = "user" | "policy" | "llmJudge" | (string & {}); + +/** `approval/resolved` params: the first durable terminal decision. */ +export interface ApprovalResolvedParams { + amendment?: ApprovalAmendment; + approvalId: string; + decidedByCommandId?: string; + decision: ApprovalDecision; + itemId: string; + policyResult: ApprovalPolicyResult; + resolvedBy: ApprovalResolvedBy; + sessionId: string; + sourceRange: SourceRange; + stageEvidence: ApprovalStageEvidence[]; + /** Present only for a child (native subagent) approval projected onto the parent session's plane (ADR 36182); parent-own approvals omit it. */ + subagentOrigin?: ApprovalSubagentOrigin; + turnId: string; + viewCursor: string; +} + +export interface ApprovalStage { + argv: string[]; + argvComplete: boolean; + position: number; + requirementId: ApprovalRequirementRef; + resolution: ApprovalStageResolution; + suggestedPrefix?: ApprovalSuggestedPrefix; + totalStages: number; +} + +export interface ApprovalStageEvidence { + argv: string[]; + position: number; + requirementId: ApprovalRequirementRef; + resolution: ApprovalStageResolution; + totalStages: number; +} + +export interface ApprovalStageResolution { + argvPrefix?: string[]; + diagnostic?: string; + kind: string; +} + +/** Child (native subagent) provenance for an approval projected onto the PARENT session's approval plane (#36182 / ADR 36182): identifies the originating child run/agent so a client can attribute the prompt. Omitted (`skip_serializing_if`) on the parent's own approvals, so pre-existing parent frames stay byte-identical. */ +export interface ApprovalSubagentOrigin { + /** The child run that parked on this approval. */ + childRunId: string; + /** The child session stream id whose records carry this approval. */ + childSessionId: string; + /** The originating child's subagent id, from the parent session's durable subagent control records. */ + subagentId: string; +} + +/** Open approval subject union. Unknown kinds are rendered generically and never auto-approved by clients (tdd SS5.2). */ +export interface ApprovalSubject { + access?: string; + command?: string; + host?: string; + /** Open discriminator: `shell | fileAccess | network | unixSocket | process | tool`. */ + kind: string; + origin?: ApprovalOrigin; + path?: string; + port?: number; + protocol?: string; + stages?: ApprovalStage[]; + target?: string; + toolName?: string; + workspaceRoot?: string; +} + +export interface ApprovalSuggestedPrefix { + argvPrefix: string[]; + label: string; +} + +/** `approval/updated` params: the refreshed pending view plus one change. */ +export interface ApprovalUpdatedParams { + approvalId: string; + availableChoices: ApprovalChoice[]; + change: ApprovalChange; + currentRequirementId: ApprovalRequirementRef; + sessionId: string; + sourceRange: SourceRange; + /** Present only for a child (native subagent) approval projected onto the parent session's plane (ADR 36182); parent-own approvals omit it. */ + subagentOrigin?: ApprovalSubagentOrigin; + subject: ApprovalSubject; + viewCursor: string; +} + +/** One attention flag (tdd SS2.4, ADR 31983 D3): a pending server-initiated request class parked on the session. Open on the wire — clients MUST ignore unknown values; future attention kinds are additive. */ +export type AttentionFlag = "approvalPending" | "inputPending" | (string & {}); + +/** Who durably backgrounded a task (tdd SS4.5.5, `TaskBackgroundedInitiator`). Open — runtime vocabulary. */ +export type BackgroundInitiator = "user" | "timeout" | (string & {}); + +/** The latest branch observation in the snapshot (tdd SS4.6.4, SS4.9.1). */ +export interface BranchState { + /** The observed branch; `null` on a detached-HEAD observation. */ + branch: string | null; + /** The detected version-control system; absent when none was detected. */ + vcs?: Vcs; + /** The observed workspace root. */ + workspaceRoot: string; +} + +/** A grantable capability name (SS1.4.4). Open: the reserved `rawLog` entry joins this domain as an additive open-enum extension when SS6 un-defers (#13929, Scenario 5 AS-3) — closed would make that a retype. */ +export type CapabilityName = "userShell" | "sessionMcp" | "sessionListStream" | (string & {}); + +/** The client's requested capability posture (SS1.4.1). Every member defaults; an absent `capabilities` object means all defaults. */ +export interface ClientCapabilities { + /** Opt into experimental methods, fields, and variants (default `false`). */ + experimentalApi?: boolean; + /** Exact notification method names the client declines; no wildcards; unknown names accepted and ignored; the protected set (SS1.7) cannot be opted out. */ + optOutNotificationMethods?: string[]; + /** Names from the capability registry. Unknown entries are not an error and simply do not appear in `grantedCapabilities` — which is why this is a list of free strings rather than of registry names. */ + requestedCapabilities?: string[]; + /** Whether this client can render a `userInput/request` dialog and answer it (SS5.10). **Absent means capable** (D-047): a client that predates the member keeps today's contract, so no existing client changes its handshake. `false` makes the host withhold `userInput/request` toward this client — the D-027 additive-optional-field + withheld-method convention. Deliberately NOT a `requestedCapabilities` name: that registry records operations a host GRANTS (SS1.4.4), and whether a client can draw a dialog is a fact about the client, never a privilege the host hands out. */ + userInputDialogs?: boolean; +} + +/** Client identification inside `initialize` params (SS1.4.1). Diagnostics and telemetry attribution only; never an authority claim (SS1.10). */ +export interface ClientInfo { + /** Machine identifier, `[a-z0-9_]+` (SS1.4.1). */ + name: string; + /** Human display name. */ + title?: string; + /** Client version string. */ + version: string; +} + +/** The uniform SS3.1.2 command acknowledgement: admission only, never an outcome. `session/compact` alone may answer `"noop"`; every other command answers `"accepted"`. */ +export interface CommandAcceptedResult { + /** Echo of the client-minted UUIDv7 `commandId` (SS3.1.1). */ + commandId: string; + /** `"accepted"` for every admitted command (SS3.1.2; closed vocabulary). */ + status: CommandAckStatus; +} + +/** The ack-status vocabulary (`tdd.md` SS3.1/SS3.1.2): `"accepted"` for every admitted command; `session/compact` alone may answer `"noop"`. Closed: SS3.1.2 names exactly these two values, so SDK clients get a discriminated type and validation catches a wrong status (PR #21550 review) — and a client that received a third value would have been told nothing it can act on, unlike [`TurnStartDisposition`], where "acked, not otherwise classified" is a usable reading. */ +export type CommandAckStatus = "accepted" | "noop"; + +/** The SS3.1.2 ack `status`: `accepted` for every admitted command. `session/compact` is the one method that may additionally answer `noop` ([`crate::method::runtime::CompactStatus`]); no other command uses another status (tdd SS3.1.2). */ +export type CommandStatus = "accepted" | (string & {}); + +/** `session/compact`'s ack status (tdd SS3.7): the one method that may answer `noop` in addition to the SS3.1.2 `accepted`. A noop is a success, not an error, and it is durably settled like any other outcome. */ +export type CompactStatus = "accepted" | "noop" | (string & {}); + +/** Compaction outcome (tdd SS4.5.10, the SS3.7 vocabulary). Open. */ +export type CompactionOutcome = "compacted" | "noop" | "failed" | "cancelled" | (string & {}); + +/** What initiated a compaction (tdd SS4.5.10). Open. */ +export type CompactionTrigger = "manual" | "auto" | (string & {}); + +/** Context pressure level (tdd SS4.6.6): hard threshold first, both inclusive `>=`. Open. */ +export type ContextPressureLevel = "normal" | "warning" | "blocked" | (string & {}); + +/** The SS4.9.1 snapshot `contextUsage` block: the latest `(windowTokens, usedTokens, pressure)` triple; the snapshot member is `null` until the fold's generation chain holds a tracked anchor AND the current basis is present (absent is never fabricated). */ +export interface ContextUsage { + /** Server-computed pressure level. */ + pressure: ContextPressureLevel; + /** Counted-once occupancy at the latest provider-reported fact. */ + usedTokens: number; + /** The effective context-window size; absent when the basis has no limit. */ + windowTokens?: number; +} + +/** Session running totals of counted-once usage (tdd SS4.6.5). */ +export interface CumulativeTokenUsage { + /** Output tokens, session total. */ + outputTokens: number; + /** Counted-once prompt tokens, session total. */ + promptTokens: number; + /** Counted-once totals, session total. */ + totalTokens: number; +} + +/** The effective approval-mode projection (`EffectiveApprovalModeState`, tdd SS5.12): the same object `session/setApprovalMode` returns as `effectiveMode` and the `Session` object carries as `approvalMode`. */ +export interface EffectiveApprovalModeState { + /** The command that last set it; `null` when no command did. */ + lastCommandId: string | null; + /** The mode in effect. */ + mode: ApprovalMode; + /** How the mode took effect. */ + source: ApprovalModeSource; +} + +/** The latest effective-model fact in the snapshot (tdd SS4.9.1). */ +export interface EffectiveModel { + /** The selected model. */ + modelId: string; + /** The selected provider; `null` when the selection names none. */ + providerId: string | null; + /** What drove the selection. */ + source: ModelChangeSource; +} + +/** The optional `error.data` object (SS1.6). All members additive-optional; `kind` is always present when `data` is. */ +export interface ErrorData { + /** The next provable UTF-8 boundary on a misaligned text-media `item/readOutput` read (`-32602` `invalidParams`, FR-016b/D-17214-2): absent when no boundary is provable from the stored bytes ahead. */ + alignedNextOffset?: number; + /** The rejected anchor value on `notFound`/`missingAnchor` and the `-32042` boundary arms (SS4.7.3, SS4.11); on `-32042` it is served as an explicit `null` when the request named no concrete anchor (spec 208 FM-005). */ + anchor?: string | null; + /** Approval identity on SS5 errors. */ + approvalId?: string; + /** The stored output's availability on `outputUnavailable` — the durable `ToolOutputAvailability` value, read-time-derived when the durable record still says `available` (SS4.5.5; spec 208 FM-008). */ + availability?: string; + /** The missing capability, on `capabilityRequired` errors. Typed on the grantable registry, so `rawLog` is outside the v1 domain and joins it as an additive open-enum extension when SS6 un-defers (TEST-009). */ + capability?: CapabilityName; + /** The configured command-admission bound, on `backpressured` errors. */ + capacity?: number; + /** Rejected server-minted choice on `approvalChoiceInvalid`. */ + choiceId?: string; + /** The rejected command's identifier, on `commandRejected` errors. The ratified v1 contract pairs it with `reason` (specs/13929-msp-activation/tdd.md SS3.6 admission-failure table and its `-32030` example), so a client can settle the exact command it sent without parsing the message string. */ + commandId?: string; + /** Current stage token on `approvalRequirementStale`. */ + currentRequirementId?: ApprovalRequirementRef; + /** SS1.5.1 descriptor, on `experimentalRequired` errors. */ + descriptor?: string; + /** Free-form additive detail. */ + details?: Record; + /** The oldest servable view position on `viewTruncated` (`-32040`, SS4.11); served as an explicit `null` when nothing before the head is servable — the null is present on the wire, never a dropped key (spec 208 FM-005 / Scenario 6.2). */ + earliestCursor?: string | null; + /** The item whose stored output was requested, on the `item/readOutput` arms (`notFound`, `outputUnavailable`, and the misaligned-offset `invalidParams`). */ + itemId?: string; + /** The stable camelCase category clients branch on. */ + kind: ErrorKind; + /** Rejected inclusive fork boundary on `forkBoundaryInvalid`. */ + lastTurnId?: string; + /** The latest installed boundary's view cursor on the `-32042` arms — always present in the `-32042` JSON and explicitly `null` when no boundary exists (SS4.11, FM-004). */ + latestBoundaryCursor?: string | null; + /** The exceeded byte limit, on `inputTooLarge` errors. */ + limitBytes?: number; + /** The requested `outputRef.id`, on the same `item/readOutput` arms. */ + outputRef?: string; + /** Candidate retained paths on `sessionAmbiguous`. */ + paths?: string[]; + /** Failure detail vocabulary (e.g. `"missingAnchor"` on `notFound` for a missing view-cursor anchor). */ + reason?: string; + /** Winning resolution on `approvalAlreadyResolved`. */ + resolution?: ApprovalResolutionSummary; + /** Whether retrying can succeed (e.g. `overloaded`). When present, overrides the error table row's `retryable` default for this code. */ + retryable?: boolean; + /** The rejected skill selector on `skillNotFound` (`-32032`, SS3.22.4). */ + selector?: string; + /** Session identity on errors whose lookup is session-scoped. */ + sessionId?: string; + /** Winning settlement on `userInputAlreadySettled`. */ + settlement?: UserInputSettlementSummary; + /** User-input prompt identity on SS5.10 errors. */ + userInputId?: string; + /** The blocked view position on `pageEventTooLarge` errors. */ + viewCursor?: string; +} + +/** A stable `error.data.kind` category (SS1.6): camelCase, the value clients branch on. Open: SS2–SS5 lanes add kinds additively as their methods land (Appendix B already registers them), and the spec's edge-case rule makes a new `kind` additive only because this domain is declared open. */ +export type ErrorKind = + | "parseError" + | "invalidRequest" + | "notInitialized" + | "alreadyInitialized" + | "methodNotFound" + | "invalidParams" + | "experimentalRequired" + | "internal" + | "pageEventTooLarge" + | "outputResultTooLarge" + | "overloaded" + | "inputTooLarge" + | "capabilityRequired" + | "notFound" + | "interrupted" + | "cancelled" + | "sessionNotFound" + | "sessionInUse" + | "sessionAmbiguous" + | "forkBoundaryInvalid" + | "sessionNotLoaded" + | "sessionStreamMismatch" + | "commandRejected" + | "backpressured" + | "skillNotFound" + | "viewTruncated" + | "outputUnavailable" + | "boundaryPruned" + | "boundaryUnusable" + | "noBoundary" + | "approvalNotFound" + | "approvalAlreadyResolved" + | "approvalChoiceInvalid" + | "approvalRequirementStale" + | "approvalReviewerUnavailable" + | "userInputNotFound" + | "userInputAlreadySettled" + | "userInputAnswerInvalid" + | (string & {}); + +/** The `error` member of an error response (SS1.2 §2.4). */ +export interface ErrorObject { + /** Registry code (Appendix B). Typed as a plain integer on the wire; the value domain is the registry below (INV-018). */ + code: number; + /** Structured detail; carries `kind` when present. */ + data?: ErrorData; + /** Human-readable message. Never a branch point (SS1.6). */ + message: string; +} + +/** An error response frame (SS1.2 §2.4). Exactly one of `result` or `error` appears on a response; this type is the `error` half. */ +export interface ErrorResponse { + /** The error payload (Appendix B registry). */ + error: ErrorObject; + /** Echo of the request id; `null` **only** for an unrecoverable parse error whose offending id could not be recovered (SS1.3). Always serialized, so `None` renders as `null` rather than being omitted — required-but-nullable (see [`require_nullable_id`]). */ + id: RequestId | null; + /** The literal `"2.0"`. */ + jsonrpc: JsonRpcVersion; +} + +/** Where a fork cuts the source history (tdd SS2.5.3). Turn ids are used instead of counts because ids stay stable across compaction and concurrent appends while indices do not. */ +export interface ForkCutPoint { + /** The last completed turn to copy, inclusive. Naming an in-progress or unknown turn fails `forkBoundaryInvalid`. */ + lastTurnId: string; +} + +/** Fork provenance folded from the durable `session.fork.created` record (`ForkProvenance`, tdd SS2.4). */ +export interface ForkProvenance { + /** The `commandId` of the `session/fork` that created it. */ + commandId: string; + /** An **opaque provenance string** preserved verbatim from the durable record. Display-only — not one of the SS6.2 cursor families: clients MUST NOT parse it and no method accepts it (tdd SS2.4). */ + cutCursor: string; + /** Whether the fork named an explicit cut point. */ + cutExplicit: boolean; + /** The source session this fork was cut from. */ + sessionId: string; +} + +/** The session goal block (tdd SS4.6.2, mirrors the runtime's goal state, camelCased). `status` and `percentComplete` are carried **verbatim** — out-of-contract status strings and >100 percents pass through; display clamping is the renderer's job. */ +export interface Goal { + /** Current work description, when present. */ + currentWork?: string; + /** Next work description, when present. */ + nextWork?: string; + /** The goal objective text. */ + objective: string; + /** Percent complete, verbatim (>100 passes through). */ + percentComplete: number; + /** Goal status, verbatim from the durable goal state (free string by design: out-of-contract values pass through). */ + status: string; +} + +/** `goal/clear` params (tdd SS3.18). An `objective` here is an unknown field and rejects `-32602 invalidParams` — the bare verbs carry exactly this pair. */ +export interface GoalClearParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; +} + +/** The shared SS3.18 goal ack, admission-only: all five verbs answer this one shape (the tdd's "Shared contract"), differing only in when `turnId` is present. */ +export interface GoalCommandResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** Present by exactly the four SS3.18 result cases: an idle wake carries the fresh goal turn's id; a busy `set`/`edit`/`resume` carries the admission-time active turn's id (a routing fact, not a delivery promise); `pause`/`clear` never carry it; an idle admission whose resulting goal is not unfinished parks the notification and carries none. **Additive-optional**: absent means "no turn named", never fabricated. */ + turnId?: string; +} + +/** `goal/edit` params (tdd SS3.18): replace the current goal's objective. Same shape as `goal/set`; the verbs differ in their `missing_goal` precondition, not their payload. */ +export interface GoalEditParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The replacement objective; same trim/non-empty rule as `goal/set`. */ + objective: string; + /** The target session. */ + sessionId: string; +} + +/** `goal/pause` params (tdd SS3.18); shape as `goal/clear`. */ +export interface GoalPauseParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; +} + +/** `goal/resume` params (tdd SS3.18); shape as `goal/clear`. */ +export interface GoalResumeParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; +} + +/** `goal/set` params (tdd SS3.18): set the session's goal objective. */ +export interface GoalSetParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The objective text; required, non-empty after Unicode-whitespace trim (the trimmed text is the payload). Empty-after-trim is `-32602 invalidParams` (tdd SS3.18). */ + objective: string; + /** The target session. */ + sessionId: string; +} + +/** What history a lifecycle result actually served (tdd SS2.5.2). Open on the client side: report-what-was-served means a client treats an unknown mode as "page it yourself". */ +export type HistoryMode = "anchoredSnapshot" | "inline" | "snapshot" | "none" | (string & {}); + +/** Why a result served `history.mode: "none"` — spec 208 FM-005's typed unavailability (tdd SS2.5.2; D-050). Open on the client side: an absent (older server) or unknown (newer server) value decodes conservatively as an unknown reason, and `viewCursor` text never substitutes for it (spec 208 INV-19734-1). */ +export type HistoryNoneReason = + | "excluded" + | "cursorSuffix" + | "historyBudget" + | "projectionUnavailable" + | "projectionReadLimit" + | (string & {}); + +/** The `history` request preference of `session/resume` (tdd SS2.5.2). The forced values downgrade `anchored` → `inline` → `snapshot` → `none`; under `auto` the full rung order is anchoredSnapshot → inline → snapshot → elided snapshot → none. */ +export type HistoryPreference = "auto" | "inline" | "snapshot" | "anchored"; + +/** Disposition when a turn is already running (tdd SS3.2). The wire default is `queue`: an SDK caller who has not looked at session state should not silently mutate an in-flight turn. */ +export type IfBusy = "queue" | "steer" | "replace"; + +/** `initialize` request params (SS1.4.1). */ +export interface InitializeParams { + /** Capability posture; absent means all defaults. */ + capabilities?: ClientCapabilities; + /** Client identification. */ + clientInfo: ClientInfo; +} + +/** The `initialize` result (SS1.4.1). */ +export interface InitializeResult { + /** Echo of the effective negotiated experimental setting. */ + experimentalApi: boolean; + /** Subset of the requested capabilities, plus policy-implicit grants. Fixed for the connection lifetime (INV-009). */ + grantedCapabilities: CapabilityName[]; + /** Absolute path of the muse home directory. */ + museHome: string; + /** Server runtime platform family. */ + platformFamily: PlatformFamily; + /** Server operating system. */ + platformOs: PlatformOs; + /** Envelope schema version and stable-surface fingerprint. */ + schema: SchemaInfo; + /** Server identification. */ + serverInfo: ServerInfo; + /** Whether this host persists its sessions (SS2.13). Optional so the addition is additive under SS1.5.4; a v1 host always sends it, and a client reads absent as `durable` because no server that omits it has the ephemeral profile. */ + sessionDurability?: SessionDurability; + /** Exact user-agent string presented to upstream model providers. */ + userAgent: string; +} + +/** One transcript item at one revision (tdd SS4.4.1 common fields plus the per-kind fields of SS4.5.2–4.5.10, all optional and owned by the kind their doc names). `item/started`, `item/updated`, and `item/completed` carry the full object; `item/delta` appends to it by field path. */ +export interface Item { + /** `subagent`: agent definition path. */ + agentPath?: string; + /** `toolCall`: the approval that gated this call (tdd SS5); join key for the approval view events. */ + approvalId?: string; + /** `toolCall`: the model-authored argument JSON, **verbatim**; clients parse. Verbatim keeps the fold byte-deterministic and survives model-emitted almost-JSON (tdd SS4.5.5). */ + args?: string; + /** `userMessage`: image attachment metadata only — base64 payloads are not echoed back on the view (tdd SS4.5.2). */ + attachments?: MessageAttachment[]; + /** `toolCall`: `true` once the task was durably backgrounded; delivered via `item/updated`. */ + background?: boolean; + /** `toolCall`: who backgrounded the task; absent on pre-split records — never inferred (tdd SS4.5.5). */ + backgroundInitiator?: BackgroundInitiator; + /** `toolCall`: the provider call id (`call_...`), opaque. */ + callId?: string; + /** `subagent`/`reminderChild`: the child's own session id, readable via `session/read`/`view/page` — child transcript drill-down without a second protocol (tdd SS4.5.7). */ + childSessionId?: string; + /** `reminderChild`: parent-session-dir-relative child log path; absent when no filesystem log. */ + childSessionLogPath?: string; + /** `workflow`: folded per-child state, keyed by `(childId, attempt)`, re-emitted whole on every change — the item `revision` is the ordering guard (tdd SS4.5.8). */ + children?: WorkflowChild[]; + /** `userMessage`/`userShell`: the submitting command — multi-client UIs de-duplicate their local echo on it. */ + commandId?: string; + /** `userShell`: the command text as submitted. */ + commandText?: string; + /** `subagent`: camelCased `SubagentControlStatus` (open enum); `status` stays the generic item vocabulary. */ + controlStatus?: SubagentControlStatus; + /** `subagent`: nesting depth. */ + depth?: number; + /** `userMessage`: presentation form (tdd SS3.2); absent when the client sent none. */ + displayText?: string; + /** `userShell`/`subagent`: observed wall-clock duration. */ + durationMs?: number; + /** `workflow`: launched entry identity. */ + entryId?: string; + /** `userShell`: the process exit code, when it exited by code. */ + exitCode?: number; + /** `userShell`: the terminating signal NUMBER, when signalled (e.g. 9) — the durable payload verbatim; nothing maps numbers to names, and the fold never invents one. */ + exitSignal?: number; + /** `toolCall`: machine-readable failure class (`TaskFailureKind`, snake_case verbatim — durable runtime vocabulary, the SS1.6 casing exemption). */ + failureKind?: string; + /** `toolCall`/`subagent`: `Failed`/`Rejected`/`Cancelled` reason text, verbatim. */ + failureReason?: string; + /** Server-provided one-line human summary any kind MAY carry, for generic rendering of kinds a client does not recognize; new kinds SHOULD carry it during their first release cycle (tdd SS4.10). */ + fallbackText?: string; + /** `reminderChild`: the reminder generation. */ + generationId?: number; + /** Bare UUIDv7; the item's identity across its whole lifecycle. Identity rule (tdd SS4.4.1): the task id for task-backed kinds (`toolCall`, `subagent`), the pre-minted commit `message_id` for delta-streamed kinds (`agentMessage`, `reasoning`), and the opening durable record's event id for everything else. Opaque to clients. */ + itemId: string; + /** The item kind (open enum): clients MUST render unknown kinds generically — kind name plus `status` plus `fallbackText` (tdd SS4.10). */ + kind: ItemKind; + /** `workflow`: the reconciled terminal message, set on completion. */ + message?: string; + /** `toolCall`: rich content the model saw beyond text; base64 is not inlined on the view (tdd SS4.5.5). */ + modelVisibleContent?: ModelVisibleContent[]; + /** `subagent`: objective as spawned. */ + objective?: string; + /** `compaction`: terminal only — folds installed/fallback status. */ + outcome?: CompactionOutcome; + /** `toolCall`/`userShell`: stored-output reference; fetch the full bytes via `item/readOutput` (served by #208). */ + outputRef?: OutputRef; + /** `toolCall`: stored structured-patch reference (`kind: "tool_patch"`, `mediaType: "application/json"`); the body is fetched via `item/readOutput` with `patchRef.id`, and the ref survives the SS2.5.2 elided-snapshot rung exactly like `outputRef` without ever being an elision trigger (tdd SS2.5.2, SS4.5.5; #33025). */ + patchRef?: OutputRef; + /** `toolCall`: server-authored edit-family diff summary (#33025) — always beside `patchRef`; absent = no diff available (tdd SS4.5.5). */ + patchSummary?: PatchSummary; + /** `reasoning`: provider reasoning item id (e.g. `rs_...`), for provider-side correlation. */ + providerItemId?: string; + /** `compaction`: noop/failure reason, verbatim (snake_case durable vocabulary, e.g. `"no_compactable_history"`). */ + reason?: string; + /** RFC3339 timestamp of the item's driving durable record. Absent on ephemeral-opened items until first durable re-emission (tdd SS4.4.1). */ + recordedAt?: string; + /** `reminderChild`: the reminder agent's id. */ + reminderAgentId?: string; + /** `subagent`: the result envelope from `ResultReady` (tdd SS4.5.7). */ + result?: SubagentResult; + /** `workflow`: set on resumed launches. */ + resumeFromRunId?: string; + /** `userMessage`: `true` after an accepted retract (tdd SS4.5.1); re-emitted via `item/updated`. */ + retracted?: boolean; + /** Integer >= 1, strictly monotonic per item; apply rule is replace-iff-higher. `item/delta` never bumps it (tdd SS4.4.1). */ + revision: number; + /** `subagent`: role as spawned. */ + role?: string; + /** `workflow`: launched script identity. */ + scriptId?: string; + /** Open enum; terminal = anything other than `"inProgress"`. Unknown values MUST be treated as terminal-unknown and rendered generically (tdd SS4.4.1). */ + status: ItemStatus; + /** `userMessage`: `true` when injected mid-turn via `turn/steer` or `ifBusy: "steer"`; absent otherwise. */ + steered?: boolean; + /** `compaction`: summarizer strategy (installed only). */ + strategyId?: string; + /** `subagent`: durable child identity (`subagent_id`). */ + subagentId?: string; + /** `compaction`: opaque provenance string naming the compaction boundary. A compaction-anchored read anchor since D-029 (2026-08-12): accepted by `session/resume` and `view/page` (wire shape and validation are the #208 lane's). Still opaque — clients relay it, never parse it (tdd SS4.5.10). */ + summarizedThrough?: string; + /** `reasoning`: one entry per summary part; part *n* streams via `item/delta` field `"summary.n"` (part boundary = index change). */ + summary?: string[]; + /** `reminderChild`: the linked task id. */ + taskId?: string; + /** `userMessage`: the prompt text as submitted. `agentMessage`: the accumulated reply, streamed via `item/delta` field `"text"`. `reasoning`: raw committed reasoning text where the provider exposes it (never streamed in v1, tdd SS4.5.4). */ + text?: string; + /** `compaction`: token budget snapshot after, when measured. */ + tokensAfter?: number; + /** `compaction`: token budget snapshot before, when measured. */ + tokensBefore?: number; + /** `toolCall`: tool name. */ + tool?: string; + /** `compaction`: what initiated the compaction. */ + trigger?: CompactionTrigger; + /** `workflow`: camelCased `WorkflowLaunchTriggerSource`, verbatim (durable runtime vocabulary, e.g. `"modelProposal"`). */ + triggerSource?: string; + /** `true` when the server's per-surface text budget saturated a streamed surface (`agentMessage.text`, `reasoning.summary[*]`, `toolCall.visibleOutput`, `userShell.visibleOutput`); the durable full text remains in the log (tdd SS4.5.4). */ + truncated?: boolean; + /** The owning turn (== the submitting `commandId` for fresh turns, tdd SS3.1.4). `null` only for `userShell` — the one kind outside a turn (tdd SS4.5.6). */ + turnId?: string | null; + /** `subagent`: **transitive** observed usage — the child and its own descendants; updated in place, absent until first observation; never folded into `session/tokenUsage.cumulative` (tdd SS4.6.5). */ + usage?: TokenUsage; + /** `toolCall`/`userShell`: bounded transcript-visible result text (budget per tdd SS4.5.4); streams via `item/delta` field `"output"`. */ + visibleOutput?: string; + /** `subagent`/`workflow`: the owning durable workflow run id (opaque string — not a UUID family). */ + workflowRunId?: string; +} + +/** `item/completed` params (tdd SS4.3): the item reached its terminal state — the authoritative final object. Always cites a durable `sourceRange` (tdd SS4.2). Clients MUST accept `item/completed` for an `itemId` they never saw `item/started` for (single-shot kinds; after a gap fill; tdd SS4.4.1). */ +export interface ItemCompletedParams { + /** The full item at its terminal revision. */ + item: Item; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `item/delta` params (tdd SS4.3.1): a UTF-8-safe streaming append to an open item's field. Ephemeral-sourced by definition: this params object has **no** `sourceRange` member at all (spec 14653 INV-009 — the schema enforces the exemption). Deltas never bump `revision`. */ +export interface ItemDeltaParams { + /** The appended text; concatenation of a field path's deltas in cursor order equals that field's value on `item/completed` unless the surface saturated (spec 14653 INV-005). */ + delta: string; + /** Dotted field path the append targets (`"summary.0"`, `"output"`, ...); absent means `"text"` (tdd SS4.3.1). */ + field?: string; + /** The open item being appended to. */ + itemId: string; + /** The owning session. */ + sessionId: string; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** The nine v1 item kinds (tdd SS4.5.2–4.5.10). Open: a new kind is additive evolution, and clients MUST render unknown kinds generically (tdd SS4.10). */ +export type ItemKind = + | "userMessage" + | "agentMessage" + | "reasoning" + | "toolCall" + | "userShell" + | "subagent" + | "workflow" + | "reminderChild" + | "compaction" + | (string & {}); + +/** The `item/readOutput` content encoding (tdd SS4.7.4). Closed: text media is ALWAYS `utf8` and binary media `base64`; a third value would change the client's decode contract. */ +export type ItemReadOutputEncoding = "utf8" | "base64"; + +/** `item/readOutput` params (tdd SS4.7.4): byte-ranged fetch of stored full output that the view truncated — the `outputRef` fetch path SS3.9 and SS4.5.5 owe. Read-only; works on loaded and unloaded sessions; no lease. */ +export interface ItemReadOutputParams { + /** The item whose stored output is fetched. */ + itemId: string; + /** STORED bytes requested; default and max 6 MiB (tdd SS4.7.4). A value above the max is served at the max. */ + lengthBytes?: number; + /** STORED-byte offset to start from; 0 when omitted. STORED bytes are a property of the output, not of a transport (tdd SS4.7.4). */ + offsetBytes?: number; + /** The `outputRef.id` from the item (never the `uri`; the uri is display/provenance). */ + outputRef: string; + /** The session the item belongs to. */ + sessionId: string; +} + +/** `item/readOutput` result (tdd SS4.7.4): one stored-byte page. */ +export interface ItemReadOutputResult { + /** STORED bytes served in THIS response (not the output's total; that is `outputRef.byteLen` on the item). The next page's `offsetBytes` is `offsetBytes + byteLen` — short-serving and advancing are separate, so paging never skips or double-reads a byte (tdd SS4.7.4). */ + byteLen: number; + /** The served range, decoded per `encoding`. */ + content: string; + /** How `content` encodes the stored bytes. */ + encoding: ItemReadOutputEncoding; + /** `true` when this range reached the end of the stored output. */ + eof: boolean; + /** The stored output's media type (e.g. `text/plain`). */ + mediaType: string; + /** The STORED-byte offset this response actually served from. */ + offsetBytes: number; +} + +/** `item/started` params (tdd SS4.3): a new item opened on the transcript. `sourceRange` is absent when the item opens on an ephemeral record (the delta-streamed kinds); the item's authoritative open is re-stated by its durable-sourced `item/completed` (tdd SS4.2). */ +export interface ItemStartedParams { + /** The full item at revision 1. */ + item: Item; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from; absent on an ephemeral-sourced open (spec 14653 INV-009). */ + sourceRange?: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** Item status (tdd SS4.4.1). Open; terminal = anything other than `"inProgress"`, and unknown values are terminal-unknown, rendered generically. */ +export type ItemStatus = + | "inProgress" + | "completed" + | "failed" + | "cancelled" + | "rejected" + | "timedOut" + | (string & {}); + +/** `item/updated` params (tdd SS4.4.2): an open item changed non-terminally in a way deltas cannot express — the full item re-emitted at a higher revision (apply rule: replace iff higher). */ +export interface ItemUpdatedParams { + /** The full item at a higher revision. */ + item: Item; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** The literal `"2.0"` every frame carries (SS1.2). */ +export type JsonRpcVersion = "2.0"; + +/** `userMessage` image attachment metadata (tdd SS4.5.2): metadata only — the durable bytes live in the log and are reachable on the raw altitude. */ +export interface MessageAttachment { + /** Pixel height, when known. */ + height?: number; + /** The image media type (e.g. `"image/png"`). */ + mediaType: string; + /** Attachment type, `"image"` in v1 (free string: attachment vocabulary grows additively with the runtime's intake surface). */ + type: string; + /** Pixel width, when known. */ + width?: number; +} + +/** One visible catalog row (tdd SS3.10). Catalog rows marked hidden never reach the wire, so a client cannot select one. */ +export interface ModelCatalogEntry { + /** Context limit; `null` when the catalog source declared nothing. */ + contextLimit: number | null; + /** Cost block; `null` when the catalog source declared nothing. */ + cost: ModelCost | null; + /** The row's catalog default. Optional only for decoding older hosts; a present value is never null and is always a member of `variants`. Absent under `"unknown"` (ADR 33400 D2). */ + defaultReasoningEffort?: ReasoningEffort; + /** Description; `null` when the catalog source declared nothing. */ + description: string | null; + /** Presentation label. */ + displayLabel: string; + /** Marks the session's effective model when `sessionId` was supplied. May be false for every row — a client MUST NOT assume exactly one. */ + isActive: boolean; + /** Marks the catalog's default row. May be false for every row. */ + isDefault: boolean; + /** The selectable model id. */ + modelId: string; + /** Output limit; `null` when the catalog source declared nothing. */ + outputLimit: number | null; + /** Provider profile; `null` when the catalog source declared nothing. */ + profileId: string | null; + /** Provider routing. */ + providerId: string; + /** Described selectable tiers, a same-order subset of `variants`. Optional only for decoding older hosts; a present value is never null. Absent under `"unknown"` (ADR 33400 D2). */ + reasoningEffortVariants?: ModelDescribedReasoningEffort[]; + /** Release date; `null` when the catalog source declared nothing. */ + releaseDate: string | null; + /** Complete ordered selectable efforts. Optional only for decoding older hosts; a present value is never null. Current hosts always send it. */ + variants?: ModelReasoningEffortVariants; +} + +/** Where a model catalog came from (tdd SS3.10). **Open**: an unrecognized value is an unknown source, not an error. */ +export type ModelCatalogSource = + | "providerCatalog" + | "fakeCatalog" + | "unresolvedCatalog" + | "bundledCatalog" + | "configCatalog" + | (string & {}); + +/** What drove a model selection (tdd SS4.6.1). Open. */ +export type ModelChangeSource = "user" | "default" | "policy" | (string & {}); + +/** Per-1M-token catalog cost, carried **verbatim** for display and never rounded or re-formatted by the host (tdd SS3.10). Cost arithmetic stays client-local view math. */ +export interface ModelCost { + /** Cached-input cost, a decimal string. */ + cached: string; + /** Currency; nullable — today's catalogs are USD. */ + currency: string | null; + /** Input cost, a decimal string. */ + input: string; + /** Output cost, a decimal string. */ + output: string; +} + +/** One described reasoning-effort tier of a `model/list` row (tdd SS3.10, ADR 33400 D2): a selectable tier plus the catalog's display string for it when declared. */ +export interface ModelDescribedReasoningEffort { + /** The catalog's per-tier display string; absent when the catalog declared none. Optional only for decoding; a present value is never null. */ + description?: string; + /** The tier, in the closed D-024 vocabulary. */ + tier: ReasoningEffort; +} + +/** `model/list` params (tdd SS3.10): the discovery half of the model-picker gesture. **A query, not a command** — no `commandId`, no durable intake record, no view event. */ +export interface ModelListParams { + /** When present, the row matching that session's effective model is flagged `isActive`. When absent, no row is active — a client may list before it has a session (tdd SS3.10). */ + sessionId?: string; +} + +/** `model/list` result (tdd SS3.10). A snapshot at call time: v1 has no catalog subscription. `models` MAY be empty — a build shipped with no bundled models is a supported configuration. */ +export interface ModelListResult { + /** Visible rows only, newest `releaseDate` first. */ + models: ModelCatalogEntry[]; + /** The catalog's profile; `null` when none. */ + profileId: string | null; + /** The catalog's provider. */ + providerId: string; + /** Where the catalog came from — how a client tells a live provider catalog from a test fake and labels it honestly. */ + source: ModelCatalogSource; +} + +/** A complete ordered effort set, or an explicit unknown capability. */ +export type ModelReasoningEffortVariants = ReasoningEffort[] | UnknownModelReasoningEffortVariants; + +/** A model selection (tdd SS3.8). Empty strings are normalized to absent. */ +export interface ModelSelection { + /** Presentation label. */ + displayLabel?: string; + /** Catalog model id. Required. */ + modelId: string; + /** Provider profile. Omitted and explicit `null` both mean "no profile" (#23468). */ + profileId?: string | null; + /** Provider routing. */ + providerId?: string; +} + +/** Rich content the model saw beyond text (tdd SS4.5.5, `ModelVisibleToolContent`): metadata only — fetch bytes via `item/readOutput` when an `outputRef` exists. */ +export interface ModelVisibleContent { + /** Pixel height, when known. */ + height?: number; + /** The content media type. */ + mediaType: string; + /** The recorded content path. */ + path: string; + /** The tool that produced the content. */ + sourceToolName: string; + /** Content type, `"image"` in v1 (free string, grows with the durable vocabulary). */ + type: string; + /** Pixel width, when known. */ + width?: number; +} + +/** A notification frame, either direction (SS1.2 §2.2). No `id`; a notification is never answered. */ +export interface Notification { + /** Emission time in Unix milliseconds, recorded once at emission; server→client notifications only (SS1.2.5). Optional on the wire so decoders tolerate older servers. */ + emittedAtMs?: number; + /** The literal `"2.0"`. */ + jsonrpc: JsonRpcVersion; + /** Notification method name. */ + method: string; + /** Method-specific parameters; omitted entirely when empty. */ + params?: Record; +} + +/** Stored-output reference (tdd SS4.5.5): the camelCased fold of the durable `ToolOutputRef`. The fetch path is `item/readOutput` (#208). */ +export interface OutputRef { + /** Whether the bytes are servable (tdd SS4.5.5). */ + availability: OutputRefAvailability; + /** Stored byte length. */ + byteLen: number; + /** Content digest (e.g. `"sha256:..."`), when recorded. */ + digest?: string; + /** The stored output's durable id. */ + id: string; + /** The stored output's kind, verbatim durable vocabulary (e.g. `"tool_output"`; snake_case per the SS1.6 casing exemption). */ + kind: string; + /** Media type, when recorded. */ + mediaType?: string; + /** Stored path, when recorded. */ + path?: string; + /** The stored output's URI. */ + uri: string; +} + +/** Whether a stored output's bytes are servable (tdd SS4.5.5). Open — durable runtime vocabulary may grow additively. */ +export type OutputRefAvailability = + | "available" + | "missing" + | "unsupported" + | "accessFailed" + | (string & {}); + +/** Server-authored edit-family diff summary (tdd SS4.5.5, #33025): `files` counts the stored patch document's file entries; `added` and `removed` are the total `+`/`-` prefixed LINE counts summed over the stored patch's hunks across all files — line counts, never hunk or byte counts. Rides the `toolCall` item beside `patchRef`; the body is fetched via `item/readOutput` with `patchRef.id`. */ +export interface PatchSummary { + /** Total `+`-prefixed line count across all files' hunks. */ + added: number; + /** File entries in the stored patch document. */ + files: number; + /** Total `-`-prefixed line count across all files' hunks. */ + removed: number; +} + +/** A pending approval in the snapshot: the SS2.5.2 pointer shape plus the gated `itemId` when one exists (tdd SS4.9.1). */ +export interface PendingApprovalPointer { + /** The pending approval's id. */ + approvalId: string; + /** The parked item, when one exists. */ + itemId?: string; + /** The cursor the approval opened at. */ + viewCursor: string; +} + +/** The `pendingRequests` discriminator (tdd SS2.5.2). Open enum, v1 values `approval` and `userInput`. */ +export type PendingRequestKind = "approval" | "userInput" | (string & {}); + +/** A late-joiner pointer at an unsettled server-initiated request (tdd SS2.5.2, SS2.2.1). The full payloads arrive as re-issued server-to-client requests right after a `session/resume` response (tdd SS5.6); `session/read` never re-issues them (tdd SS2.5.5). **A second E4 instance, RULED with E4 (#22785, owner, 2026-08-26): the flat discriminated-object precedent is accepted for this type too, on the `ApprovalSubject` precedent, with the serialized JSON unchanged. A strict union node kind may be funded later; if it is, it must cover both this type and `TurnInputPart`.** SS2.5.2 ratifies two kind-discriminated entry shapes (`{kind: "approval", approvalId, viewCursor}` / `{kind: "userInput", userInputId, viewCursor}`); this is one flat object with both ids optional, so the published schema accepts `{"kind":"approval","userInputId":…}` and an entry carrying no id at all. The v1 model names no object-variant union (the `ApprovalSubject` precedent, followed for `TurnInputPart`), and this instance differs from that one in a way the ruling should see: `kind` here is an OPEN enum, where `TurnInputPart.type` is closed. */ +export interface PendingRequestPointer { + /** Present on an `approval` entry. */ + approvalId?: string; + /** The discriminator; v1 values `approval` and `userInput`. */ + kind: PendingRequestKind; + /** Present on a `userInput` entry. */ + userInputId?: string; + /** The cursor the request opened at. */ + viewCursor: string; +} + +/** A pending user-input prompt in the snapshot (tdd SS4.9.1, SS5.10). */ +export interface PendingUserInputPointer { + /** The parked item, when one exists. */ + itemId?: string; + /** The pending prompt's id. */ + userInputId: string; + /** The cursor the prompt opened at. */ + viewCursor: string; +} + +/** The server runtime's platform family (SS1.4.1); may differ from the client's. Closed: SS1.4.1 fixes the value set, so widening it is a deliberate, gate-visible protocol change rather than a silent addition (a later `Closed`→`Open` flip is itself additive, data-model.md §5.2). */ +export type PlatformFamily = "unix" | "windows"; + +/** The server's operating system (SS1.4.1). Closed, for the same reason as [`PlatformFamily`]. */ +export type PlatformOs = "macos" | "linux" | "windows"; + +/** The reasoning-effort tier sampled at submission (tdd SS3.2, SS3.3). The **same closed tier vocabulary** on both the fresh-turn and steer lanes, spelled identically; invalid tiers are invalid params. `none` is a tier of the vocabulary (ask for no reasoning), not a way to say "unset". */ +export type ReasoningEffort = + | "none" + | "minimal" + | "low" + | "medium" + | "high" + | "xhigh" + | "max" + | "ultra"; + +/** What drove a reasoning-effort default change (tdd SS4.6.9). Open; v1's only producer is `user` (an accepted `session/setReasoningEffort`). */ +export type ReasoningEffortChangeSource = "user" | "default" | "policy" | (string & {}); + +/** The snapshot's standing session-default reasoning effort (tdd SS4.9.1, ADR 31255 D1): the fold of the latest completed `runtime.reasoning_effort_reconfigure` fact — the same pair `session/reasoningEffortChanged` carries. */ +export interface ReasoningEffortState { + /** The standing default tier — the closed SS3.2 vocabulary, spelled identically to `turn/start.reasoningEffort`. */ + reasoningEffort: ReasoningEffort; + /** Which actor class set the default. */ + source: ReasoningEffortChangeSource; +} + +/** One end of a [`SourceRange`]: a record's event id and its sequence number within the stream (tdd SS4.2). */ +export interface RecordPosition { + /** The record's event id. */ + id: string; + /** The record's sequence number within its stream. */ + sequence: number; +} + +/** A request frame, either direction (SS1.2 §2.1). */ +export interface Request { + /** Client-chosen id, unique among that client's in-flight requests. */ + id: RequestId; + /** The literal `"2.0"`. */ + jsonrpc: JsonRpcVersion; + /** Slash-namespaced camelCase method name. */ + method: string; + /** Method-specific parameters; omitted entirely when empty, never `null`. */ + params?: Record; + /** W3C trace passthrough (SS1.8); requests only. */ + trace?: TraceContext; +} + +/** A request id (SS1.3): client-chosen string or integer. `1` and `"1"` do not compare equal; each direction owns its own id space. */ +export type RequestId = number | string; + +/** The SS5.3.3 presentation receipt — the client's response to a server-initiated request (`approval/request`, `userInput/request`). The response acknowledges presentation only ("a surface showed or will show this"): it changes no state, the server uses it for diagnostics alone, and the decision/answer travels as a command (`approval/decide`, `userInput/answer`). An error response or a dropped connection means this connection could not present the request; the approval or prompt stays pending and the request is re-issued on the next subscribe (SS5.6). There is no dismiss-without-deciding on the wire. */ +export interface RequestReceipt {} + +/** The `schema` pair in [`InitializeResult`] (SS1.4.1, SS1.5.3). `version` is the wire **envelope** schema version — distinct from the session-view `schemaVersion`, the raw-log `schema_version`, and the 0.x/1.0 stability posture, which is not on the wire at all (INV-006a). */ +export interface SchemaInfo { + /** `sha256:<64 lower hex>` content hash of this server binary's stable-surface bundle (INV-003). A mismatch is a warning condition, not an error (SS1.4.1). */ + fingerprint: string; + /** Envelope schema version; `1` in v1, expected to stay `1` for a long time (SS1.4.1). */ + version: number; +} + +/** Server identification inside [`InitializeResult`]. */ +export interface ServerInfo { + /** Server name. */ + name: string; + /** Server version string. */ + version: string; +} + +/** The session object every lifecycle method returns or lists (tdd SS2.4). Additive-optional evolution applies: clients must ignore unknown fields. */ +export interface Session { + /** The `turnId` of the current foreground turn when `status` is `running`, and `null` when the session is idle (tdd SS2.4). **Required-nullable, per the owner ruling on #22946** ("approve required-nullable", review comment `r3863946961`, 2026-08-26). Both production writers hard-code `"activeTurnId": null` (`session/start/commit_load.rs` for `session/start`, `session/snapshot.rs` feeding resume/read/list/fork) and nothing strips it, so this is what the binary emits and what SS2.4's example spells. The optional-absent shape published it as plain `string` and REJECTED every idle `Session` frame the host sent — the #19923 defect class this PR exists to close. E5's original evidence for optional-absent ("every committed transcript shows the omission") was wrong: those transcripts are hand-authored fixtures, not host recordings. They are corrected in the same change under the ruling's SS1.5 `regenerationJustification`. */ + activeTurnId: string | null; + /** The folded effective approval mode. **Additive-optional**: a Session object that omits it means the host has not folded a mode, which is why the index-derived `session/list` entry may legitimately omit it (tdd SS2.4, SS5.12). */ + approvalMode?: EffectiveApprovalModeState; + /** Attention flags (tdd SS2.4, ADR 31983 D3). **Additive-optional**, present only when at least one flag is set; absence is a NON-assertion (nothing pending, or the loaded session's pending source declined to answer). Loaded sessions only: a `notLoaded` row omits it even while its durable pending set is non-empty. */ + attention?: AttentionFlag[]; + /** Derived workspace branch (tdd SS2.14.1, #27598) — the index's last derived value; the live-change signal stays `session/branchChanged` (SS4.6.4). **Additive-optional**, omitted when underivable. */ + branch?: string; + /** RFC3339. For a fork this is the fork session id's UUIDv7 mint instant (tdd SS2.4). */ + createdAt: string; + /** Derived first-user-prompt preview (tdd SS2.14.1, #27598). **Additive-optional**, omitted when underivable. */ + firstUserPrompt?: string; + /** `null` for root sessions; fork provenance otherwise (tdd SS2.4). */ + forkedFrom: ForkProvenance | null; + /** Content-activity recency, RFC3339 (tdd SS2.4, ADR 31983 D5). **Additive-optional**: omitted when no content record exists. Never advanced by lifecycle bookkeeping (the resume marker, re-stamps) or a fork's copied seed-replay records, and never precedes `createdAt`. */ + lastActivityAt?: string; + /** The winning metadata fold's model; `null` when that record omits it. */ + modelId: string | null; + /** The durable allocated session name (tdd SS2.4/SS2.14.1, #27598; ADR 27598 D2/D4). **Additive-optional**: present when the serving path holds an allocated name, omitted otherwise — absent is never fabricated. Authoritative and renameable via `session/rename`. */ + name?: string; + /** Absolute path of the session's durable log; non-nullable. Under the ephemeral session profile it is the **empty string**, meaning "no durable log exists" (tdd SS2.13.2) — the one value a client must not hand to a filesystem call. */ + path: string; + /** The winning metadata fold's provider; `null` when that record omits it. */ + providerId: string | null; + /** The session identity. */ + sessionId: string; + /** Load state as this host knows it; `session/list` reports `notLoaded` for sessions loaded by *other* hosts (tdd SS2.4). */ + status: SessionStatus; + /** Derived display title (tdd SS2.14.1, #27598): a heuristic that may evolve — its carriage, not its derivation, is the contract. **Additive-optional**, omitted when underivable. */ + title?: string; + /** Completed-turn count from the session view fold (tdd SS2.4). */ + turnCount: number; + /** RFC3339; never precedes `createdAt` (tdd SS2.4). */ + updatedAt: string; + /** The winning metadata fold's workspace root; `null` when that record omits it — absent is never fabricated (tdd SS2.4). */ + workspaceRoot: string | null; +} + +/** `session/approvalModeChanged` params (tdd SS5.12): the fold of the durable approval-mode reconfigure audit fact — every accepted change writes one; a mode flip without an audit fact is a runtime bug by design. */ +export interface SessionApprovalModeChangedParams { + /** The requesting client's `clientInfo.name` (tdd SS1.4.1), recorded on the audit fact. */ + clientName: string; + /** The command that changed it. */ + commandId: string; + /** The mode now in effect. */ + mode: ApprovalMode; + /** The owning session. */ + sessionId: string; + /** How the mode took effect. */ + source: ApprovalModeSource; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `session/branchChanged` params (tdd SS4.6.4): a durable workspace-branch observation landed. */ +export interface SessionBranchChangedParams { + /** The observed branch; `null` on a detached-HEAD observation — a fact, not "unchanged" (tdd SS4.6.4). */ + branch?: string; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** The detected version-control system; absent when no repository was detected. */ + vcs?: Vcs; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; + /** The observed workspace root. */ + workspaceRoot: string; +} + +/** `session/closed` params (tdd SS2.6.2; enrolled by #33065): a loaded session was unloaded from this host, broadcast to every initialized connection. After it, the session is `notLoaded`; the log remains on disk and `session/resume` reloads it. A crash emits nothing — only the two orderly unload paths do, and both write the durable `SessionEnd` record first. */ +export interface SessionClosedParams { + /** Which orderly unload path fired. */ + reason: SessionClosedReason; + /** The unloaded session. */ + sessionId: string; + /** The final view head; a client that stores it can later `session/resume {cursor}` and receive exactly the (empty) suffix. An **opaque** view cursor: clients relay it, never parse it (tdd SS4.1). **Required-nullable**: the producers always write the member and write `null` when the final fold failed at unload (`session/idle.rs`, `serve/shutdown.rs`; PR #16779 review) — the host defines no cursor values of its own and never invents one, and the subscriber still learns the session closed. */ + viewCursor: string | null; +} + +/** The SS2.6.2 closed-reason vocabulary. Server-produced and published OPEN by owner ruling — the #33065 menu-B pick (PR #33201 comment 5638727249, recorded in the enrollment decision record), which settles that this notification reason enum publishes open rather than resting on E2's result-vocabulary rule by analogy. A crash is deliberately not a reason, because a crash emits no notification at all. */ +export type SessionClosedReason = "idle" | "hostShutdown" | (string & {}); + +/** `session/compact` params (tdd SS3.7): manually compact the session's conversation context — the `/compact` gesture. Compaction runs asynchronously; the ack is admission only. */ +export interface SessionCompactParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The run whose context to compact. Omit and the server resolves the session's current/latest run; a session with no resolvable run rejects with `commandRejected` reason `missing_run` (tdd SS3.7). Any syntactically valid UUID: a turn from an older session may carry a v4 or v5 id. A malformed id is `invalidParams`. */ + turnId?: string; +} + +/** `session/compact` result (tdd SS3.7). Failures *after* admission (`summarizer_failed`, `install_rejected`, `cancelled`) are not wire errors — they arrive as the compaction's terminal view event. */ +export interface SessionCompactResult { + /** Echoes the client's id. */ + commandId: string; + /** Why the command was a noop, e.g. `no_compactable_history`. Present on a `noop` status (tdd SS3.7). */ + reason?: string; + /** Admission status, or `noop`. */ + status: CompactStatus; +} + +/** The open configuration extension object shared by `session/start` and `session/resume` (ADR 32760 D1). Unknown keys are ignored on the wire, never rejected (tdd SS1.5.4, spec 206 INV-015; D-052 resolving [#23456](https://github.com/mslsrc/tbh/issues/23456)): the live decoder is D-042's tolerant path, and TEST-024 keeps every exported bundle free of `additionalProperties: false`. The Rust typed model's `deny_unknown_fields` is internal and never exported — the #22785 E6b closedness export applies nowhere, and the `x-msp-closed` opt-in mechanism stays inert. Recognized `mcpServers` values are typed and validated before they leave the wire boundary. */ +export interface SessionConfig { + /** Native MCP servers added only to this session runtime. */ + mcpServers?: Record; +} + +/** `session/contextUsage` params (tdd SS4.6.6, #14405): context-window pressure — the counted-once occupancy at the latest provider-reported durable fact, joined with the host's pressure basis. Replace wholesale; emitted only when the `(windowTokens, usedTokens, pressure)` triple changes value (identical adoptions emit nothing). */ +export interface SessionContextUsageParams { + /** Server-computed pressure level over the basis thresholds. */ + pressure: ContextPressureLevel; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Counted-once prompt tokens (#8803) plus output tokens of the driving record, saturating — the honest occupancy floor. */ + usedTokens: number; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; + /** The effective context-window size from the host's pressure basis; absent when the basis has no limit — the limit part is omitted, never invented (tdd SS4.6.6). */ + windowTokens?: number; +} + +/** The persisted deletion terminal, separate from admission (SS3.24). The shared schema is one object. Actual failed producers send both optional fields; completed producers omit both. Clients enforce those obligations before interpreting a known outcome. Preserve unknown strings without treating them as successful completion. */ +export interface SessionDeleteCompletedParams { + /** Idempotency key of the original deletion command. */ + commandId: string; + /** Deletion result; an unknown value leaves the command pending. */ + outcome: SessionDeleteOutcome; + /** Erasure evidence for a failed result; omitted for a completed result. */ + physicalChange?: SessionDeletePhysicalChange; + /** Required for a failed result and omitted for a completed result. */ + reason?: SessionDeleteFailureReason; + /** Session named by the original deletion command. */ + sessionId: string; +} + +/** Stable deletion-failure vocabulary known to this version (SS3.24). The server emits only these values. Future reason strings remain an open result vocabulary; consumers cannot infer completion from any reason. */ +export type SessionDeleteFailureReason = + | "ownershipUnavailable" + | "sharedSource" + | "writerBusy" + | "unsafeSource" + | "sourceChanged" + | "quiescenceFailed" + | "cancelled" + | "storageFailure" + | "cleanupIncomplete" + | "unsupportedLayout" + | (string & {}); + +/** Known terminal outcomes. A future outcome cannot authorize success or exit. */ +export type SessionDeleteOutcome = "completed" | "failed" | (string & {}); + +/** `session/delete` params. The host validates a non-nil legacy-valid UUID target and a UUID-v7 command identity before admission. Unknown members are ignored and do not enter the normalized command identity (SS1.5.4). */ +export interface SessionDeleteParams { + /** UUID-v7 idempotency key for this deletion command. */ + commandId: string; + /** Non-nil UUID of the session selected for deletion. */ + sessionId: string; +} + +/** The failed attempt's immutable snapshot of persisted physical evidence. `possible` is recorded before a detach/unlink, `confirmed` after a proved owned effect. A failure never resets that evidence merely because the session path is absent. Unknown strings remain representable; consumers must treat them conservatively as `possible`. */ +export type SessionDeletePhysicalChange = "none" | "possible" | "confirmed" | (string & {}); + +/** Whether this host writes its sessions to disk (SS1.4.1, SS2.13). A property of the host process, fixed at construction and identical for every session and every connection it serves — never requested, granted, or negotiated, which is why it is not a capability. Open: the unrepresented degraded state (#14401) has candidate resolutions that add a third value here, so closed would make that a breaking change. */ +export type SessionDurability = "durable" | "ephemeral" | (string & {}); + +/** `session/fork` params (tdd SS2.5.3). */ +export interface SessionForkParams { + /** The SS2.5 idempotency handle (UUIDv7). */ + commandId: string; + /** Copy history through a completed turn, inclusive. Omitted means "all completed turns" (tdd SS2.5.3). */ + cutPoint?: ForkCutPoint; + /** Skip inline history in the result and page it later — same as `session/resume` (tdd SS2.5.3). */ + excludeItems?: boolean; + /** The source session. */ + sessionId: string; +} + +/** `session/fork` result (tdd SS2.5.3): the `session/resume` envelope for the **new** session, whose `session.forkedFrom` carries the provenance. */ +export interface SessionForkResult { + /** The served history. */ + history: SessionHistory; + /** The late-joiner pointer set. */ + pendingRequests: PendingRequestPointer[]; + /** The new fork session, carrying `forkedFrom` provenance. */ + session: Session; + /** The new session's view head. */ + viewCursor: string; +} + +/** `session/goalChanged` params (tdd SS4.6.2): the projected goal block's value changed — identical adoptions emit nothing (the change gate), and an explicit `null` clears. Replace wholesale; `null` never means unchanged. */ +export interface SessionGoalChangedParams { + /** The full current goal block, or `null` to clear. */ + goal?: Goal; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** The `history` envelope shared by `session/resume`, `session/fork`, and `session/read` (tdd SS2.5.2). */ +export interface SessionHistory { + /** The full folded item array when `mode` is `inline`; `null` otherwise. */ + items: Item[] | null; + /** What was actually served — never what was asked for (tdd SS2.5.2). */ + mode: HistoryMode; + /** Why no history was served — sent exactly when `mode` is `"none"` (tdd SS2.5.2; D-050, spec 208 INV-19734-1). */ + noneReason?: HistoryNoneReason; + /** The folded view state when `mode` is `snapshot` or `anchoredSnapshot`; `null` otherwise. */ + snapshot: ViewSnapshot | null; +} + +/** `session/listChanged` params (#33084, ADR 33084 D3): one changed row of the `session/list` shape — the full SS2.4 Session object as the answering host's list face serves it at emission (the ADR 29243 live-overlaid row), a replace, never a delta. Emitted only on connections that negotiated the `sessionListStream` capability at `initialize` (ADR 33084 D2); row birth stays on `session/started`, unload pairs with `session/closed`. */ +export interface SessionListChangedParams { + /** The served list row for the changed session. */ + session: Session; +} + +/** `session/list` params (tdd SS2.5.4). Read-only; never touches leases. */ +export interface SessionListParams { + /** Opaque page cursor from a prior result. Page cursors are a distinct opaque-string family from view cursors and stream cursors, valid only for re-issuing the same listing (tdd SS2.5.4). Omitted and explicit `null` both mean "first page" (#23468). */ + cursor?: string | null; + /** Page size; default 50, max 200 — the cap is published under #22785 E6c (owner-ruled 2026-08-26). Maximum 200. */ + limit?: number; + /** Only sessions with log activity after this RFC3339 instant. */ + updatedAfter?: string; + /** Only sessions whose metadata workspace root equals this path. */ + workspaceRoot?: string; +} + +/** `session/list` result (tdd SS2.5.4). Ordering is `updatedAt` descending. */ +export interface SessionListResult { + /** The next page's cursor; `null` on the last page. */ + nextCursor: string | null; + /** The page of stored sessions. */ + sessions: Session[]; +} + +/** One native MCP server supplied at session construction (ADR 32760 D1). **Closed union** (#33295 owner ruling A1, extending D-033/D-050 to `oneOf`): a validator MUST reject an undeclared `transport` arm — the server fails `session/start` decode on an unknown transport, and a future transport arrives as an explicit schema addition. */ +export type SessionMcpServerConfig = + | { + /** Ordered child arguments. */ args?: string[]; + /** Executable name or path. Configuration diagnostics never echo it. */ command: string; + /** Explicit child environment additions. */ env?: Record; + /** Stdio framing mode; defaults to automatic detection. */ framing?: SessionMcpStdioFraming; + /** Required/optional startup posture; defaults to required. */ mode?: SessionMcpServerMode; + transport: "stdio"; + } + | { + /** Explicit request headers. */ headers?: Record; + /** Required/optional startup posture; defaults to required. */ mode?: SessionMcpServerMode; + transport: "streamableHttp"; + /** HTTP(S) endpoint. Configuration diagnostics never echo it. */ url: string; + }; + +/** Startup failure posture for a session MCP server. */ +export type SessionMcpServerMode = "required" | "optional"; + +/** Stdio framing choices exposed by session MCP configuration. */ +export type SessionMcpStdioFraming = "auto" | "contentLength" | "lineDelimitedJson"; + +/** `session/modelChanged` params (tdd SS4.6.1): a durable model-selection record landed (tdd SS3.8). */ +export interface SessionModelChangedParams { + /** The selected model. */ + modelId: string; + /** The selected provider; `null` when the selection names none. */ + providerId?: string; + /** The owning session. */ + sessionId: string; + /** What drove the selection. */ + source: ModelChangeSource; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `session/modelRouteUnserved` params (#25603, ADR 25603 D1, spec 5469 Amendment 16): an accepted `login.credential_update` installed a provider that cannot serve the session's STANDING model route. Disclosure only — the standing selection is unchanged (no `session/modelChanged` fires) and the repair path is a routable `session/setModel`. Folded from the durable `runtime.provider_reconfigure.standing_route_unserved` record; additive — clients that predate it skip the unknown method. */ +export interface SessionModelRouteUnservedParams { + /** The command whose accepted swap installed the provider. */ + commandId: string; + /** The provider id the swap installed. */ + installedProviderId: string; + /** The standing (still bound, now unroutable) model. */ + modelId: string; + /** The standing model's provider; `null` when the selection names none. */ + providerId?: string; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `session/nameChanged` params (tdd SS4.6.7, #27598): the fold of ANY durable session-name record — the FIRST-NAMING automatic allocate as well as an accepted `session/rename` (or the same in-process runtime command). Replace-wholesale like every SS4.6 sibling. */ +export interface SessionNameChangedParams { + /** The new canonical name now in effect. */ + name: string; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `session/read` params (tdd SS2.5.5): read one stored session **without attaching** — no writer lease, no load, no subscription, no `SessionResumed` record. */ +export interface SessionReadParams { + /** Metadata-only unless you ask: `false` carries the folded item history. Same name and polarity as `session/resume`/`session/fork`; only the default differs — here it is `true` (tdd SS2.5.5). */ + excludeItems?: boolean; + /** The session to read. */ + sessionId: string; +} + +/** `session/read` result (tdd SS2.5.5). The `viewCursor` is the fold head at read time — a point-in-time read, immediately stale if a foreign host is appending. */ +export interface SessionReadResult { + /** The served history. */ + history: SessionHistory; + /** The same pointer shape as `session/resume`. Because `session/read` never subscribes this is a point-in-time log read only: no requests are re-issued after it (tdd SS2.5.5). */ + pendingRequests: PendingRequestPointer[]; + /** The session as folded point-in-time. */ + session: Session; + /** The fold head at read time. */ + viewCursor: string; +} + +/** `session/reasoningEffortChanged` params (tdd SS4.6.9, ADR 31255 D1): a durable reasoning-effort reconfigure record landed (tdd SS3.21). Replace wholesale, latest wins; the snapshot carries the latest value (SS4.9.1). */ +export interface SessionReasoningEffortChangedParams { + /** The new session default: the closed eight-string tier vocabulary of tdd SS3.2, spelled identically. */ + reasoningEffort: ReasoningEffort; + /** The owning session. */ + sessionId: string; + /** What drove the change. */ + source: ReasoningEffortChangeSource; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `session/rename` params (tdd SS2.14.2, #27598): set or change the durable allocated session name through the runtime `session_name` command. One writer; withheld under the ephemeral profile. */ +export interface SessionRenameParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The requested name; the runtime's normalization and validation apply. */ + name: string; + /** The target session. */ + sessionId: string; +} + +/** `session/rename` result (tdd SS2.14.2, #27598): `name` is the canonical (normalized) name the durable record settled. */ +export interface SessionRenameResult { + /** Echoes the client's id. */ + commandId: string; + /** The settled canonical name. Omitted on the `RecoveryPending` arm, which answers `{commandId, status: "accepted"}` and delivers the name via `session/nameChanged` / `Session.name` (tdd SS2.14.2). */ + name?: string; + /** Admission status. */ + status: CommandStatus; +} + +/** `session/resume` params (tdd SS2.5.2). */ +export interface SessionResumeParams { + /** The SS2.5 idempotency handle (UUIDv7). A resume that loads a session writes a durable `SessionResumed` record. */ + commandId: string; + /** The same open construction-time extension object as `session/start`. */ + config?: SessionConfig; + /** A view cursor previously observed by this client — or an observed `summarizedThrough` compaction anchor (tdd SS4.5.10, D-029). When present the server returns only the suffix and `history.mode` is `none` (tdd SS2.5.2). Omitted and explicit `null` both mean "no cursor" (#23468). */ + cursor?: string | null; + /** Return only session metadata and live resume state; page history separately with `view/page`. Default `false` (tdd SS2.5.2). */ + excludeItems?: boolean; + /** History mode preference, default `auto`. A PREFERENCE, not a budget override: when the requested mode does not fit the history budget the server downgrades it and `history.mode` reports what was actually served (tdd SS2.5.2). Ignored when `cursor` or `excludeItems` makes it moot. */ + history?: HistoryPreference; + /** The session to load. */ + sessionId: string; +} + +/** `session/resume` result (tdd SS2.5.2). */ +export interface SessionResumeResult { + /** The served history. */ + history: SessionHistory; + /** The late-joiner pointer set; empty when nothing is pending. */ + pendingRequests: PendingRequestPointer[]; + /** The loaded session. */ + session: Session; + /** The session view head; the connection is subscribed after it. A still-loaded session a prior `view/unsubscribe` detached is RE-ATTACHED by this resume (spec 208 FR-002a, #28920): live delivery resumes from this head. Explicit-cursor re-attach with `(after, head]` engine replay stays `view/subscribe` (SS4.7.1). */ + viewCursor: string; +} + +/** `session/setApprovalMode` params (tdd SS5.12): switch the session's approval enforcement mode mid-session. A standard SS3 command. **Select, never create.** A client may *select* a mode the host's configuration already defines; it may not construct one, supply inline rules, or otherwise describe a policy on the wire — which is why [`ApprovalMode`] is closed. */ +export interface SessionSetApprovalModeParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The preconfigured mode to select. The requesting actor is recorded from the connection's `clientInfo.name` (tdd SS1.4.1). */ + mode: ApprovalMode; + /** The target session. */ + sessionId: string; +} + +/** `session/setApprovalMode` result (tdd SS5.12). Applies next-action — an in-flight tool action's pending approval is not retroactively decided by a mode change. */ +export interface SessionSetApprovalModeResult { + /** Whether the change did anything. */ + applyOutcome: ApprovalModeApplyOutcome; + /** Echoes the client's id. */ + commandId: string; + /** The folded effective-mode projection — the same object the `Session` carries as `approvalMode` (tdd SS2.4, SS5.12). */ + effectiveMode: EffectiveApprovalModeState; + /** Admission status. */ + status: CommandStatus; +} + +/** `session/setModel` params (tdd SS3.8): the model-picker gesture. The selection is durable and applies to subsequent model calls. */ +export interface SessionSetModelParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The selection. */ + model: ModelSelection; + /** The target session. */ + sessionId: string; +} + +/** `session/setModel` result (tdd SS3.8). If a turn is running the selection is admitted now and applied at the next model-call boundary; the ack does not wait for that boundary. */ +export interface SessionSetModelResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; +} + +/** `session/setReasoningEffort` params (tdd SS3.21, ADR 31255 D1): set the session's standing reasoning-effort default. A turn carrying its own `reasoningEffort` overrides it for that turn only; the default overrides the host's configured default. Same accept/reject and `commandId` idempotency shape as `session/setModel` (SS3.8). */ +export interface SessionSetReasoningEffortParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The new session default: the closed eight-string tier vocabulary `turn/start` carries (SS3.2), spelled identically. Invalid tiers are invalid params. A default of `max` rides provider requests verbatim, never clamped (ADR 28621 D8, ADR 31131 D1). */ + reasoningEffort: ReasoningEffort; + /** The target session. */ + sessionId: string; +} + +/** `session/setReasoningEffort` result (tdd SS3.21). The default is durable on ack and applies to turns launched after admission; a running turn keeps the request options it already resolved. */ +export interface SessionSetReasoningEffortResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; +} + +/** `session/start` params (tdd SS2.5.1). */ +export interface SessionStartParams { + /** The session's starting approval mode; server default when omitted or explicit `null` — both spellings select the default (#23468). Select, never create — the value names a mode the host's configuration already defines (tdd SS2.5.1, SS5.12). This is the only surface that declares a non-interactive run's policy (tdd SS5.11, D-008). */ + approvalMode?: ApprovalMode | null; + /** The SS2.5 idempotency handle (UUIDv7). Required; the server never mints one. */ + commandId: string; + /** Reserved for per-session overrides owned by a future Configuration section. Issue #32760 admits only its `mcpServers` member. */ + config?: SessionConfig; + /** Initial model; server default when omitted. */ + modelId?: string; + /** Initial provider routing; server default when omitted or explicit `null` — both spellings select the default (#23468). */ + providerId?: string | null; + /** Exact identity for this new root session. When omitted the server mints a UUIDv7. This field never selects an existing session: a retained or reserved id is rejected `commandRejected` with reason `session_id_conflict` (tdd SS2.5.1). */ + sessionId?: string; + /** Absolute path, folded into the first metadata record. */ + workspaceRoot?: string; + /** The session's initial runtime workspace-root set: ordered absolute canonical existing directory paths; the first root is the CWD and plays the primary-root role; every root receives the ADR 11237 `:workspace_roots` rules; extra roots grant no Project Trust. When `workspaceRoot` is also present the two must name the same folder, compared on canonical forms (the raw `workspaceRoot` is canonicalized first; ADR 37313 D9), or the request is invalid params, and so is explicit `null` (the D-049 null-tolerant set is closed and excludes this member). Omitted preserves single-root behavior (tdd SS2.5.1, ADR 37313, #37313). */ + workspaceRoots?: string[]; +} + +/** `session/start` result (tdd SS2.5.1). */ +export interface SessionStartResult { + /** The new session. */ + session: Session; + /** The session view head after the start fold; the connection is subscribed and receives every view event after this cursor. A deduplicated retry returns this same result (tdd SS2.5.1). */ + viewCursor: string; +} + +/** `session/started` params (tdd SS2.6.1; enrolled by #33065): a session became newly loaded on this host via `session/start` or `session/fork` (never `session/resume` — Appendix C, OQ-F), broadcast to every initialized connection. The one member is the same `$defs/Session` object the `session/start`/`session/fork` results carry, so the broadcast and the result describe one fact through one type — the host builds the broadcast payload as a `$defs/Session` — the fresh-start arm reuses the result's `session` member, the start-replay arm builds the live attach snapshot — and the emission is parity-gated against this type at the producer (`session-server` prod-assembly capture) and over the committed transcript corpus (conformance `session_lifecycle_enrollment`). */ +export interface SessionStartedParams { + /** The newly loaded session, as of the start/fork fold. */ + session: Session; +} + +/** A session's load state (tdd SS2.4). */ +export type SessionStatus = "notLoaded" | "idle" | "running" | (string & {}); + +/** `session/statusChanged` params (tdd SS4.6.10, ADR 31983 D2): a loaded session's projected `(status, attention)` value flipped. A command-plane broadcast — delivered to every connection regardless of its view subscription set, never gated, no `sourceRange`; the same facts live on the Session object, which is how a client seeds its table (no initial burst on connect). */ +export interface SessionStatusChangedParams { + /** Attention flags after the transition; present only when at least one flag is set (tdd SS2.4, ADR 31983 D3). */ + attention?: AttentionFlag[]; + /** The owning session. */ + sessionId: string; + /** Load state after the transition (the closed SS2.4 enum, unchanged). */ + status: SessionStatus; + /** The causing record's view cursor (ADR 31983 D4). Required-nullable: `null` exactly when the paired `session/closed`'s cursor is `null` (the unload fold-failure arm); a definite cursor everywhere else. */ + viewCursor: string | null; +} + +/** `session/todoListChanged` params (tdd SS4.6.3): a `TodoSnapshotUpdated` record landed. Replace the whole list on every event; an empty `items` array is a cleared list, not a no-op. */ +export interface SessionTodoListChangedParams { + /** The full todo list, replaced wholesale. */ + items: TodoItem[]; + /** The snapshot revision. Diagnostics only, never an ordering guard — `viewCursor` orders (tdd SS4.6.3). */ + revision: number; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** The tool that produced the snapshot, verbatim. */ + sourceTool: string; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `session/tokenUsage` params (tdd SS4.6.5): one per model completion that reports usage. Carries the raw counters verbatim plus the server-derived counted-once `promptTokens`/`totalTokens` (#8803: clients display and sum these and never re-derive the provider's cache convention) and the session `cumulative` block. Accumulate-only: `cumulative` never goes backward. */ +export interface SessionTokenUsageParams { + /** Session running totals at this cursor; the fold owns the accumulation. Subagent/workflow-child usage is never folded in — it rides the owning items (tdd SS4.6.5). */ + cumulative: CumulativeTokenUsage; + /** Model-call wall time, when measured. */ + durationMs?: number; + /** Provider finish reason when reported (open vocabulary, verbatim). */ + finishReason?: string; + /** The effective model that produced this usage; `null` on pre-schema records — never back-filled, an unpriced leg (tdd SS4.6.5). */ + modelId?: string; + /** Prompt tokens counted exactly once under the provider's cache convention (#8803). Server-derived; deterministic — the provider is in the log. */ + promptTokens: number; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** `promptTokens + outputTokens` — the honest per-completion total. */ + totalTokens: number; + /** The turn whose model call completed. */ + turnId: string; + /** Raw counters verbatim from the durable record. */ + usage: TokenUsage; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `session/userShell` params (tdd SS3.9): run a user-initiated shell command in the session's workspace — the TUI's `!` escape hatch. **Capability-gated**: the connection must negotiate `userShell` at `initialize`, and the whole justification is the SS1.10 spawn boundary. */ +export interface SessionUserShellParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The shell command to run. */ + commandText: string; + /** The target session. */ + sessionId: string; +} + +/** `session/userShell` result (tdd SS3.9): immediate. The shell runs off the command worker so a long command cannot stall the command plane; the output arrives as the `userShell` item's terminal view event. */ +export interface SessionUserShellResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; +} + +/** The view-health state (tdd SS2.5.2 companion). Open enum (`x-msp-openness: open`): a client MUST ignore an unrecognized value. v1 emits only `Unavailable`; openness itself reserves additive room for a future re-arm (ADR 32557 D1 names it `healthy`) and for the #14401 durable-degraded axis, so no never-emitted token is baked onto the stable surface now. */ +export type SessionViewHealth = "unavailable" | (string & {}); + +/** `session/viewHealthChanged` params (ADR 32557; #32557): the named session's live view stream became unavailable, and why. Best-effort: ordered after already-queued view frames and may be dropped (for example when the connection is closing), so a client MUST NOT assume a guaranteed push and still reads `history.noneReason` on its next resume/read (FM-005). */ +export interface SessionViewHealthChangedParams { + /** The new view-health state. In v1 the host emits only `Unavailable`. */ + health: SessionViewHealth; + /** Why the view is unavailable — the SAME typed `HistoryNoneReason` vocabulary the pull path stamps on `history.noneReason` (tdd SS2.5.2, D-050), so a client reuses one handler for push and pull. `projectionUnavailable` in v1; present only when `health` is `Unavailable`. Open on the client side: an unknown reason decodes conservatively and renders generically. */ + noneReason?: HistoryNoneReason; + /** The session whose live view health changed. */ + sessionId: string; +} + +/** One typed-invocable shortcut spelling (tdd SS3.22.1). A plugin skill may contribute two rows: its bare-name winner and its qualified `:` form. */ +export interface SkillCatalogEntry { + /** Present when the skill declares an argument hint. */ + argumentHint?: string; + /** The skill's palette summary. */ + description: string; + /** The skill display name the first-party palette shows. */ + displayName: string; + /** The owning plugin's identifier; present when `source` is `plugin`. */ + pluginId?: string; + /** The shortcut token without the leading slash — bare (`fix-bug`) or plugin-qualified (`acme:deploy`) — the exact value a `skill` input part submits. Unique within one response. */ + selector: string; + /** Where the skill comes from. */ + source: SkillSource; +} + +/** `skill/changed` params (tdd SS3.22.2): the session's user-invocable set changed; clients re-issue `skill/list`. Advisory — the host may coalesce bursts and guarantees no ordering relative to view events (ADR 32471 D3). */ +export interface SkillChangedParams { + /** The session whose set changed. */ + sessionId: string; +} + +/** `skill/list` params (tdd SS3.22.1). Per-session because skill scope follows the session's workspace and plugin state. */ +export interface SkillListParams { + /** The target session. */ + sessionId: string; +} + +/** `skill/list` result (tdd SS3.22.1): one row per typed-invocable shortcut spelling — exactly the invocations the first-party typed dispatch accepts (spec 11352 INV-007 predicate and the shared shortcut layer's name resolution, both by call-through; ADR 32471 D2). */ +export interface SkillListResult { + /** The session's user-invocable skill rows. */ + skills: SkillCatalogEntry[]; +} + +/** A skill row's source scope (tdd SS3.22.1): the projection of the skills crate's `SkillsSourceScope`. Open (server-produced result vocabulary, the #22785 enum-openness rule): a future scope value is additive. */ +export type SkillSource = "bundled" | "user" | "project" | "plugin" | (string & {}); + +/** The compaction boundary an anchored snapshot is anchored at (tdd SS2.5.2). */ +export interface SnapshotAnchor { + /** The view cursor of the boundary's `compaction` event. */ + boundaryCursor: string; + /** The boundary's opaque compaction anchor (tdd SS4.5.10). */ + summarizedThrough: string; +} + +/** The complete folded view at the snapshot cursor (tdd SS4.9.1). Additive-optional evolution applies exactly as everywhere else; unknown members MUST be ignored, and preserved if re-serialized. **One served site does not satisfy this type today, escalated under #22785 (E8).** The genesis snapshot rung serves `state: {"items": [...]}` alone (`tbh-session-view-serve`'s `materialized_fold.rs`, the `select_genesis_history` call), while the anchored rung serves the full folded state. A schema-validating client resuming with `{"history": "snapshot"}` against the real fold therefore sees the other required members missing. The fix is a serving change in the #208/#14653 lane (serialize the `SessionViewState` the genesis path already folds, as the anchored path does) plus its own RED against the real fold; it is not a shape change here, because SS4.9.1 ratifies this shape. */ +export interface SnapshotState { + /** The running foreground turn; `null` when none is running. */ + activeTurn: TurnRef | null; + /** The effective approval mode at this cursor — the same object the `Session` carries (tdd SS2.4, SS5.12). */ + approvalMode: EffectiveApprovalModeState; + /** Latest branch observation; `null` when no fact has landed. */ + branch: BranchState | null; + /** The latest `(windowTokens, usedTokens, pressure)` triple. SS4.9.1 says "`null`/absent" and SS4.9.2's worked example OMITS the member; the binary omits it too, so this is the absent arm — the four siblings above are present-null in the same frame. INV-017 admits one or the other, never both; escalated under #22785. */ + contextUsage?: ContextUsage; + /** Latest effective model; `null` when no fact has landed. */ + effectiveModel: EffectiveModel | null; + /** Latest goal block; `null` when no fact has landed. */ + goal: Goal | null; + /** Every item, in first-opened order, each at its latest revision at the snapshot cursor. One schema per kind, shared with the notification item object — which is what makes snapshot+suffix a pure splice (tdd SS4.9.1). */ + items: Item[]; + /** The settled canonical session name; `null` when the session was never named (#27598, tdd SS4.9.1 / SS2.14). Folds the same durable `session/nameChanged` record `Session.name` reports. */ + name?: string; + /** The pending-approval half of the pending set. */ + pendingApprovals: PendingApprovalPointer[]; + /** The pending-user-input half of the pending set. */ + pendingUserInputs: PendingUserInputPointer[]; + /** Admitted-but-not-launched submits, in launch order (tdd SS3.1.4). */ + queuedTurns: TurnRef[]; + /** The latest session-default reasoning effort with its source; ABSENT until a set lands (tdd SS4.9.1 `reasoningEffort`, ADR 31255 D1 — the `contextUsage` absent arm, never present-null). */ + reasoningEffort?: ReasoningEffortState; + /** Latest todo list; `null` when no fact has landed. */ + todoList: TodoListState | null; + /** The `cumulative` block of the last `session/tokenUsage` event; zeroes when none (tdd SS4.9.1). */ + tokenUsage: CumulativeTokenUsage; + /** Completed-turn count at this cursor. */ + turnCount: number; +} + +/** The inclusive raw-record range a durable-sourced view event folded from (tdd SS4.2) — the reconciliation token: re-folding the cited records from the canonical fold state immediately before `first` — appended host-death terminals seed from the end-of-records state — reproduces the event (tdd SS7.5; spec 14653 T041/INV-009). In v1 it is an **opaque provenance token**: no wire method reads what it points at (the SS6 raw-log altitude is deferred, #13929). Ephemeral-sourced events (`item/delta`, and an `item/started` that opens on an ephemeral record) carry no `sourceRange` — ephemeral records may be evicted by retention (tdd SS4.2; spec 14653 INV-009). */ +export interface SourceRange { + /** The first record of the inclusive range. */ + first: RecordPosition; + /** The last record of the inclusive range; equal to `first` for an event folded from one record. */ + last: RecordPosition; + /** The stream the folded records live on (run stream, or the session stream's mirror of task/approval/subagent-control records — whichever the fold actually consumed, tdd SS4.2). */ + stream: StreamRef; +} + +/** One raw stream named by a [`SourceRange`] (tdd SS4.2). */ +export interface StreamRef { + /** The stream id. */ + id: string; + /** The stream kind, verbatim raw-log vocabulary (e.g. `"run"`, `"session"`). A free string, not an enum: `sourceRange` is an opaque provenance token in v1 and the raw stream vocabulary is the deferred SS6 altitude's to freeze (#13929). */ + kind: string; +} + +/** Subagent control status (tdd SS4.5.7, camelCased `SubagentControlStatus`). Open; the generic item `status` is the terminal authority. */ +export type SubagentControlStatus = + | "accepted" + | "starting" + | "running" + | "resultReady" + | "closing" + | "closed" + | "recoveryPending" + | "manualReconciliation" + | (string & {}); + +/** Params for `subagent/sendMessage` and `subagent/followupTask` (SS3.16): a child target plus the input body. */ +export interface SubagentInputParams { + /** The note/task text: trimmed with Unicode-whitespace semantics, rejected when empty after trimming, delivered trimmed with multibyte content byte-for-byte intact (SS3.16). */ + body: string; + /** Client-minted UUIDv7 command id (SS3.1.1). */ + commandId: string; + /** Target session (UUIDv7 string; SS3 preamble). */ + sessionId: string; + /** Durable child id (the SS4.5.7 item's `subagentId`; opaque string). */ + subagentId: string; +} + +/** Params for `subagent/interrupt`, `subagent/stop`, and `subagent/close` (SS3.16): a child target plus an optional human-readable reason that is preserved on the durable effect record. */ +export interface SubagentOwnerReasonParams { + /** Client-minted UUIDv7 command id (SS3.1.1). */ + commandId: string; + /** Optional reason, preserved on the durable owner-command record. */ + reason?: string; + /** Target session (UUIDv7 string; SS3 preamble). */ + sessionId: string; + /** Durable child id (the SS4.5.7 item's `subagentId`; opaque string). */ + subagentId: string; +} + +/** A subagent's result envelope (tdd SS4.5.7, `SubagentResultEnvelope`). */ +export interface SubagentResult { + /** Artifact references, verbatim. */ + artifactRefs: string[]; + /** Error kind, verbatim durable vocabulary, when the child failed. */ + errorKind?: string; + /** Evidence references, verbatim. */ + evidenceRefs: string[]; + /** Structured result data, verbatim, when present. */ + structuredData?: Record; + /** Bounded result summary (<=512 chars, runtime-enforced). */ + summary: string; + /** Result text (<=32 KiB), when present. */ + text?: string; +} + +/** Params for `subagent/resume`, `subagent/reopen`, and `subagent/readResult` (SS3.16): the bare child target. */ +export interface SubagentTargetParams { + /** Client-minted UUIDv7 command id (SS3.1.1). */ + commandId: string; + /** Target session (UUIDv7 string; SS3 preamble). */ + sessionId: string; + /** Durable child id (the SS4.5.7 item's `subagentId`; opaque string). */ + subagentId: string; +} + +/** The one usage payload shape: the `usage/read` result's `usage` member and the `usage/changed` params (ADR 32563 D2/D3). The numbers are point-in-time — `observedAtMs` is the host's arrival stamp, so a client renders "as of", never implies live data (spec 18742 US-FR-004). */ +export interface SubscriptionUsage { + /** When the host RECEIVED this observation (frame arrival or mint request-send), epoch milliseconds. */ + observedAtMs: number; + /** The provider's subscription tier id, verbatim. */ + tier: string; + /** The rolling weekly block. */ + weekly: SubscriptionUsageWeekly; + /** The current window. */ + window: SubscriptionUsageWindow; +} + +/** The rolling weekly block: same semantics as [`SubscriptionUsageWindow`] without a duration (ADR 32563 D2). */ +export interface SubscriptionUsageWeekly { + /** When the weekly window resets, epoch milliseconds. */ + resetsAtMs: number; + /** Percent of the weekly budget used (integer ≥ 0, may exceed 100). */ + usedPercent: number; +} + +/** The current usage window (the provider's 5-hour-class block): verbatim provider percentages with the reset stamp normalized to epoch milliseconds (ADR 32563 D2). */ +export interface SubscriptionUsageWindow { + /** When the window resets, epoch milliseconds. */ + resetsAtMs: number; + /** Percent of the window's budget used: an integer ≥ 0, verbatim from the provider — over-quota values above 100 are valid. */ + usedPercent: number; + /** The window's length in minutes (> 0). */ + windowDurationMins: number; +} + +/** A success response frame (SS1.2 §2.3). */ +export interface SuccessResponse { + /** Echo of the request id. */ + id: RequestId; + /** The literal `"2.0"`. */ + jsonrpc: JsonRpcVersion; + /** Always a JSON object, possibly `{}`, never a bare scalar — so every result can grow additive-optional members (SS1.2). */ + result: Record; +} + +/** `task/background` params (tdd §3.13): durably send a running foreground tool task to the background. */ +export interface TaskBackgroundParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The task to background, exactly as the view names it: the `toolCall` item's `itemId` IS the task id (SS4.5.5). */ + taskId: string; +} + +/** The `task/background` / `task/stop` ack (tdd §3.13/§3.14): admission-only, echoing the targeted task. */ +export interface TaskCommandResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** Echoes the targeted task id. */ + taskId: string; +} + +/** `task/stopAll` params (tdd §3.15): stop every stoppable background workload live at admission. */ +export interface TaskStopAllParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; +} + +/** The `task/stopAll` ack (tdd §3.15): always `accepted`, including over an empty set — a blanket stop over nothing is a satisfied gesture. The ack deliberately carries no stopped-task list; count the kills from the view. */ +export interface TaskStopAllResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; +} + +/** `task/stop` params (tdd §3.14): stop one named background task. Required target, never "whichever is loudest" — §3.15 is the blanket verb. */ +export interface TaskStopParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The task to stop, the `toolCall` item's `itemId` (SS4.5.5). */ + taskId: string; +} + +/** One todo entry (tdd SS4.6.3). */ +export interface TodoItem { + /** Present-tense active form, when the tool supplied one. */ + activeForm?: string; + /** The todo status (camelCased runtime `TodoStatus`). */ + status: TodoStatus; + /** The todo text. */ + text: string; +} + +/** The latest todo-list fact in the snapshot (tdd SS4.6.3, SS4.9.1). */ +export interface TodoListState { + /** The full todo list. */ + items: TodoItem[]; + /** The snapshot revision. Diagnostics only, never an ordering guard. */ + revision: number; + /** The tool that produced the snapshot, verbatim. */ + sourceTool: string; +} + +/** Todo status (tdd SS4.6.3): closed in the runtime, wire-open. */ +export type TodoStatus = "pending" | "inProgress" | "completed" | "cancelled" | (string & {}); + +/** Raw token counters, verbatim from the durable record (tdd SS4.6.5, the runtime's `Usage`, camelCased). Not directly summable across providers — sum the counted-once derivations instead (#8803). */ +export interface TokenUsage { + /** Cache read tokens, only when the provider distinguishes writes/reads. */ + cacheReadTokens?: number; + /** Cache write tokens, only when the provider distinguishes writes/reads. */ + cacheWriteTokens?: number; + /** Provider-reported cache tokens (inside or beside `inputTokens`, provider-convention-dependent — the reason `promptTokens` exists). */ + cachedTokens: number; + /** Provider-reported input tokens. */ + inputTokens: number; + /** Provider-reported output tokens. */ + outputTokens: number; + /** Output tokens spent on reasoning, when the provider reports it. */ + reasoningTokens: number; +} + +/** Optional W3C trace context, on requests in both directions only — never on responses or notifications (SS1.8). */ +export interface TraceContext { + /** W3C `traceparent` string; receivers that do not trace ignore it. */ + traceparent?: string; + /** W3C `tracestate` string. */ + tracestate?: string; +} + +/** `turn/cancel` params (tdd SS3.5): plain cancellation on the normal command lane. Same shape as `turn/interrupt`, **without** `retract` — pairing a retract with a plain cancel is durably rejected `not_paired_interrupt`. */ +export interface TurnCancelParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The exact turn to cancel; omit to target the current foreground turn. Any syntactically valid UUID: a turn from an older session may carry a v4 or v5 id. A malformed id is `invalidParams`. */ + turnId?: string; +} + +/** `turn/cancel` result (tdd SS3.5): identical envelope to `turn/interrupt`. */ +export interface TurnCancelResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** The cancelled turn. */ + turnId: string; +} + +/** `turn/completed` params (tdd SS4.5.1): the run's durable terminal record landed. */ +export interface TurnCompletedParams { + /** Turn duration; absent means unmeasured, never fabricated. */ + durationMs?: number; + /** Present iff `terminal` is `"failed"` (tdd SS4.5.1): mid-turn failures reach the client here — never as a JSON-RPC error. */ + error?: TurnError; + /** The runtime's free-text terminal reason, verbatim. Display and diagnostics only; never branch on it. */ + reason?: string; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** The turn terminal (open enum). */ + terminal: TurnTerminal; + /** Time to first token, when measured. */ + timeToFirstTokenMs?: number; + /** The terminated turn. */ + turnId: string; + /** The turn's aggregate token usage, summed across the turn's model completions (same shape as `session/tokenUsage.usage`). */ + usage?: TokenUsage; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** The settled turn-failure object (tdd SS4.5.1): `{kind, message, retryable}`. */ +export interface TurnError { + /** The failure class (open camelCase enum grounded in the runtime's terminal failure classification). */ + kind: TurnErrorKind; + /** Human-readable failure text. */ + message: string; + /** The server's judgment that resubmitting the same input may succeed. */ + retryable: boolean; +} + +/** Turn failure classes (tdd SS4.5.1, `TerminalErrorKind` plus the model-task failure class). Open. */ +export type TurnErrorKind = + | "stepLimit" + | "configError" + | "projectionError" + | "logError" + | "workflowLaunchError" + | "environmentError" + | "modelError" + | "launchError" + | "authRequired" + | (string & {}); + +/** One ordered content part of a turn submission (tdd SS3.2). File mentions are text, not a part type: write `@relative/path` in a text part. A structured `mention` part is reserved and currently rejected, and an unknown part type is `invalidParams` (tdd SS3.1.2, SS3.2) — which is what closes [`TurnInputPartType`]. Modelled as a discriminated flat object rather than a Rust `enum`, the convention [`crate::view::approval::ApprovalSubject`] already established for a wire union in this crate: the v1 schema model names no object-variant union shape and fails closed on one. The serialized JSON is the tdd shape either way; what a flat object cannot express is "`mediaType` is required exactly when `type` is `image`". **RULED (#22785 E4, owner, 2026-08-26): the precedent is accepted.** A strict union node kind may be funded later as a follow-up; if it is, it must cover [`crate::method::lifecycle::PendingRequestPointer`] too. `height` may only appear together with `width`. `width` may only appear together with `height`. */ +export interface TurnInputPart { + /** Free-text skill arguments, optional on a `skill` part — the wire twin of what the TUI accepts after the shortcut token (tdd SS3.22.3). */ + arguments?: string; + /** Base64 payload, required on an `image` part. Invalid base64 or an empty payload is rejected with invalid params. */ + base64Data?: string; + /** Pixel height; must be provided together with `width` or not at all (tdd SS3.2, #22785 E6c). */ + height?: number; + /** Media type, required on an `image` part. */ + mediaType?: string; + /** The skill to invoke, required on a `skill` part (tdd SS3.2, SS3.22.3; ADR 32471 D4): a bare or plugin-qualified shortcut token from `skill/list`. The HOST resolves and expands; an unknown selector is the typed `-32032 skillNotFound` request error. */ + selector?: string; + /** User prompt text, on a `text` part. Multiple text parts are joined in order into the turn's prompt. */ + text?: string; + /** The part type. */ + type: TurnInputPartType; + /** Pixel width; must be provided together with `height` or not at all (tdd SS3.2). Published as a `dependentRequired` pair under #22785 E6c. */ + width?: number; +} + +/** The `type` discriminator of a turn input part (tdd SS3.2). Closed: an unknown part type is `invalidParams` (tdd SS3.1.2). */ +export type TurnInputPartType = "text" | "image" | "skill"; + +/** `turn/interrupt` params (tdd SS3.4): the "user pressed stop" gesture, on the runtime's priority lane. */ +export interface TurnInterruptParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** Pair a retract intent with the interrupt: if the turn is cancelled before any assistant output committed, the submission is durably retracted (view event `turn/retracted`) so the client may restore the prompt text. A rejected retract does not undo the interrupt. Default `false` (tdd SS3.4). */ + retract?: boolean; + /** The target session. */ + sessionId: string; + /** The exact turn to interrupt. Omit to target the session's current foreground turn, resolved at admission; prefer passing the explicit id when you have one (tdd SS3.4). Any syntactically valid UUID: a turn from an older session may carry a v4 or v5 id. A malformed id is `invalidParams`. */ + turnId?: string; +} + +/** `turn/interrupt` result (tdd SS3.4). Acceptance means the interrupt was admitted, **not** that the turn is already stopped: the turn is over when you fold its `turn/completed` with terminal `cancelled`. */ +export interface TurnInterruptResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** The interrupted turn. */ + turnId: string; +} + +/** A turn named by the snapshot's active/queued lists (tdd SS4.9.1). */ +export interface TurnRef { + /** The `commandId` of the submit that minted it. */ + commandId: string; + /** The turn's id, pre-minted per tdd SS3.1.4. */ + turnId: string; +} + +/** `turn/retracted` params (tdd SS4.5.1): an interrupt-paired retract was durably accepted. The retracted user-message item is re-emitted via `item/updated` with `retracted: true`. */ +export interface TurnRetractedParams { + /** The retracted submission's command id. */ + commandId: string; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** The turn whose submission was retracted. */ + turnId: string; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `turn/retryScheduled` params (tdd SS4.5.1, spec 14412; D-026): a durable turn retry-scheduled fact folded — the failing model attempt's scheduled retry is observable BEFORE the turn terminates, so a streaming client can render "attempt N/M · retrying in Ss · reason" instead of dead air. Non-terminal: it never resolves a turn-wait (tdd SS3.1.4). The delay is the recorded scheduled backoff, never an absolute fire time — clients derive any countdown locally. `sourceRange` cites the session stream's mirror of the task-lifecycle record (tdd SS4.2). */ +export interface TurnRetryScheduledParams { + /** The attempt that failed (producer-normalized, >= 1). */ + attempt: number; + /** The turn's model-retry chain bound. */ + maxAttempts: number; + /** The attempt about to run (producer contract: attempt < nextAttempt <= maxAttempts; not a schema constraint). */ + nextAttempt: number; + /** The recorded stopping reason through the shared task-detail normalization (non-empty; capped at 160 characters). */ + reason: string; + /** The scheduled backoff delay in milliseconds, verbatim from the durable fact. */ + retryDelayMs: number; + /** The owning session. */ + sessionId: string; + /** The durable record this event folded from (the session stream's mirror of the retry-scheduled task status; `first == last`). */ + sourceRange: SourceRange; + /** The running turn whose model attempt is being retried. */ + turnId: string; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** What `turn/start` did with the input (tdd SS3.2). Resolves OQ-H in v1: since `queue` is the default `ifBusy`, clients need to distinguish these without folding history. */ +export type TurnStartDisposition = "started" | "queued" | "steered" | (string & {}); + +/** `turn/start.providerRequestOptions` is deliberately absent: **RULED (#22785 E3, owner, 2026-08-26) to stay off the published schema.** The schema is the contract, and a free-form-object node kind is revisited only if the experimental field graduates. `turn/start` params (tdd SS3.2). */ +export interface TurnStartParams { + /** The SS3.1.1 idempotency handle (UUIDv7). The fresh turn's `turnId` derives from it (tdd SS3.1.4). */ + commandId: string; + /** Presentation form of the prompt for transcripts. Durable; carried on the resulting user-message view item. Never model-visible (tdd SS3.2). */ + displayText?: string; + /** Disposition when a turn is already running; default `queue`. */ + ifBusy?: IfBusy; + /** Ordered content parts; required and non-empty. */ + input: TurnInputPart[]; + /** Reasoning tier sampled at submission for this turn. */ + reasoningEffort?: ReasoningEffort; + /** The target session. */ + sessionId: string; + /** A sticky REPLACEMENT of the session's runtime workspace-root set, binding at this turn's launch and persisting for subsequent turns until replaced again — unlike `reasoningEffort`, which is this-turn-only. Same shape and validation as `session/start.workspaceRoots`; invalid params on an explicit `ifBusy: "steer"` submit and so is explicit `null` (the D-049 null-tolerant set is closed); omitted means "unchanged", never "reset" (tdd SS3.2, ADR 37313 D3, #37313). */ + workspaceRoots?: string[]; +} + +/** `turn/start` result (tdd SS3.2). */ +export interface TurnStartResult { + /** Echoes the client's id. */ + commandId: string; + /** What happened to the input. */ + disposition: TurnStartDisposition; + /** `true` iff `disposition` is `started`; retained as the boolean shorthand — `disposition` is authoritative (tdd SS3.2). */ + startedNewTurn: boolean; + /** Admission status. */ + status: CommandStatus; + /** The turn that will carry (or absorbed) this input. Authoritative: always take it from the ack rather than deriving it (tdd SS3.2). */ + turnId: string; +} + +/** `turn/started` params (tdd SS4.5.1): a foreground turn began running — fresh submits immediately, queued submits at their launch boundary, never steered submits. */ +export interface TurnStartedParams { + /** The submitting command; `turnId == commandId` for fresh turns (tdd SS3.1.4). */ + commandId: string; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from. */ + sourceRange: SourceRange; + /** The started turn. */ + turnId: string; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** `turn/steer` params (tdd SS3.3): exact-target steering into the currently running turn. */ +export interface TurnSteerParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The turn you believe is running. Closes the race where the turn completes or is replaced between your read and your steer: input meant for turn A can never leak into turn B (tdd SS3.3). Any syntactically valid UUID: a turn from an older session may carry a v4 or v5 id. A malformed id is `invalidParams`; an id that is not the running turn is refused. */ + expectedTurnId: string; + /** Same content parts as `turn/start`. */ + input: TurnInputPart[]; + /** Reasoning tier for the model calls this steer's input reaches. Applies forward, never backward; absent means unspecified, not "reset" (tdd SS3.3, D-024). */ + reasoningEffort?: ReasoningEffort; + /** The target session. */ + sessionId: string; +} + +/** `turn/steer` result (tdd SS3.3). */ +export interface TurnSteerResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** The running turn that absorbed the input. */ + turnId: string; +} + +/** Turn terminal vocabulary (tdd SS4.5.1): exactly the runtime's `RunTerminalKind` — closed in the runtime, wire-open for evolution. */ +export type TurnTerminal = "completed" | "failed" | "cancelled" | (string & {}); + +/** `turn/unqueue` params (tdd SS3.6): reclaim a queued submit before it launches. It is **not** a stop — a reclaim that arrives after its target launched is durably rejected, never silently upgraded into a cancel. */ +export interface TurnUnqueueParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The queued turn to reclaim, exactly as the queueing `turn/start`'s ack minted it and as snapshot `queuedTurns` lists it. Required, and never "whichever is newest" (tdd SS3.6). Any syntactically valid UUID: a turn from an older session may carry a v4 or v5 id. A malformed id is `invalidParams`. */ + turnId: string; +} + +/** `turn/unqueue` result (tdd SS3.6). Admission only — but for this command admission *is* the race: an admitted reclaim implies the turn will not launch. The authoritative removal is the `turn/unqueued` view event. */ +export interface TurnUnqueueResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** The reclaimed turn. */ + turnId: string; +} + +/** `turn/unqueued` params (tdd SS3.6, SS4.5.1): a queued submit's reclaim durably won; its pre-minted turn never runs. Carries the reclaimed `turnId` and the `commandId` of the `turn/start` that queued it, so a client can restore the submission's text exactly as for `turn/retracted`. No `turn/started`/`turn/completed` is ever emitted for this `turnId` (SDK turn-waits settle on this event too, tdd SS3.1.4). `sourceRange` cites the SESSION stream's reclaim record — a reclaimed turn never had a run stream. */ +export interface TurnUnqueuedParams { + /** The `commandId` of the `turn/start` that queued the reclaimed turn. */ + commandId: string; + /** The owning session. */ + sessionId: string; + /** The durable records this event folded from (the session stream's reclaim record). */ + sourceRange: SourceRange; + /** The reclaimed turn: pre-minted at admission, never launched. */ + turnId: string; + /** Opaque, strictly monotonic view cursor (tdd SS4.1). */ + viewCursor: string; +} + +/** One element of a `view/page` result's `events` array: an **unframed view notification** exactly as tdd SS4.2.1 defines it — the nested pair `{"method", "params"}`, which is the live notification minus `jsonrpc` and `emittedAtMs`, with nothing lifted out of `params` and nothing spliced into it. SS4.2.1 is the single normative definition; SS4.7.3 and SS7.4 both cite it, so the two surfaces cannot drift. */ +export interface UnframedViewNotification { + /** The event type — the live notification's method name, retained because the type lives only in the notification name and would otherwise be lost (tdd SS4.2.1). */ + method: string; + /** The notification's params object, verbatim. */ + params: UnframedViewNotificationParams; +} + +/** The `params` of an unframed view notification (tdd SS4.2.1, SS4.2). Declares the SS4.2 base members every view notification carries, and stays **open** for the event-specific fields SS4.5/SS4.6/SS5 add per event type. The v1 schema model names no method-correlated union (the SS4.7.3 `events` element's `params` arm is selected by its sibling `method`), so the per-event arms cannot be expressed here without one; enumerating them as an uncorrelated union would additionally exclude `turn/unqueued`, whose notification row is another lane's ratified deferral (#207/#14407) — a published schema that rejects a real page element is the exact #19923 defect this PR exists to close. Recorded as a Design delta on #22785. `sourceRange` is required here and not optional: `view/page` serves durable-sourced events only (tdd SS4.7.3), and durable-sourced is *defined* as carrying a `sourceRange` — the SS4.2 ephemeral-sourced exemption applies to `item/delta`, which `view/page` never replays. */ +export interface UnframedViewNotificationParams { + /** The owning session (tdd SS4.2). */ + sessionId: string; + /** The durable records this event folded from (tdd SS4.2, SS6.8). */ + sourceRange: SourceRange; + /** The event's opaque, strictly monotonic view cursor. It stays **inside** `params`, where every live notification already carries it (tdd SS4.2.1) — nothing is spliced beside `method`. */ + viewCursor: string; +} + +/** The only scalar alternative to a known effort array. Kept as a closed singleton so arbitrary strings and uppercase spellings fail decoding. */ +export type UnknownModelReasoningEffortVariants = "unknown"; + +/** `usage/read` result: `{usage?}` — omitted, never `null`, when the host has observed nothing (ADR 32563 D2: truthful absence, no "nothing observed" error). */ +export interface UsageReadResult { + /** The last-observed subscription usage window, when one exists. */ + usage?: SubscriptionUsage; +} + +export interface UserInputAnswer { + freeText?: string; + note?: string; + questionId: string; + selectedLabel?: string; + selectedLabels?: string[]; +} + +/** `userInput/answer` params (tdd SS5.10.2): answer every question. Each answer carries `questionId` then exactly one of `selectedLabel` (single mode), `selectedLabels` (multiple mode, within min/max bounds), or `freeText` (<=500 chars); plus an optional `note` (<=500). Answers that do not match the prompt fail -32057 `userInputAnswerInvalid`. Image `attachments` are a **reserved** field in v1, rejected if sent, because the blob-upload path they reference is reserved in tdd SS3.2. */ +export interface UserInputAnswerParams { + /** One entry per question. */ + answers: UserInputAnswer[]; + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The prompt being answered. */ + userInputId: string; +} + +/** `userInput/answer` result (tdd SS5.10.2). */ +export interface UserInputAnswerResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** The prompt this answer settled. */ + userInputId: string; +} + +/** `userInput/cancel` params (tdd SS5.10.2): decline to answer; the tool call resolves with a cancelled result the model sees. */ +export interface UserInputCancelParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** Why the prompt was declined. */ + reason?: string; + /** The target session. */ + sessionId: string; + /** The prompt being declined. */ + userInputId: string; +} + +/** `userInput/cancel` result (tdd SS5.10.2). */ +export interface UserInputCancelResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** The prompt this cancellation settled. */ + userInputId: string; +} + +export interface UserInputClarification { + content: string; + format: string; +} + +/** `userInput/clarify` params (tdd SS5.10.2): answer with a free-form clarification instead of the structured options — the "let me explain" path; the model receives the clarification text and re-decides. */ +export interface UserInputClarifyParams { + /** `format` is `"text"` in v1 (open); `content` is <=500 chars. */ + clarification: UserInputClarification; + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The prompt being clarified. */ + userInputId: string; +} + +/** `userInput/clarify` result (tdd SS5.10.2). */ +export interface UserInputClarifyResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; + /** The prompt this clarification settled. */ + userInputId: string; +} + +export interface UserInputOption { + description?: string; + label: string; + preview?: UserInputOptionPreview; +} + +export interface UserInputOptionPreview { + content: string; + format: string; +} + +export type UserInputOutcome = + | "answered" + | "cancelled" + | "interrupted" + | "clarified" + | "timedOut" + | "aborted" + | (string & {}); + +export interface UserInputQuestion { + header: string; + id: string; + options: UserInputOption[]; + question: string; + selection: UserInputSelection; +} + +/** Full params shared by `userInput/request` and `userInput/requested`. */ +export interface UserInputRequestParams { + autoResolutionMs?: number; + itemId: string; + questions: UserInputQuestion[]; + sessionId: string; + sourceRange?: SourceRange; + toolCallId: string; + toolName: string; + turnId: string; + userInputId: string; + viewCursor: string; +} + +export interface UserInputSelection { + maxSelections?: number; + minSelections?: number; + mode: UserInputSelectionMode; +} + +export type UserInputSelectionMode = "single" | "multiple"; + +/** `userInput/settled` params: the first durable prompt settlement. */ +export interface UserInputSettledParams { + answers: UserInputAnswer[]; + clarification: UserInputClarification | null; + decidedByCommandId: string | null; + outcome: UserInputOutcome; + reason: string | null; + sessionId: string; + sourceRange: SourceRange; + userInputId: string; + viewCursor: string; +} + +/** Winning terminal returned to a late user-input command. */ +export interface UserInputSettlementSummary { + outcome: string; + viewCursor: string; +} + +/** Version-control system of a branch observation (tdd SS4.6.4). Open. */ +export type Vcs = "git" | "sapling" | (string & {}); + +/** `view/gap` params (spec 208 SS4.8, FM-001): push delivery dropped events, and this names the hole. The bracket is deferred (D-16487-2): it flushes at the subscription's next ACCEPTED delivery, never at enqueue time, so `next` always names an event whose own delivery is proven. A run of consecutive undelivered events coalesces into one bracket keeping the FIRST range's `after` (D-16487-1). The gap rides the protected reserved queue, so no wire-interleaving order against neighbouring deliveries is promised — the cursors carry the semantics (INV-002, D-16487-3). On receipt a client may take either sanctioned recovery (D-030, FR-013): splice-fill — buffer live events at cursors >= `next`, page `(after, next)` forward, discard the overlap, splice — or re-anchor through the anchored read surface. The server requires neither, cannot distinguish clients by their choice, and holds no partial-fill state. */ +export interface ViewGapParams { + /** The last cursor delivered before the hole — the exclusive lower bound of the undelivered range. An **opaque** view cursor: clients relay it, never parse it (tdd SS4.1). */ + after: string; + /** The first cursor delivered after the hole — the exclusive upper bound of the undelivered range, and the position delivery continues from. An **opaque** view cursor: clients relay it, never parse it (tdd SS4.1). */ + next: string; + /** The session whose subscription dropped events. */ + sessionId: string; +} + +/** The `view/page` request-mode anchor (tdd SS4.7.3). Declared **open**: the tdd spells it "open string enum, v1 value `latestCompaction`". */ +export type ViewPageAnchor = "latestCompaction" | (string & {}); + +/** The `view/page` paging direction (tdd SS4.7.3). Closed: the tdd spells exactly two values and a third would change the paging contract. */ +export type ViewPageDirection = "forward" | "backward"; + +/** `view/page` params (tdd SS4.7.3): cursor-paged reads of the session view. */ +export interface ViewPageParams { + /** The cold-client request mode (D-029; spec 208 FR-008), resolved at call time to the latest installed compaction boundary. The one named exception to the SS4.1 observed-only rule. */ + anchor?: ViewPageAnchor; + /** The exclusive anchor. Forward: the page starts strictly after it; omitted means from the beginning of the view. Backward: the page ends strictly before it; omitted means from the head. Mutually exclusive with `anchor` (tdd SS4.7.3; spec 208 FR-008a). */ + cursor?: string; + /** Paging direction; `forward` when omitted. */ + direction?: ViewPageDirection; + /** Maximum events to return, 1–1000. The server MAY return fewer (tdd SS4.7.3's short-serve rule). The 1–1000 range is ratified and now **published**: #22785 E6c is owner-ruled, so the model carries the bound and the bundle renders `minimum`/`maximum` instead of a bare `integer`. Range 1–1000 inclusive. */ + limit: number; + /** The session to page. */ + sessionId: string; +} + +/** The `resolvedAnchor` echo (tdd SS4.7.3): subsequent pages pass ordinary cursors, so the anchor never needs re-resolving. */ +export interface ViewPageResolvedAnchor { + /** The view cursor of the resolved boundary's `compaction` event. */ + boundaryCursor: string; +} + +/** `view/page` result (tdd SS4.7.3). */ +export interface ViewPageResult { + /** The page's events, always ascending by `viewCursor` in both directions. Durable-sourced only; pages are contiguous and can never skip a cursor. */ + events: UnframedViewNotification[]; + /** The anchor for the next page in the same direction: forward, the last event's cursor; backward, the first's. `null` at the end of the view in that direction — never omitted. */ + nextCursor: string | null; + /** The resolution echo, present exactly when the request used `anchor` (tdd SS4.7.3; spec 208 FR-008). */ + resolvedAnchor?: ViewPageResolvedAnchor; +} + +/** The `snapshot` object returned by `session/resume` / `session/read` (tdd SS4.9). */ +export interface ViewSnapshot { + /** Present exactly when `history.mode` is `anchoredSnapshot` (tdd SS2.5.2). */ + anchor?: SnapshotAnchor; + /** Snapshot schema version. A client whose generated types are older than this must fall back to inline/paged history (tdd SS4.9.2, SS2.5.2). */ + schemaVersion: number; + /** The complete folded view at `viewCursor` (tdd SS4.9.1). */ + state: SnapshotState; + /** The cursor the state is folded at; every event after it streams as the suffix (tdd SS4.9). */ + viewCursor: string; +} + +/** `view/subscribe` params (tdd SS4.7.1): attach this connection's live view subscription for a session at an explicit cursor — the fine-grained counterpart of the SS2 auto-subscribe, and the gap-free re-attachment path after `view/unsubscribe`. It never loads a session, takes no lease, writes nothing. */ +export interface ViewSubscribeParams { + /** Resume cursor. When present, the server replays `(after, head]` as ordinary view notifications before any live event — one gapless cursor sequence. Omitted means "from now": no historical replay (tdd SS4.7.1). */ + after?: string; + /** The session to follow. */ + sessionId: string; +} + +/** `view/subscribe` result (tdd SS4.7.1). */ +export interface ViewSubscribeResult { + /** The view head at subscribe time; the client knows it is live once cursors pass it. */ + viewCursor: string; +} + +/** `view/unsubscribe` params (tdd SS4.7.2): remove this connection from the session's view subscription set — the protocol's single unsubscribe operation, at the altitude that owns subscriptions (tdd SS2.5.6 points here). It does not unload the session; unloading is the idle policy (tdd SS2.8). */ +export interface ViewUnsubscribeParams { + /** The session to stop following. */ + sessionId: string; +} + +/** `view/unsubscribe` result (tdd SS4.7.2): the empty object. Idempotent — unsubscribing while not subscribed returns `{}`. */ +export interface ViewUnsubscribeResult {} + +/** `workflow/cancel` params (tdd SS3.19): cancel a live workflow run. */ +export interface WorkflowCancelParams { + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The run to cancel, exactly as the `workflow` item names it (SS4.5.8); required, non-empty. */ + workflowRunId: string; +} + +/** One workflow child's folded state (tdd SS4.5.8, `WorkflowChildLifecycleFact`), keyed by `(childId, attempt)`. */ +export interface WorkflowChild { + /** The attempt number. */ + attempt: number; + /** The child's id within the run. */ + childId: string; + /** The child's observed duration, when recorded. */ + durationMs?: number; + /** The child's display label, when recorded. */ + label?: string; + /** The child's phase, when recorded. */ + phase?: string; + /** The child's recorded result reference, verbatim, when present — an opaque string, matching the durable owner. */ + resultRef?: string; + /** camelCased `WorkflowChildLifecycleStatus`, verbatim (durable runtime vocabulary). */ + status: string; + /** The child's terminal, turn vocabulary (tdd SS4.5.8). */ + terminal?: TurnTerminal; + /** The child's observed usage, when recorded. */ + usage?: TokenUsage; +} + +/** Which control to apply to the child's current attempt (tdd SS3.20). Closed on the wire: an unknown value is `-32602 invalidParams`. */ +export type WorkflowChildAction = "skip" | "retry"; + +/** `workflow/childControl` params (tdd SS3.20): skip or retry one workflow child, keyed by the `(childId, attempt)` pair the `workflow` item's `children[]` carries. */ +export interface WorkflowChildControlParams { + /** The control to apply. */ + action: WorkflowChildAction; + /** The child's CURRENT attempt (integer >= 1). A stale value rejects `"stale_attempt"`; re-read the item and re-key — never guess. Minimum 1. */ + attempt: number; + /** The child, from the item's `children[]`; required, non-empty. */ + childId: string; + /** The SS3.1.1 idempotency handle (UUIDv7). */ + commandId: string; + /** The target session. */ + sessionId: string; + /** The run owning the child (SS4.5.8); required, non-empty. */ + workflowRunId: string; +} + +/** The shared SS3.19/SS3.20 admission-only ack: deliberately bare `{commandId, status}` — settlement arrives as the workflow item's view events, never through the ack. */ +export interface WorkflowControlResult { + /** Echoes the client's id. */ + commandId: string; + /** Admission status. */ + status: CommandStatus; +} + +/** Every wire method in this schema (SS1.9 index). */ +export type MspMethod = + | "initialize" + | "subagent/sendMessage" + | "subagent/followupTask" + | "subagent/interrupt" + | "subagent/stop" + | "subagent/resume" + | "subagent/reopen" + | "subagent/close" + | "subagent/readResult" + | "session/start" + | "session/resume" + | "session/fork" + | "session/list" + | "session/read" + | "turn/start" + | "turn/steer" + | "turn/interrupt" + | "turn/cancel" + | "turn/unqueue" + | "session/compact" + | "session/delete" + | "session/setModel" + | "session/rename" + | "session/setReasoningEffort" + | "session/userShell" + | "model/list" + | "skill/list" + | "task/background" + | "task/stop" + | "task/stopAll" + | "goal/set" + | "goal/edit" + | "goal/clear" + | "goal/pause" + | "goal/resume" + | "workflow/cancel" + | "workflow/childControl" + | "view/subscribe" + | "view/unsubscribe" + | "view/page" + | "item/readOutput" + | "approval/decide" + | "approval/listPending" + | "session/setApprovalMode" + | "userInput/answer" + | "userInput/cancel" + | "userInput/clarify" + | "usage/read"; +/** Every wire notification in this schema (SS1.9 index). */ +export type MspNotification = + | "initialized" + | "session/started" + | "session/closed" + | "session/deleteCompleted" + | "skill/changed" + | "turn/started" + | "turn/completed" + | "turn/retracted" + | "turn/retryScheduled" + | "turn/unqueued" + | "item/started" + | "item/updated" + | "item/delta" + | "item/completed" + | "view/gap" + | "approval/requested" + | "approval/updated" + | "approval/resolved" + | "userInput/requested" + | "userInput/settled" + | "session/modelChanged" + | "session/reasoningEffortChanged" + | "session/statusChanged" + | "session/goalChanged" + | "session/todoListChanged" + | "session/branchChanged" + | "session/tokenUsage" + | "session/contextUsage" + | "session/approvalModeChanged" + | "session/modelRouteUnserved" + | "session/nameChanged" + | "session/viewHealthChanged" + | "session/listChanged" + | "usage/changed"; +/** Every server-initiated wire request in this schema (SS5.3/SS5.10.1 index). */ +export type MspServerRequest = "approval/request" | "userInput/request"; +/** Every error `data.kind` in this schema's error table (SS1.6) — each code's primary kind plus its override kinds. */ +export type MspErrorDataKind = + | "parseError" + | "invalidRequest" + | "notInitialized" + | "alreadyInitialized" + | "methodNotFound" + | "experimentalRequired" + | "invalidParams" + | "internal" + | "pageEventTooLarge" + | "outputResultTooLarge" + | "overloaded" + | "inputTooLarge" + | "capabilityRequired" + | "notFound" + | "interrupted" + | "cancelled" + | "sessionNotFound" + | "sessionInUse" + | "sessionAmbiguous" + | "forkBoundaryInvalid" + | "sessionNotLoaded" + | "sessionStreamMismatch" + | "commandRejected" + | "backpressured" + | "skillNotFound" + | "viewTruncated" + | "outputUnavailable" + | "boundaryPruned" + | "boundaryUnusable" + | "noBoundary" + | "approvalNotFound" + | "approvalAlreadyResolved" + | "approvalChoiceInvalid" + | "approvalRequirementStale" + | "approvalReviewerUnavailable" + | "userInputNotFound" + | "userInputAlreadySettled" + | "userInputAnswerInvalid"; diff --git a/plugins/muse-provider/server/provider.ts b/plugins/muse-provider/server/provider.ts new file mode 100644 index 0000000000..10e000b0c1 --- /dev/null +++ b/plugins/muse-provider/server/provider.ts @@ -0,0 +1,223 @@ +import { + negotiateProviderCapabilities, + requireProviderCapabilities, + type ProviderConnection, + type ProviderEvent, + type ProviderInput, + type ProviderLaunch, + type ProviderRegistration, + type ProviderStatus, +} from "@getpaseo/plugin/server/provider"; +import type { PluginSettings } from "@getpaseo/plugin/server"; +import { serveArgs } from "./settings.js"; +import { settingsSchema } from "../shared/settings.js"; +import { Usage } from "./usage.js"; +import { execFile } from "node:child_process"; +import { Catalog, launchKey } from "./catalog.js"; +import { MspConnection } from "./connection.js"; +import { MuseError, actionableError } from "./errors.js"; +import { Sessions } from "./sessions.js"; +import { Session } from "./session.js"; +import { accountSchema } from "./wire.js"; + +const capabilities = [ + "prompt.message", + "prompt.command", + "prompt.image", + "prompt.steer", + "session.configure", + "session.persistence", + "permission", + "session.list", +] as const; + +export function createMuseProvider( + settings: PluginSettings, + usage: Usage, +): ProviderRegistration { + return { + id: "muse", + label: "Muse Code", + icon: "icon.svg", + command: ["muse"], + async getCatalogCacheKey(options) { + return launchKey(requireLaunch(options.launch)); + }, + async status({ launch }) { + if (!launch) + return { available: false, diagnostic: "Install Muse Code and ensure `muse` is on PATH." }; + usage.remember(launch); + return status(launch); + }, + async connect(request) { + if (!request.versions.includes(1)) + throw new MuseError("protocol", "Provider protocol version 1 is required"); + usage.remember(requireLaunch(request.launch)); + return connect( + requireLaunch(request.launch), + negotiateProviderCapabilities(request.capabilities, capabilities), + settings, + usage, + ); + }, + }; +} +function requireLaunch(launch: ProviderLaunch | undefined): ProviderLaunch { + if (!launch) throw new MuseError("missingLaunch", "Muse requires a daemon-resolved executable"); + return launch; +} +async function status(launch: ProviderLaunch): Promise { + let host: MspConnection | undefined; + try { + const versionText = await new Promise((resolve, reject) => { + execFile( + launch.command, + [...launch.args, "--version"], + { env: launch.env, timeout: 3000, maxBuffer: 8192 }, + (error, stdout) => { + if (error) reject(new MuseError("version", error.message)); + else resolve(stdout); + }, + ); + }); + const match = /\b(\d+)\.(\d+)\.(\d+)\b/.exec(versionText); + if (!match) return { available: false, diagnostic: "Muse returned an unrecognized version." }; + const major = Number(match[1]); + const minor = Number(match[2]); + if (major < 1 || (major === 1 && minor < 3)) + return { available: false, diagnostic: `Update Muse Code: found ${match[0]}, need ≥1.3.0` }; + host = new MspConnection({ launch, timeoutMs: 3000 }); + await host.initialize(); + const account = await host.request("account/read", {}, accountSchema); + if (account.state === "loggedOut") + return { available: false, diagnostic: "Run `muse login` or set META_API_KEY" }; + return { available: true }; + } catch (error) { + return { available: false, diagnostic: actionableError(error, launch).message }; + } finally { + await host?.close(); + } +} +function connect( + launch: ProviderLaunch, + negotiated: readonly string[], + settings: PluginSettings, + usage: Usage, +): ProviderConnection { + const listeners = new Set<(event: ProviderEvent) => void>(); + const sessions = new Map(); + const catalog = new Catalog(); + const imports = new Sessions(); + let closed = false; + function emit(event: ProviderEvent): void { + if (!closed) for (const listener of listeners) listener(event); + } + async function dispatch(input: ProviderInput): Promise { + if (input.type === "sessions") { + emit({ + type: "sessions", + requestId: input.requestId, + sessions: await imports.list(launch, input), + }); + return; + } + if (input.type === "catalog") { + emit({ type: "catalog", requestId: input.requestId, catalog: await catalog.read(launch) }); + return; + } + if (input.type === "session.open") { + if (sessions.has(input.sessionId)) + throw new MuseError("duplicateSession", "Muse session is already open"); + const session = new Session({ + id: input.sessionId, + config: input.config, + launch, + emit, + capabilities: negotiated, + serveArgs: await serveArgs(settings), + }); + sessions.set(input.sessionId, session); + try { + await session.open(input); + usage.attach( + input.sessionId, + { ...launch, env: { ...launch.env, ...input.config.env } }, + () => session.readUsage(), + ); + } catch (error) { + sessions.delete(input.sessionId); + await session.close(); + throw error; + } + return; + } + if (!("sessionId" in input)) + throw new MuseError("unsupported", `Muse does not support ${input.type}`); + const session = sessions.get(input.sessionId); + if (!session) throw new MuseError("unknownSession", "Muse session is not open"); + switch (input.type) { + case "session.prompt": + await session.prompt(input.prompt); + return; + case "session.configure": + await session.configure(input.changes); + break; + case "session.permission": + await session.answer(input.permissionId, input.response); + return; + case "session.interrupt": + await session.interrupt(); + break; + case "session.close": + await session.close(); + sessions.delete(input.sessionId); + usage.detach(input.sessionId); + emit({ type: "session.closed", sessionId: input.sessionId }); + break; + default: + throw new MuseError("unsupported", `Muse does not support ${input.type}`); + } + if ("requestId" in input) emit({ type: "request.completed", requestId: input.requestId }); + } + function failed(input: ProviderInput, failure: unknown): void { + const error = actionableError(failure, launch); + if (input.type === "session.prompt") + emit({ + type: "session.prompt_result", + sessionId: input.sessionId, + clientMessageId: input.prompt.clientMessageId, + result: { type: "failed", error }, + }); + else if ("requestId" in input) + emit({ type: "request.failed", requestId: input.requestId, error }); + else if ("sessionId" in input) + emit({ type: "session.runtime_failed", sessionId: input.sessionId, error }); + } + return { + version: 1, + capabilities: negotiated, + async send(input) { + if (closed) throw new MuseError("closed", "Muse connection is closed"); + requireProviderCapabilities(negotiated, input); + queueMicrotask(() => { + if (!closed) void dispatch(input).catch((error: unknown) => failed(input, error)); + }); + }, + onEvent(listener) { + listeners.add(listener); + return () => listeners.delete(listener); + }, + async close() { + if (closed) return; + closed = true; + await Promise.all([ + catalog.close(), + imports.close(), + ...[...sessions.values()].map((session) => session.close()), + ]); + for (const id of sessions.keys()) usage.detach(id); + sessions.clear(); + listeners.clear(); + }, + }; +} diff --git a/plugins/muse-provider/server/questions.ts b/plugins/muse-provider/server/questions.ts new file mode 100644 index 0000000000..cf05f358b9 --- /dev/null +++ b/plugins/muse-provider/server/questions.ts @@ -0,0 +1,86 @@ +import type { ProviderEvent, ProviderPermissionResponse } from "@getpaseo/plugin/server/provider"; +import type { z } from "zod"; +import { MspConnection } from "./connection.js"; +import { MuseError } from "./errors.js"; +import { ackSchema, questionSchema, questionAnswersSchema, settledQuestionSchema } from "./wire.js"; + +export class Questions { + private readonly pending = new Map>(); + private readonly settled = new Set(); + constructor( + private readonly host: MspConnection, + private readonly sessionId: string, + private readonly id: string, + private readonly emit: (event: ProviderEvent) => void, + ) {} + + requested(input: unknown): void { + const request = questionSchema.parse(input); + if (this.settled.has(request.userInputId)) return; + this.pending.set(request.userInputId, request); + this.emit({ + type: "session.permission", + sessionId: this.id, + request: { + id: request.userInputId, + name: request.toolName, + kind: "question", + input: { + questions: request.questions.map((question) => ({ + id: question.id, + header: question.header, + question: question.question, + options: question.options, + multiSelect: question.selection.mode === "multiple", + allowOther: true, + allowEmpty: question.selection.minSelections === 0, + })), + }, + }, + }); + } + resolved(input: unknown): void { + const { userInputId } = settledQuestionSchema.parse(input); + this.settled.add(userInputId); + this.pending.delete(userInputId); + this.emit({ + type: "session.permission_resolved", + sessionId: this.id, + permissionId: userInputId, + }); + } + async answer(id: string, response: ProviderPermissionResponse): Promise { + const request = this.pending.get(id); + if (!request) return false; + if (response.behavior === "deny") { + await this.host.command( + "userInput/cancel", + { sessionId: this.sessionId, userInputId: id, reason: response.message }, + ackSchema, + ); + return true; + } + const supplied = questionAnswersSchema.parse(response.updatedInput); + const answers = request.questions.map((question) => { + const text = supplied.answers[question.header]; + if (text === undefined) throw new MuseError("missingAnswer", `Answer ${question.header}`); + if (question.selection.mode === "single") + return question.options.some((option) => option.label === text) + ? { questionId: question.id, selectedLabel: text } + : { questionId: question.id, freeText: text }; + const labels = text + .split(",") + .map((label) => label.trim()) + .filter(Boolean); + if (labels.every((label) => question.options.some((option) => option.label === label))) + return { questionId: question.id, selectedLabels: labels }; + return { questionId: question.id, freeText: text }; + }); + await this.host.command( + "userInput/answer", + { sessionId: this.sessionId, userInputId: id, answers }, + ackSchema, + ); + return true; + } +} diff --git a/plugins/muse-provider/server/recovery.ts b/plugins/muse-provider/server/recovery.ts new file mode 100644 index 0000000000..0218ef47c4 --- /dev/null +++ b/plugins/muse-provider/server/recovery.ts @@ -0,0 +1,45 @@ +import type { z } from "zod"; +import { MspConnection, type Notification } from "./connection.js"; +import { pageSchema } from "./wire.js"; + +// Two minutes accommodates slow model/tool work; polling repairs a lost live view without cancelling it. +const SILENCE_MS = 2 * 60 * 1000; +export class Recovery { + private timer: ReturnType | undefined; + private active = false; + private closed = false; + private cursor: string; + constructor( + private readonly host: MspConnection, + private readonly sessionId: string, + cursor: string, + private readonly apply: (event: Notification) => Promise, + private readonly onSilent: () => void, + ) { + this.cursor = cursor; + } + + activity(cursor: string | undefined, active: boolean): void { + if (cursor !== undefined) this.cursor = cursor; + this.active = active; + clearTimeout(this.timer); + if (active && !this.closed) this.timer = setTimeout(this.onSilent, SILENCE_MS); + } + async backfill(after = this.cursor): Promise { + let cursor: string | null = after; + do { + const page: z.infer = await this.host.request( + "view/page", + { sessionId: this.sessionId, cursor, direction: "forward", limit: 1000 }, + pageSchema, + ); + for (const event of page.events) await this.apply(event); + cursor = page.nextCursor; + } while (cursor !== null && !this.closed); + this.activity(undefined, this.active); + } + close(): void { + this.closed = true; + clearTimeout(this.timer); + } +} diff --git a/plugins/muse-provider/server/session.ts b/plugins/muse-provider/server/session.ts new file mode 100644 index 0000000000..b152361060 --- /dev/null +++ b/plugins/muse-provider/server/session.ts @@ -0,0 +1,635 @@ +import type { + ProviderEvent, + ProviderInput, + ProviderLaunch, + ProviderPersistence, + ProviderSessionConfig, + ProviderConfigChanges, + ProviderPrompt, + ProviderPermissionResponse, + ProviderMcpServerConfig, + ProviderCatalog, + ProviderToolCallDetail, +} from "@getpaseo/plugin/server/provider"; +import type { z } from "zod"; +import { MspConnection, commandId, type Notification } from "./connection.js"; +import { MuseError, actionableError } from "./errors.js"; +import { Timeline, todoItem } from "./timeline.js"; +import { modes, efforts, presentCatalog } from "./catalog.js"; +import { + pendingSchema, + itemNotificationSchema, + approvalResolvedSchema, + usageSchema, + ackSchema, + gapSchema, + catalogSchema, + approvalModeSchema, + approvalSchema, + deltaSchema, + effortSchema, + notificationSchema, + persistenceSchema, + promptResultSchema, + sessionSchema, + turnSchema, + tokenUsageSchema, + contextUsageSchema, + type WireItem, + type WireApproval, +} from "./wire.js"; +import type { SessionMcpServerConfig, TurnStartParams } from "./msp.js"; + +import { Children } from "./children.js"; +import { Recovery } from "./recovery.js"; +import { Questions } from "./questions.js"; +import { Commands } from "./commands.js"; + +interface SessionOptions { + serveArgs: string[]; + id: string; + config: ProviderSessionConfig; + launch: ProviderLaunch; + emit(event: ProviderEvent): void; + capabilities: readonly string[]; +} + +interface Live { + nativeId: string; + timeline: Timeline; + children: Children; + questions: Questions; + commands: Commands; + recovery: Recovery; +} + +export class Session { + private readonly host: MspConnection; + private liveState: Live | undefined; + private providerId = "meta"; + private cursor: string | undefined; + private config: ProviderSessionConfig; + private catalog: ProviderCatalog = { models: [], modes }; + private readonly approvals = new Map(); + private readonly messages = new Map(); + private readonly turns = new Map(); + private notifications: Promise = Promise.resolve(); + private readonly buffered: Notification[] = []; + private opening = true; + private closing = false; + private firstTurn = true; + private interruptCompletion: { + turnId: string; + resolve(): void; + reject(error: Error): void; + } | null = null; + + constructor(private readonly options: SessionOptions) { + this.config = options.config; + this.host = new MspConnection({ + launch: { ...options.launch, env: { ...options.launch.env, ...options.config.env } }, + cwd: options.config.cwd, + serveArgs: options.serveArgs, + }); + this.host.onNotification((notification) => { + if (this.opening) this.buffered.push(notification); + else this.enqueue(notification); + }); + this.host.onExit((error) => { + if (!this.opening && !this.closing) this.runtimeFailed(error); + }); + } + + async open(input: Extract): Promise { + await this.host.initialize(); + const mcpServers = Object.fromEntries( + Object.entries(this.config.mcpServers).map(([id, server]) => [id, mcpServer(server)]), + ); + let response; + if (input.persistence) { + if (input.persistence.version !== 1) + throw new MuseError("invalidPersistence", "Unsupported Muse persistence version"); + const saved = persistenceSchema.parse(input.persistence.data); + response = await this.host.command( + "session/resume", + { sessionId: saved.sessionId, cursor: saved.cursor, config: { mcpServers } }, + sessionSchema, + ); + this.config = { + ...this.config, + model: this.config.model ?? saved.model, + thinkingOption: this.config.thinkingOption ?? saved.thinkingOption, + }; + this.firstTurn = false; + } else { + response = await this.host.command( + "session/start", + { + workspaceRoot: this.config.cwd, + modelId: this.config.model, + approvalMode: approvalModeSchema.parse(this.config.mode ?? "onRequest"), + config: { mcpServers }, + }, + sessionSchema, + ); + } + if (!response.viewCursor) + throw new MuseError( + "emptyViewCursor", + "Muse returned an empty resume viewCursor; this session cannot be watched.", + ); + const nativeId = response.session.sessionId; + this.liveState = { + nativeId, + children: new Children(this.host, this.options.id, this.config.cwd, this.options.emit), + timeline: new Timeline( + this.host, + nativeId, + this.options.id, + this.options.emit, + (messageCommandId) => this.messages.get(messageCommandId), + ), + questions: new Questions(this.host, nativeId, this.options.id, this.options.emit), + commands: new Commands(this.host, nativeId, this.options.id, this.options.emit), + recovery: new Recovery( + this.host, + nativeId, + response.viewCursor, + (event) => this.notify(event), + () => { + this.notifications = this.notifications + .then(async () => { + const live = this.live(); + await live.recovery.backfill(); + return live.children.refresh(); + }) + .catch((error) => this.runtimeFailed(error)); + }, + ), + }; + this.providerId = response.session.providerId; + this.cursor = response.viewCursor; + this.config = { + ...this.config, + model: response.session.modelId, + mode: response.session.approvalMode?.mode ?? this.config.mode ?? "onRequest", + }; + this.options.emit({ + type: "session.opened", + requestId: input.requestId, + sessionId: this.options.id, + cwd: this.config.cwd, + restoration: "core", + capabilities: this.options.capabilities, + persistence: this.persistence(), + }); + if (input.history === "replay" && response.history?.mode === "inline") { + if (!response.history.items) + throw new MuseError("invalidHistory", "Muse inline history has no items"); + for (const item of response.history.items) await this.fold(item); + } + await this.restorePending(response.pendingRequests); + // Inline history precedes suffix events; replayed turn terminals do not own a fresh run. + this.opening = false; + for (const notification of this.buffered) this.enqueue(notification); + this.buffered.length = 0; + await this.notifications; + this.catalog = presentCatalog( + await this.host.request("model/list", { sessionId: this.live().nativeId }, catalogSchema), + ); + const selected = this.catalog.models.find((model) => model.id === this.config.model); + this.config = { + ...this.config, + thinkingOption: this.config.thinkingOption ?? selected?.defaultThinkingOptionId, + }; + await this.live().commands.refresh(); + this.publishPersistence(); + this.publishConfig(); + this.options.emit({ + type: "session.ready", + requestId: input.requestId, + sessionId: this.options.id, + }); + } + + private live(): Live { + if (!this.liveState) throw new MuseError("sessionNotOpen", "Muse session is not open"); + return this.liveState; + } + + private async restorePending( + pointers: z.infer["pendingRequests"], + ): Promise { + if (!pointers.some((pending) => ["approval", "userInput"].includes(pending.kind))) return; + const pending = await this.host.request( + "approval/listPending", + { sessionId: this.live().nativeId }, + pendingSchema, + ); + for (const approval of pending.approvals) await this.permission(approval); + for (const question of pending.userInputs) this.live().questions.requested(question); + } + async prompt(prompt: ProviderPrompt): Promise { + if (await this.live().commands.compact(prompt)) return; + const id = commandId(); + this.messages.set(id, prompt.clientMessageId); + const input: TurnStartParams["input"] = []; + const text: string[] = []; + if (this.firstTurn && this.config.systemPrompt) + input.push({ + type: "text", + text: `\n${this.config.systemPrompt}\n`, + }); + if (prompt.input.type === "command") { + input.push(this.live().commands.input(prompt.input)); + text.push( + `/${prompt.input.name}${prompt.input.arguments ? ` ${prompt.input.arguments}` : ""}`, + ); + } else + for (const part of prompt.input.content) { + if (part.type === "text") { + input.push({ type: "text", text: part.text }); + text.push(part.text); + } else if (part.type === "image") + input.push({ type: "image", base64Data: part.data, mediaType: part.mimeType }); + else throw new MuseError("unsupported", `Muse does not support ${part.type} attachments`); + } + const params: TurnStartParams = { + commandId: id, + sessionId: this.live().nativeId, + input, + displayText: text.join("\n"), + ifBusy: prompt.delivery === "steer" ? "steer" : "queue", + reasoningEffort: this.config.thinkingOption + ? effortSchema.parse(this.config.thinkingOption) + : undefined, + }; + const response = await this.host.command("turn/start", params, promptResultSchema); + this.firstTurn = false; + if (response.disposition === "started" && this.turns.get(response.turnId) !== "completed") + this.turns.set(response.turnId, "active"); + this.live().recovery.activity(undefined, this.activeTurnIds().length > 0); + const type = response.disposition === "steered" ? "steer" : "turn"; + this.options.emit({ + type: "session.prompt_result", + sessionId: this.options.id, + clientMessageId: prompt.clientMessageId, + result: { type, turnId: response.turnId }, + }); + } + async configure(changes: ProviderConfigChanges): Promise { + if (changes.model !== undefined) { + if (!changes.model) throw new MuseError("invalidModel", "Choose a Muse model"); + await this.host.command( + "session/setModel", + { + sessionId: this.live().nativeId, + model: { providerId: this.providerId, modelId: changes.model }, + }, + ackSchema, + ); + this.config = { ...this.config, model: changes.model }; + } + // Muse receives configured thinking effort on each turn/start, rather than a session mutation. + if (changes.thinkingOption !== undefined) { + const thinkingOption = + changes.thinkingOption === null ? undefined : effortSchema.parse(changes.thinkingOption); + this.config = { ...this.config, thinkingOption }; + } + if (changes.mode !== undefined) { + const mode = approvalModeSchema.parse(changes.mode ?? "onRequest"); + await this.host.command( + "session/setApprovalMode", + { sessionId: this.live().nativeId, mode }, + ackSchema, + ); + this.config = { ...this.config, mode }; + } + this.publishConfig(); + this.publishPersistence(); + } + async answer(permissionId: string, response: ProviderPermissionResponse): Promise { + if (await this.live().questions.answer(permissionId, response)) return; + const approval = this.approvals.get(permissionId); + if (!approval) + throw new MuseError("approvalNotFound", "This Muse approval is no longer pending"); + const choice = response.selectedActionId + ? approval.availableChoices.find( + (candidate) => candidate.choiceId === response.selectedActionId, + ) + : (approval.availableChoices.find((candidate) => + response.behavior === "allow" + ? candidate.decision === "approved" && candidate.scope === "once" + : candidate.decision === "denied" && candidate.scope === "once", + ) ?? + (response.behavior === "deny" + ? approval.availableChoices.find( + (candidate) => candidate.decision === "abort" && candidate.scope === "once", + ) + : undefined)); + if (!choice) + throw new MuseError( + "invalidApprovalChoice", + "Choose one of Muse's available approval actions", + ); + await this.decide(approval, choice.choiceId); + } + private async decide(approval: WireApproval, choiceId: string): Promise { + await this.host.command( + "approval/decide", + { + sessionId: this.live().nativeId, + approvalId: approval.approvalId, + choiceId, + requirementId: approval.currentRequirementId, + }, + ackSchema, + ); + } + async readUsage() { + return this.host.request("usage/read", {}, usageSchema); + } + async interrupt(): Promise { + const turnId = this.activeTurnIds().at(-1); + if (!turnId) return; + let timer: ReturnType; + const completion = new Promise((resolve, reject) => { + this.interruptCompletion = { turnId, resolve, reject }; + timer = setTimeout(() => { + this.runtimeFailed( + new MuseError( + "interruptTimeout", + "Muse did not confirm cancellation within 10000ms. Reopen the session before sending another prompt.", + ), + ); + void this.host.close(); + }, 10000); + }); + try { + await Promise.all([ + this.host.command("turn/interrupt", { sessionId: this.live().nativeId, turnId }, ackSchema), + completion, + ]); + } finally { + clearTimeout(timer!); + this.interruptCompletion = null; + } + } + async close(): Promise { + this.closing = true; + if (this.liveState) this.live().recovery.close(); + await this.host.close(); + await this.notifications; + if (this.liveState) this.live().children.close(); + } + private enqueue(notification: Notification): void { + this.notifications = this.notifications + .then(() => this.notify(notification)) + .catch((error: unknown) => this.runtimeFailed(error)); + } + private runtimeFailed(error: unknown): void { + this.live().recovery.close(); + this.options.emit({ + type: "session.runtime_failed", + sessionId: this.options.id, + error: actionableError(error, this.options.launch), + }); + const interrupt = this.interruptCompletion; + if (interrupt) interrupt.reject(error instanceof Error ? error : new Error(String(error))); + } + private async notify(notification: Notification): Promise { + const envelope = notificationSchema.parse(notification.params); + if (envelope.sessionId && envelope.sessionId !== this.live().nativeId) { + await this.live().children.notify(envelope.sessionId, notification); + return; + } + await this.processNotification(notification); + this.live().recovery.activity(envelope.viewCursor, this.activeTurnIds().length > 0); + if (envelope.viewCursor) { + this.cursor = envelope.viewCursor; + this.publishPersistence(); + } + } + private async processNotification(notification: Notification): Promise { + switch (notification.method) { + case "view/gap": + // The gap lower bound remains authoritative even if a later live event arrived first. + await this.live().recovery.backfill(gapSchema.parse(notification.params).after); + break; + case "userInput/requested": + this.live().questions.requested(notification.params); + break; + case "userInput/settled": + this.live().questions.resolved(notification.params); + break; + case "session/todoListChanged": + this.options.emit({ + type: "timeline.item", + sessionId: this.options.id, + item: todoItem(notification.params), + }); + break; + case "skill/changed": + await this.live().commands.refresh(); + break; + case "item/started": + case "item/updated": + case "item/completed": { + const params = itemNotificationSchema.parse(notification.params); + await this.fold(params.item); + break; + } + case "item/delta": + this.live().timeline.delta(deltaSchema.parse(notification.params)); + break; + case "approval/requested": + case "approval/updated": + await this.permission(approvalSchema.parse(notification.params)); + break; + case "approval/resolved": { + const params = approvalResolvedSchema.parse(notification.params); + this.approvals.delete(params.approvalId); + this.options.emit({ + type: "session.permission_resolved", + sessionId: this.options.id, + permissionId: params.approvalId, + }); + break; + } + case "turn/started": + this.startTurn(notification.params); + break; + case "turn/completed": + this.completeTurn(notification.params); + break; + case "session/tokenUsage": { + const params = tokenUsageSchema.parse(notification.params); + this.options.emit({ + type: "session.usage", + sessionId: this.options.id, + usage: { + inputTokens: params.cumulative.promptTokens, + outputTokens: params.cumulative.outputTokens, + cachedInputTokens: params.usage?.cachedTokens, + }, + }); + break; + } + case "session/contextUsage": { + const params = contextUsageSchema.parse(notification.params); + this.options.emit({ + type: "session.usage", + sessionId: this.options.id, + usage: { + contextWindowUsedTokens: params.usedTokens, + contextWindowMaxTokens: params.windowTokens, + }, + }); + break; + } + } + } + private startTurn(input: unknown): void { + const params = turnSchema.parse(input); + if ( + params.commandId && + this.messages.has(params.commandId) && + this.turns.get(params.turnId) !== "completed" + ) { + this.turns.set(params.turnId, "active"); + this.options.emit({ + type: "session.turn", + sessionId: this.options.id, + turnId: params.turnId, + state: "started", + }); + } + } + private activeTurnIds(): string[] { + return [...this.turns].filter(([, state]) => state === "active").map(([id]) => id); + } + private completeTurn(input: unknown): void { + const params = turnSchema.parse(input); + if (this.turns.get(params.turnId) !== "active") return; + this.turns.set(params.turnId, "completed"); + let state: "completed" | "canceled" | "failed" = "completed"; + let error; + if (params.terminal === "cancelled") state = "canceled"; + else if (params.error || params.terminal === "failed") { + state = "failed"; + error = params.error + ? actionableError( + new MuseError(params.error.kind, params.error.message), + this.options.launch, + ) + : { message: "Muse turn failed" }; + } + this.options.emit({ + type: "session.turn", + sessionId: this.options.id, + turnId: params.turnId, + state, + error, + }); + if (this.interruptCompletion?.turnId === params.turnId) this.interruptCompletion.resolve(); + } + + private async fold(item: WireItem): Promise { + if (await this.live().timeline.fold(item)) await this.live().children.update(item); + } + private async permission(approval: WireApproval): Promise { + const current = approval.subject.stages.find( + (stage) => stage.requirementId.sourceIndex === approval.currentRequirementId?.sourceIndex, + ); + if (current && current.resolution.kind !== "unresolved") return; + this.approvals.set(approval.approvalId, approval); + if (this.config.mode === "allowAll") { + const choice = approval.availableChoices.find( + (candidate) => candidate.decision === "approved" && candidate.scope === "once", + ); + if (!choice) + throw new MuseError("noAllowOnceChoice", "Muse escalation has no allow-once action"); + await this.decide(approval, choice.choiceId); + return; + } + let title = approval.toolName; + if (current) title = `Stage ${current.position} of ${current.totalStages}`; + let detail: ProviderToolCallDetail; + const subject = approval.subject; + if (subject.kind === "shell") + detail = { + type: "shell", + command: current ? current.argv.join(" ") : subject.command, + cwd: subject.workspaceRoot, + }; + else if (subject.kind === "fileAccess") detail = { type: "edit", filePath: subject.path }; + else + detail = { + type: "plain_text", + label: subject.kind, + text: subject.host || subject.path || subject.command, + }; + const actions = approval.availableChoices.map((choice) => { + const behavior = choice.decision.startsWith("approved") ? "allow" : "deny"; + return { id: choice.choiceId, label: choice.label, behavior } as const; + }); + this.options.emit({ + type: "session.permission", + sessionId: this.options.id, + request: { + id: approval.approvalId, + name: approval.toolName, + kind: "tool", + title, + detail, + actions, + }, + }); + } + private persistence(): ProviderPersistence { + return { + version: 1, + data: { + sessionId: this.live().nativeId, + ...(this.cursor ? { cursor: this.cursor } : {}), + ...(this.config.model ? { model: this.config.model } : {}), + ...(this.config.thinkingOption ? { thinkingOption: this.config.thinkingOption } : {}), + }, + }; + } + private publishPersistence(): void { + this.options.emit({ + type: "session.persistence", + sessionId: this.options.id, + persistence: this.persistence(), + }); + } + private publishConfig(): void { + this.options.emit({ + type: "session.config", + sessionId: this.options.id, + config: { + model: this.config.model, + mode: this.config.mode, + thinkingOption: this.config.thinkingOption, + models: this.catalog.models, + modes, + thinkingOptions: + this.catalog.models.find((model) => model.id === this.config.model)?.thinkingOptions ?? + efforts.map((id) => ({ id, label: id })), + settings: [], + }, + }); + } +} +function mcpServer(server: ProviderMcpServerConfig): SessionMcpServerConfig { + if (server.type === "stdio") + return { + transport: "stdio", + command: server.command, + args: server.args, + env: server.env, + framing: "lineDelimitedJson", + }; + return { transport: "streamableHttp", url: server.url, headers: server.headers }; +} diff --git a/plugins/muse-provider/server/sessions.ts b/plugins/muse-provider/server/sessions.ts new file mode 100644 index 0000000000..93a22cd54b --- /dev/null +++ b/plugins/muse-provider/server/sessions.ts @@ -0,0 +1,57 @@ +import type { z } from "zod"; +import type { + ProviderInput, + ProviderLaunch, + ProviderSessionSummary, +} from "@getpaseo/plugin/server/provider"; +import { MspConnection } from "./connection.js"; +import { sessionListSchema } from "./wire.js"; + +export class Sessions { + private readonly hosts = new Set(); + async list( + launch: ProviderLaunch, + input: Extract, + ): Promise { + const host = new MspConnection({ launch }); + this.hosts.add(host); + try { + await host.initialize(); + const summaries: ProviderSessionSummary[] = []; + let cursor: string | null = null; + do { + const page: z.infer = await host.request( + "session/list", + { workspaceRoot: input.cwd, limit: Math.min(input.limit ?? 50, 200), cursor }, + sessionListSchema, + ); + for (const session of page.sessions) { + if (session.workspaceRoot === null) continue; + if ( + input.query && + !(session.title ?? "").toLowerCase().includes(input.query.toLowerCase()) + ) + continue; + summaries.push({ + cwd: session.workspaceRoot, + title: session.title, + updatedAt: session.updatedAt, + persistence: { + version: 1, + data: { sessionId: session.sessionId, model: session.modelId }, + }, + }); + if (input.limit && summaries.length >= input.limit) return summaries; + } + cursor = page.nextCursor; + } while (cursor !== null); + return summaries; + } finally { + await host.close(); + this.hosts.delete(host); + } + } + async close(): Promise { + await Promise.all([...this.hosts].map((host) => host.close())); + } +} diff --git a/plugins/muse-provider/server/settings.ts b/plugins/muse-provider/server/settings.ts new file mode 100644 index 0000000000..21586834ce --- /dev/null +++ b/plugins/muse-provider/server/settings.ts @@ -0,0 +1,17 @@ +import type { PluginSettings } from "@getpaseo/plugin/server"; +import { settingsSchema } from "../shared/settings.js"; +import { MuseError } from "./errors.js"; + +export async function serveArgs( + settings: PluginSettings, +): Promise { + const state = await settings.read(); + if (state.status === "invalid") throw new MuseError("invalidSettings", state.error); + const { sandbox, network, trustWorkspace } = state.values; + return [ + "--sandbox-network", + network, + ...(sandbox ? [] : ["--disable-sandbox"]), + ...(trustWorkspace ? ["--trust-workspace"] : []), + ]; +} diff --git a/plugins/muse-provider/server/timeline.ts b/plugins/muse-provider/server/timeline.ts new file mode 100644 index 0000000000..df786df125 --- /dev/null +++ b/plugins/muse-provider/server/timeline.ts @@ -0,0 +1,234 @@ +import { MspConnection } from "./connection.js"; +import { MuseError } from "./errors.js"; +import { todoSchema, outputSchema } from "./wire.js"; +import type { ProviderEvent } from "@getpaseo/plugin/server/provider"; +import type { z } from "zod"; +import type { + ProviderTimelineItem, + ProviderToolCallDetail, +} from "@getpaseo/plugin/server/provider"; +import { patchSchema, toolArgsSchema, deltaSchema, type WireItem } from "./wire.js"; + +export function unifiedDiff(content: string): string { + const patch = patchSchema.parse(JSON.parse(content)); + return patch.files + .map((file) => { + const hunks = file.hunks.map( + (hunk) => + `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@\n${hunk.lines.join("\n")}\n`, + ); + return `--- a/${file.path}\n+++ b/${file.path}\n${hunks.join("")}`; + }) + .join(""); +} + +function toolDetail(item: WireItem, patch?: string): ProviderToolCallDetail { + const parsed = toolArgsSchema.safeParse(parseArguments(item.args)); + if (!parsed.success) return { type: "unknown", input: item.args, output: item.visibleOutput }; + const args = parsed.data; + switch (item.tool) { + case "workflow": + case "subagent_spawn": + case "subagent_wait": + case "subagent_read_result": + return subAgentDetail(item, args); + case "shell": + case "bash": + return { + type: "shell", + command: item.commandText ?? args.command, + output: item.visibleOutput, + exitCode: item.exitCode, + }; + case "read_file": + return { type: "read", filePath: args.path, content: item.visibleOutput }; + case "edit_file": + return { + type: "edit", + filePath: args.path, + oldString: args.find, + newString: args.replace, + unifiedDiff: patch, + }; + case "write_file": + return { type: "write", filePath: args.path, content: args.content }; + case "grep": + case "glob": + case "ls": + case "web_search": + return { + type: "search", + query: args.query || args.pattern || args.path, + content: item.visibleOutput, + }; + case "web_fetch": + return { type: "fetch", url: args.url, result: item.visibleOutput }; + default: + return { type: "unknown", input: item.args, output: item.visibleOutput }; + } +} +function subAgentDetail( + item: WireItem, + args: z.infer, +): ProviderToolCallDetail { + return { + type: "sub_agent", + description: item.objective ?? item.entryId ?? args.objective, + subAgentType: item.role ?? args.role, + childSessionId: item.childSessionId, + log: item.message || item.visibleOutput || item.fallbackText, + }; +} + +function parseArguments(args: string): unknown { + try { + return JSON.parse(args); + } catch { + return args; + } +} + +export function timelineItem( + item: WireItem, + clientMessageId?: string, + patch?: string, +): ProviderTimelineItem { + const id = item.itemId; + switch (item.kind) { + case "userMessage": + return { type: "user_message", id, text: item.displayText ?? item.text, clientMessageId }; + case "agentMessage": + return { type: "assistant_message", id, text: item.text }; + case "reasoning": + return { type: "reasoning", id, text: item.summary.join("\n") }; + case "compaction": + return { + type: "compaction", + id, + status: item.status === "inProgress" ? "loading" : "completed", + preTokens: item.tokensBefore, + }; + case "workflow": + case "subagent": + case "toolCall": { + return toolCallItem(item, patch); + } + default: + return { + type: "tool_call", + id, + callId: id, + name: item.kind, + status: "completed", + error: null, + detail: { type: "plain_text", label: item.kind, text: item.fallbackText }, + }; + } +} + +function toolCallItem(item: WireItem, patch?: string): ProviderTimelineItem { + const id = item.itemId; + const base = { + type: "tool_call", + id, + callId: item.callId ?? id, + name: item.kind === "toolCall" ? item.tool : item.kind, + detail: + item.kind === "subagent" || item.kind === "workflow" + ? { + type: "sub_agent" as const, + subAgentType: item.role, + description: item.objective ?? item.entryId, + childSessionId: item.childSessionId, + log: item.message || item.visibleOutput || item.fallbackText, + } + : toolDetail(item, patch), + } as const; + if (item.status === "inProgress") return { ...base, status: "running", error: null }; + if (item.status === "cancelled") return { ...base, status: "canceled", error: null }; + if (item.status !== "completed") + return { ...base, status: "failed", error: item.failureReason ?? item.status }; + return { ...base, status: "completed", error: null }; +} + +export function appendDelta( + previous: WireItem, + delta: z.infer, +): WireItem | null { + if (delta.field === "text") return { ...previous, text: previous.text + delta.delta }; + if (delta.field === "output") + return { ...previous, visibleOutput: previous.visibleOutput + delta.delta }; + const match = /^summary\.(\d+)$/.exec(delta.field); + if (!match) return null; + const index = Number(match[1]); + const summary = [...previous.summary]; + summary[index] = (summary[index] ?? "") + delta.delta; + return { ...previous, summary }; +} + +export class Timeline { + private readonly items = new Map(); + constructor( + private readonly host: MspConnection, + private readonly nativeId: string, + private readonly id: string, + private readonly emit: (event: ProviderEvent) => void, + private readonly clientMessage: (commandId: string) => string | undefined = () => undefined, + ) {} + async fold(item: WireItem): Promise { + // Reminder children are Muse housekeeping, not agent work or navigable subagents. + if (item.kind === "reminderChild") return false; + const previous = this.items.get(item.itemId); + if (previous && previous.revision >= item.revision) return false; + let patch; + if (item.patchRef && item.status === "completed") { + const output = await this.host.request( + "item/readOutput", + { sessionId: this.nativeId, itemId: item.itemId, outputRef: item.patchRef.id }, + outputSchema, + ); + if (output.encoding !== "utf8" || !output.eof) + throw new MuseError("invalidPatch", "Muse edit patch is not a complete UTF-8 document"); + patch = unifiedDiff(output.content); + } + this.items.set(item.itemId, item); + this.emit({ + type: "timeline.item", + sessionId: this.id, + item: timelineItem( + item, + item.commandId ? this.clientMessage(item.commandId) : undefined, + patch, + ), + timestamp: item.recordedAt, + }); + return true; + } + delta(delta: z.infer): void { + const previous = this.items.get(delta.itemId); + if (!previous || previous.status !== "inProgress") return; + const item = appendDelta(previous, delta); + if (!item) return; + this.items.set(item.itemId, item); + this.emit({ type: "timeline.item", sessionId: this.id, item: timelineItem(item) }); + } +} + +export function todoItem(input: unknown): ProviderTimelineItem { + const todo = todoSchema.parse(input); + return { + type: "todo", + id: `todo:${todo.viewCursor}`, + items: todo.items.map((item) => { + let status: "pending" | "in_progress" | "completed" = "pending"; + if (item.status === "inProgress") status = "in_progress"; + else if (item.status === "completed") status = "completed"; + return { + text: item.text, + completed: item.status === "completed", + status, + activeForm: item.activeForm, + }; + }), + }; +} diff --git a/plugins/muse-provider/server/usage.ts b/plugins/muse-provider/server/usage.ts new file mode 100644 index 0000000000..a60b0a34b2 --- /dev/null +++ b/plugins/muse-provider/server/usage.ts @@ -0,0 +1,111 @@ +import { homedir } from "node:os"; +import path from "node:path"; +import { z } from "zod"; +import type { UsageSourceRegistration } from "@getpaseo/plugin/server"; +import type { ProviderLaunch } from "@getpaseo/plugin/server/provider"; +import { + hashAccountKey, + unavailableUsage, + windowFromUsedPct, + toneFromUsedPct, +} from "@getpaseo/plugin/server/usage"; + +import { MspConnection } from "./connection.js"; +import { usageSchema } from "./wire.js"; + +const inputSchema = z.object({ account: z.string() }).strict(); +type Observation = z.infer; +export class Usage { + private readonly launches = new Map(); + private readonly sessions = new Map< + string, + { account: string; read: () => Promise } + >(); + remember(launch: ProviderLaunch): { account: string } { + // MSP 1.4.1 has no stable account ID; swapping accounts in one config directory shares a report ID. + const configHome = + launch.env.XDG_CONFIG_HOME ?? path.join(launch.env.HOME ?? homedir(), ".config"); + const key = hashAccountKey(path.resolve(configHome, "muse")); + this.launches.set(key, launch); + return { account: key }; + } + attach(id: string, launch: ProviderLaunch, read: () => Promise): void { + this.sessions.set(id, { ...this.remember(launch), read }); + } + detach(id: string): void { + this.sessions.delete(id); + } + private async read(account: string, launch: ProviderLaunch): Promise { + const readers = [...this.sessions.values()].filter((session) => session.account === account); + if (readers.length > 0) { + const observations = await Promise.all(readers.map((session) => session.read())); + const usages = observations.flatMap((observation) => + observation.usage ? [observation.usage] : [], + ); + usages.sort((a, b) => b.observedAtMs - a.observedAtMs); + return usages.length > 0 ? { usage: usages[0] } : {}; + } + const host = new MspConnection({ launch }); + try { + await host.initialize(); + return await host.request("usage/read", {}, usageSchema); + } finally { + await host.close(); + } + } + registration(): UsageSourceRegistration { + return { + id: "muse", + label: "Muse Code", + icon: "icon.svg", + input: inputSchema, + discover: async () => [...this.launches.keys()].map((account) => ({ account })), + identify: async (input) => { + const { account } = inputSchema.parse(input); + return this.launches.has(account) ? { key: account, label: "Muse Code" } : null; + }, + fetch: async (input) => { + const { account } = inputSchema.parse(input); + const launch = this.launches.get(account); + if (!launch) return unavailableUsage(); + try { + const { usage } = await this.read(account, launch); + if (!usage) return unavailableUsage(); + return { + status: "available", + planLabel: usage.tier, + windows: [ + windowFromUsedPct({ + id: "five_hour", + label: `${usage.window.windowDurationMins / 60} hours`, + utilizationPct: usage.window.usedPercent, + resetsAt: new Date(usage.window.resetsAtMs).toISOString(), + tone: toneFromUsedPct(usage.window.usedPercent), + }), + windowFromUsedPct({ + id: "weekly", + label: "Weekly", + utilizationPct: usage.weekly.usedPercent, + resetsAt: new Date(usage.weekly.resetsAtMs).toISOString(), + tone: toneFromUsedPct(usage.weekly.usedPercent), + }), + ], + details: [ + { + id: "observed", + label: "Observed", + value: new Date(usage.observedAtMs).toISOString(), + }, + ], + }; + } catch (error) { + return { + status: "error", + windows: [], + error: error instanceof Error ? error.message : String(error), + }; + } + }, + }; + } +} diff --git a/plugins/muse-provider/server/wire.ts b/plugins/muse-provider/server/wire.ts new file mode 100644 index 0000000000..4955acdaa5 --- /dev/null +++ b/plugins/muse-provider/server/wire.ts @@ -0,0 +1,278 @@ +import { z } from "zod"; + +export const fingerprint = + "sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f"; +export const effortSchema = z.enum([ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max", + "ultra", +]); +export const approvalModeSchema = z.enum([ + "onRequest", + "promptUnmatched", + "denyUnmatched", + "allowAll", +]); +export const itemSchema = z.object({ + itemId: z.string(), + revision: z.number().int(), + childSessionId: z.string().optional(), + role: z.string().optional(), + objective: z.string().optional(), + message: z.string().default(""), + entryId: z.string().optional(), + kind: z.string(), + status: z.string(), + turnId: z.string().nullable().optional(), + commandId: z.string().optional(), + recordedAt: z.string().optional(), + text: z.string().default(""), + displayText: z.string().optional(), + summary: z.array(z.string()).default([]), + tool: z.string().default(""), + args: z.string().default("{}"), + callId: z.string().optional(), + commandText: z.string().optional(), + visibleOutput: z.string().default(""), + exitCode: z.number().optional(), + fallbackText: z.string().default(""), + failureReason: z.string().optional(), + patchRef: z.object({ id: z.string() }).optional(), + tokensBefore: z.number().optional(), +}); +export type WireItem = z.infer; +export const requirementSchema = z.object({ + approvalId: z.string(), + sourceIndex: z.number().optional(), +}); +export const choiceSchema = z.object({ + choiceId: z.string(), + decision: z.string(), + label: z.string(), + scope: z.string(), +}); +export const approvalSchema = z.object({ + approvalId: z.string(), + currentRequirementId: requirementSchema.optional(), + availableChoices: z.array(choiceSchema), + toolName: z.string().default("Tool"), + subject: z.object({ + kind: z.string(), + command: z.string().default(""), + path: z.string().default(""), + host: z.string().default(""), + workspaceRoot: z.string().optional(), + stages: z + .array( + z.object({ + position: z.number(), + totalStages: z.number(), + argv: z.array(z.string()), + requirementId: requirementSchema, + resolution: z.object({ kind: z.string() }), + }), + ) + .default([]), + }), +}); +export type WireApproval = z.infer; +export const notificationSchema = z.object({ + sessionId: z.string().optional(), + viewCursor: z.string().optional(), +}); +export const frameSchema = z.object({ + jsonrpc: z.literal("2.0"), + id: z.union([z.string(), z.number()]).optional(), + method: z.string().optional(), + params: z.unknown().optional(), + result: z.unknown().optional(), + error: z + .object({ + code: z.number(), + message: z.string(), + data: z + .object({ kind: z.string().optional(), reason: z.string().optional() }) + .passthrough() + .optional(), + }) + .optional(), +}); +export const initializedSchema = z.object({ schema: z.object({ fingerprint: z.string() }) }); +export const accountSchema = z.object({ + state: z.string(), +}); +export const catalogSchema = z.object({ + models: z.array( + z.object({ + modelId: z.string(), + providerId: z.string(), + displayLabel: z.string(), + contextLimit: z.number().nullable(), + isDefault: z.boolean(), + defaultReasoningEffort: effortSchema.nullable().optional(), + reasoningEffortVariants: z.union([z.array(effortSchema), z.literal("unknown")]).default([]), + variants: z.array(effortSchema).default([]), + }), + ), +}); +export const sessionSchema = z.object({ + session: z.object({ + sessionId: z.string(), + modelId: z.string(), + providerId: z.string(), + approvalMode: z.object({ mode: approvalModeSchema }).optional(), + }), + viewCursor: z.string(), + history: z + .object({ mode: z.string(), items: z.array(itemSchema).nullable().default([]) }) + .optional(), + pendingRequests: z + .array( + z.object({ kind: z.string(), approvalId: z.string().optional(), viewCursor: z.string() }), + ) + .default([]), +}); +export const persistenceSchema = z.object({ + sessionId: z.string(), + cursor: z.string().optional(), + model: z.string().optional(), + thinkingOption: effortSchema.optional(), +}); +export const deltaSchema = z.object({ itemId: z.string(), field: z.string(), delta: z.string() }); +export const turnSchema = z.object({ + turnId: z.string(), + commandId: z.string().optional(), + terminal: z.string().optional(), + error: z.object({ kind: z.string(), message: z.string() }).optional(), +}); +export const promptResultSchema = z.object({ turnId: z.string(), disposition: z.string() }); +export const outputSchema = z.object({ + content: z.string(), + encoding: z.enum(["utf8", "base64"]), + eof: z.boolean(), +}); +export const patchSchema = z.object({ + files: z.array( + z.object({ + path: z.string(), + hunks: z.array( + z.object({ + oldStart: z.number(), + oldLines: z.number(), + newStart: z.number(), + newLines: z.number(), + lines: z.array(z.string()), + }), + ), + }), + ), +}); +export const toolArgsSchema = z.object({ + objective: z.string().optional(), + role: z.string().optional(), + command: z.string().default(""), + path: z.string().default(""), + find: z.string().optional(), + replace: z.string().optional(), + content: z.string().optional(), + query: z.string().default(""), + pattern: z.string().default(""), + url: z.string().default(""), +}); +export const tokenUsageSchema = z.object({ + cumulative: z.object({ promptTokens: z.number(), outputTokens: z.number() }), + usage: z.object({ cachedTokens: z.number().optional() }).optional(), +}); +export const contextUsageSchema = z.object({ + usedTokens: z.number(), + windowTokens: z.number().optional(), +}); + +export const ackSchema = z.object({}).passthrough(); +export const skillsSchema = z.object({ + skills: z.array( + z.object({ + selector: z.string(), + description: z.string(), + argumentHint: z.string().optional(), + }), + ), +}); +export const questionSchema = z.object({ + userInputId: z.string(), + toolName: z.string(), + questions: z.array( + z.object({ + id: z.string(), + header: z.string(), + question: z.string(), + options: z.array(z.object({ label: z.string(), description: z.string().default("") })), + selection: z.object({ + mode: z.enum(["single", "multiple"]), + minSelections: z.number().optional(), + maxSelections: z.number().optional(), + }), + }), + ), +}); +export const settledQuestionSchema = z.object({ userInputId: z.string() }); +export const questionAnswersSchema = z.object({ answers: z.record(z.string(), z.string()) }); +export const todoSchema = z.object({ + viewCursor: z.string(), + items: z.array( + z.object({ text: z.string(), status: z.string(), activeForm: z.string().optional() }), + ), +}); +export const pageSchema = z.object({ + events: z.array(z.object({ method: z.string(), params: z.record(z.string(), z.unknown()) })), + nextCursor: z.string().nullable(), +}); +export const gapSchema = z.object({ after: z.string(), next: z.string() }); +export const sessionListSchema = z.object({ + nextCursor: z.string().nullable(), + sessions: z.array( + z.object({ + sessionId: z.string(), + workspaceRoot: z.string().nullable(), + title: z.string().optional(), + updatedAt: z.string(), + modelId: z.string(), + }), + ), +}); +export const usageSchema = z.object({ + usage: z + .object({ + observedAtMs: z.number(), + tier: z.string(), + window: z.object({ + resetsAtMs: z.number(), + usedPercent: z.number(), + windowDurationMins: z.number(), + }), + weekly: z.object({ resetsAtMs: z.number(), usedPercent: z.number() }), + }) + .optional(), +}); +export const childSessionSchema = z.object({ + session: z.object({ + sessionId: z.string(), + workspaceRoot: z.string().nullable(), + title: z.string().optional(), + }), + viewCursor: z.string(), +}); + +export const itemNotificationSchema = z.object({ item: itemSchema }); + +export const pendingSchema = z.object({ + approvals: z.array(approvalSchema), + userInputs: z.array(questionSchema).default([]), +}); + +export const approvalResolvedSchema = z.object({ approvalId: z.string() }); diff --git a/plugins/muse-provider/shared/settings.ts b/plugins/muse-provider/shared/settings.ts new file mode 100644 index 0000000000..f1af368e8c --- /dev/null +++ b/plugins/muse-provider/shared/settings.ts @@ -0,0 +1,24 @@ +import { z } from "zod"; +import { defineSettings } from "@getpaseo/plugin"; + +export const settingsSchema = z.object({ + sandbox: z + .boolean() + .default(true) + .describe("Keep Muse filesystem and network sandboxing enabled"), + network: z + .enum(["proxy-only", "restricted", "enabled"]) + .default("proxy-only") + .describe("Sandbox network access; disabling sandbox forces full network access"), + trustWorkspace: z + .boolean() + .default(false) + .describe("Let Muse load project-scoped skills and config from the workspace"), +}); + +export const museSettings = defineSettings({ + id: "muse", + scope: "host", + version: 1, + schema: settingsSchema, +}); diff --git a/plugins/muse-provider/test/fake-muse.mjs b/plugins/muse-provider/test/fake-muse.mjs new file mode 100644 index 0000000000..fffca0cc89 --- /dev/null +++ b/plugins/muse-provider/test/fake-muse.mjs @@ -0,0 +1,404 @@ +import { appendFileSync, readFileSync } from "node:fs"; +import { createInterface } from "node:readline"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = path.join(path.dirname(fileURLToPath(import.meta.url)), "fixtures"); +const scenario = process.env.MUSE_TEST_SCENARIO || "text-reasoning"; +if (process.argv.includes("--version")) { + process.stdout.write(`Muse Code ${process.env.MUSE_TEST_VERSION || "1.4.1"}\n`); + process.exit(0); +} +const rows = readFixture(scenario); +if (process.env.MUSE_TEST_REQUESTS) + appendFileSync( + process.env.MUSE_TEST_REQUESTS, + JSON.stringify({ event: "hostStarted", args: process.argv.slice(2) }) + "\n", + ); +const catalogRows = readFixture("catalog-controls"); +const replacements = new Map(); +const counts = new Map(); +const receipts = new Set(); +const lines = createInterface({ input: process.stdin }); +lines.on("line", receive); +function receive(line) { + const frame = JSON.parse(line); + if (process.env.MUSE_TEST_REQUESTS) + appendFileSync(process.env.MUSE_TEST_REQUESTS, JSON.stringify(frame) + "\n"); + if (frame.result) { + receipts.delete(frame.id); + return; + } + if (controlResponse(frame)) return; + if (queuedResponse(frame)) return; + const candidates = rows.filter((row) => row.dir === "out" && row.msg.method === frame.method); + const count = counts.get(frame.method) || 0; + counts.set(frame.method, count + 1); + if (retryResponse(frame, count)) return; + const request = candidates[count]; + if (!request) + return rpcError( + frame, + -32601, + "unknownMethod", + `No fixture request for ${frame.method} #${count}`, + ); + const recorded = request.msg; + validateCommand(frame, recorded); + const response = rows.find( + (row) => row.dir === "in" && row.msg.id === recorded.id && !row.msg.method, + ); + if (!response) throw new Error(`Fixture response absent: ${frame.method}`); + const position = rows.indexOf(request); + let end = position + 1; + while (end < rows.length && !(rows[end].dir === "out" && rows[end].msg.method)) end++; + const messages = rows.slice(position + 1, end).filter((row) => row.dir === "in"); + if (!messages.includes(response)) messages.unshift(response); + if (process.env.MUSE_TEST_ACK_LAST && frame.method === "turn/start") { + const terminalFirst = messages.filter((row) => row !== response); + for (const row of terminalFirst) emitFixtureMessage(row.msg, recorded, frame); + setTimeout(() => emitFixtureMessage(response.msg, recorded, frame), 50); + } else for (const row of messages) emitFixtureMessage(row.msg, recorded, frame); +} +function controlResponse(frame) { + if (frame.method === "initialized") return true; + if (frame.method === "initialize" && process.env.MUSE_TEST_EXIT) { + process.stderr.write("diagnostic tail, not protocol\n"); + process.exit(Number(process.env.MUSE_TEST_EXIT)); + } + if (process.env.MUSE_TEST_HANG === frame.method) return true; + if (frame.method === "session/setReasoningEffort") { + respond(frame, { status: "accepted", commandId: frame.params.commandId }); + return true; + } + if (frame.method === "account/read") { + respond(frame, { credentialRequired: true, state: process.env.MUSE_TEST_ACCOUNT || "envKey" }); + return true; + } + if (parityResponse(frame)) return true; + if (frame.method === "model/list") { + const result = responseFor(catalogRows, "model/list"); + if (process.env.MUSE_TEST_MODELS) result.models = JSON.parse(process.env.MUSE_TEST_MODELS); + respond(frame, result); + return true; + } + if (frame.method === "session/resume" && process.env.MUSE_TEST_GONE) { + rpcError(frame, -32020, "sessionNotFound", "missing"); + return true; + } + return false; +} +function parityResponse(frame) { + if (workflowResponse(frame)) return true; + if (frame.method === "view/page") { + let result; + if (process.env.MUSE_TEST_GAP || process.env.MUSE_TEST_SILENT) { + result = { + events: replace( + rows + .filter( + (row) => + row.dir === "in" && + row.msg.method && + row.msg.params?.viewCursor && + !row.msg.id && + row.msg.method !== "item/delta", + ) + .map((row) => ({ method: row.msg.method, params: row.msg.params })), + ), + nextCursor: null, + }; + } else { + result = replace( + responseFor( + readFixture( + frame.params.sessionId === "fixture-child" ? "phase3-child-read" : "phase3-controls", + ), + "view/page", + ), + ); + for (const event of result.events) event.params.sessionId = frame.params.sessionId; + } + respond(frame, result); + return true; + } + if (frame.method === "session/read") { + const result = responseFor(readFixture("phase3-child-read"), "session/read"); + result.session.sessionId = frame.params.sessionId; + respond(frame, result); + return true; + } + if (frame.method === "usage/read") { + const result = process.env.MUSE_TEST_USAGE + ? JSON.parse(process.env.MUSE_TEST_USAGE) + : responseFor(catalogRows, "usage/read"); + respond(frame, result); + return true; + } + if (frame.method === "session/list") { + const result = responseFor(catalogRows, "session/list"); + result.nextCursor = null; + respond(frame, result); + return true; + } + if (frame.method === "userInput/cancel" && scenario !== "phase3-cancel") { + respond(frame, { + status: "accepted", + commandId: frame.params.commandId, + userInputId: frame.params.userInputId, + }); + send({ + jsonrpc: "2.0", + method: "userInput/settled", + params: { + sessionId: frame.params.sessionId, + userInputId: frame.params.userInputId, + outcome: "cancelled", + }, + }); + return true; + } + if (frame.method === "session/compact" && process.env.MUSE_TEST_COMPACT) { + respond(frame, { status: "accepted", commandId: frame.params.commandId }); + for (const [revision, status] of [ + [1, "inProgress"], + [2, "completed"], + ]) + send({ + jsonrpc: "2.0", + method: revision === 1 ? "item/started" : "item/completed", + params: { + sessionId: frame.params.sessionId, + item: { itemId: "fixture-compaction", revision, kind: "compaction", status }, + }, + }); + return true; + } + if (skillResponse(frame)) return true; + return false; +} +function skillResponse(frame) { + if (frame.method === "skill/list") { + const skillRows = + scenario.startsWith("phase3-") && rows.some((row) => row.msg.method === "skill/list") + ? rows + : readFixture("skill"); + const result = responseFor(skillRows, "skill/list"); + if (process.env.MUSE_TEST_SKILLS_CHANGED && counts.has("skill-read")) result.skills = []; + counts.set("skill-read", 1); + respond(frame, result); + return true; + } + return false; +} + +function workflowResponse(frame) { + if (frame.method === "view/page" && process.env.MUSE_TEST_WORKFLOW) { + const result = responseFor(readFixture("phase3-default-workflow"), "view/page"); + result.events = result.events.filter( + (event) => event.params.item?.kind === "workflow" || event.params.item?.tool === "workflow", + ); + for (const event of result.events) event.params.sessionId = frame.params.sessionId; + respond(frame, result); + return true; + } + return false; +} + +function queuedResponse(frame) { + if ( + process.env.MUSE_TEST_QUEUE && + frame.method === "turn/start" && + counts.get(frame.method) === 1 + ) { + respond(frame, { + turnId: frame.params.commandId, + disposition: "queued", + startedNewTurn: false, + }); + return true; + } + return false; +} +function retryResponse(frame, count) { + if (process.env.MUSE_TEST_RETRY === frame.method && count === 0) { + counts.set(frame.method, 0); + delete process.env.MUSE_TEST_RETRY; + replacements.set("retryCommandId", frame.params.commandId); + rpcError(frame, -32001, process.env.MUSE_TEST_RETRY_KIND || "overloaded", "busy"); + return true; + } + if ( + replacements.has("retryCommandId") && + replacements.get("retryCommandId") !== frame.params.commandId + ) + throw new Error("Retry changed commandId"); + replacements.delete("retryCommandId"); + return false; +} +function validateCommand(frame, recorded) { + if (recorded.params.commandId) { + if ( + !/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test( + frame.params.commandId, + ) + ) + throw new Error("Not UUIDv7"); + replacements.set(recorded.params.commandId, frame.params.commandId); + } + if ( + frame.method === "approval/decide" && + recorded.params.requirementId.sourceIndex !== frame.params.requirementId.sourceIndex + ) + throw new Error("Wrong approval stage"); +} +function emitFixtureMessage(recordedMessage, recorded, frame) { + const message = replace(recordedMessage); + if (!message.method && message.id === recorded.id) message.id = frame.id; + if ( + message.method === "session/closed" || + (message.method === "session/statusChanged" && message.params.status === "notLoaded") + ) + return; + if (frame.method === "session/start" && message.result?.session?.approvalMode) + message.result.session.approvalMode.mode = frame.params.approvalMode; + if (message.result?.viewCursor && process.env.MUSE_TEST_EMPTY_CURSOR) + message.result.viewCursor = ""; + applyTestVariants(message); + if (parityDelivery(message)) return; + if (message.method && message.id !== undefined) receipts.add(message.id); + send(message); + if ( + process.env.MUSE_TEST_STALE && + message.method === "item/completed" && + message.params.item.kind === "agentMessage" + ) { + send({ + ...message, + params: { + ...message.params, + item: { ...message.params.item, revision: 1, text: "STALE_REVISION" }, + }, + }); + } +} +function parityDelivery(message) { + if (process.env.MUSE_TEST_WORKFLOW && message.method === "turn/completed") + send({ + jsonrpc: "2.0", + method: "view/gap", + params: { sessionId: message.params.sessionId, after: "", next: message.params.viewCursor }, + }); + if ( + process.env.MUSE_TEST_SILENT && + ["item/started", "item/delta", "item/completed", "turn/completed"].includes(message.method) && + message.params.item?.kind !== "userMessage" + ) + return true; + if ( + process.env.MUSE_TEST_GAP && + message.method === "item/completed" && + message.params.item.kind === "agentMessage" + ) { + send({ + jsonrpc: "2.0", + method: "view/gap", + params: { + sessionId: message.params.sessionId, + after: "fixture-last-cursor", + next: message.params.viewCursor, + }, + }); + return true; + } + if (process.env.MUSE_TEST_SKILLS_CHANGED && message.method === "turn/completed") + send({ + jsonrpc: "2.0", + method: "skill/changed", + params: { sessionId: message.params.sessionId }, + }); + return false; +} +function applyTestVariants(message) { + applyParityVariants(message); + if (message.method === "turn/completed" && process.env.MUSE_TEST_INTERRUPT_TERMINAL) + message.params.terminal = process.env.MUSE_TEST_INTERRUPT_TERMINAL; + if (message.params?.availableChoices && process.env.MUSE_TEST_CHOICES) + message.params.availableChoices = message.params.availableChoices.toReversed(); + if (message.method === "turn/completed" && process.env.MUSE_TEST_AUTH_REQUIRED) { + message.params.terminal = "failed"; + message.params.error = { kind: "authRequired", message: "authentication expired" }; + } + if (message.result?.schema && process.env.MUSE_TEST_FINGERPRINT) + message.result.schema.fingerprint = process.env.MUSE_TEST_FINGERPRINT; + if (message.params?.item?.tool === "read_file" && process.env.MUSE_TEST_TOOL) { + message.params.item.tool = process.env.MUSE_TEST_TOOL; + message.params.item.args = JSON.stringify({ + path: "f", + query: "needle", + url: "https://example.com", + }); + } + if (message.params?.item?.tool === "read_file" && process.env.MUSE_TEST_UNKNOWN_KIND) { + message.params.item.kind = "futureItem"; + message.params.item.fallbackText = "New MSP item"; + } +} +function applyParityVariants(message) { + if (process.env.MUSE_TEST_CHILD && message.params?.item?.tool === "subagent_spawn") { + message.params.item.childSessionId = "fixture-child"; + if (process.env.MUSE_TEST_CHILD === "workflow") message.params.item.kind = "workflow"; + if (process.env.MUSE_TEST_CHILD === "dedicated") { + message.params.item.kind = "subagent"; + message.params.item.role = "worker"; + message.params.item.objective = "Child objective"; + } + } + if (message.params?.availableChoices && process.env.MUSE_TEST_DENIED) + message.params.availableChoices.push({ + choiceId: "reject_once", + decision: "denied", + scope: "once", + label: "Reject tool", + }); +} +lines.on("close", () => { + if (process.env.MUSE_TEST_REQUESTS) + appendFileSync(process.env.MUSE_TEST_REQUESTS, JSON.stringify({ event: "hostClosed" }) + "\n"); + if (receipts.size) throw new Error("Missing presentation receipt"); +}); +function readFixture(name) { + const transcript = readFileSync(path.join(root, name + ".ndjson"), "utf8") + .trim() + .split("\n") + .map((line) => JSON.parse(line)); + // The duplicate-decision probe is a separate negative action, not part of the approval flow. + const duplicateIds = new Set( + transcript + .filter((row) => row.msg.error?.data?.kind === "approvalAlreadyResolved") + .map((row) => row.msg.id), + ); + return transcript.filter((row) => !duplicateIds.has(row.msg.id)); +} +function responseFor(transcript, method) { + const request = transcript.find((row) => row.dir === "out" && row.msg.method === method); + return transcript.find( + (row) => row.dir === "in" && row.msg.id === request.msg.id && !row.msg.method, + ).msg.result; +} +function replace(value) { + if (typeof value === "string") return replacements.get(value) || value; + if (Array.isArray(value)) return value.map(replace); + if (value && typeof value === "object") + return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, replace(entry)])); + return value; +} +function send(frame) { + process.stdout.write(JSON.stringify(frame) + "\n"); +} +function respond(frame, result) { + send({ jsonrpc: "2.0", id: frame.id, result }); +} +function rpcError(frame, code, kind, message) { + send({ jsonrpc: "2.0", id: frame.id, error: { code, message, data: { kind } } }); +} diff --git a/plugins/muse-provider/test/fixtures/README.md b/plugins/muse-provider/test/fixtures/README.md new file mode 100644 index 0000000000..b294bf4a0b --- /dev/null +++ b/plugins/muse-provider/test/fixtures/README.md @@ -0,0 +1,78 @@ +# Muse MSP fixtures + +Captured on Linux on 2026-09-29 from Muse Code **1.4.1 (1.4.1-R4503.1)**, +build `35815c253477406321e3f5595195becc25e3907a`. + +- Stable handshake fingerprint: `sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f`. +- Experimental export fingerprint: `sha256:b359d70b581b0ea471d35a7770d3039fdd35f19a46a2d42b43fd4b1674d52c8a`. +- Schema version: `1`. Both `sessionMcp` and `sessionListStream` were granted. + +Each line is `{ "dir": "out" | "in", "msg": }`. +`out` means client to host; `in` means host to client. IDs, timestamps, cursors, +revisions, deltas, and event order are retained. Replay consumers should treat IDs +and cursors as opaque and compare behavior rather than wall-clock values. +The skill catalogs retain only the test selectors `phase0` and `muse-parity-*`; unrelated personal, +bundled, and installed-plugin skill rows were removed. No credentials are included. + +A throwaway driver launched `muse serve` with isolated `XDG_CONFIG_HOME` and +`XDG_DATA_HOME`. Model turns used a custom Responses endpoint, an environment key, +`providerId: "meta"`, and `modelId: "meta/muse-spark-1.3"`. The settings pinned the +endpoint's `auth: "bearer"`, the default provider/model, and permission profile +`:ask-me` with its own `schema_version: 1`. The sandbox and default `proxy-only` +network policy remained enabled. Workspace trust was enabled for project skills. +The approval judge was disabled for staged approval probes so decisions reached +the client. The driver and local server remain outside the repository. + +| File | Recorded behavior | +| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `text-reasoning.ndjson` | Session start, rational-sum prompt, public reasoning summary, streamed assistant text, token usage, terminal. | +| `tools-edit.ndjson` | Read `f`, run `wc -l f`, replace `beta` with `gamma`; fetch the JSON patch through `patchRef` and `item/readOutput`. | +| `staged-approval.ndjson` | `wc -l f && rm -rf f`: safe first stage, held second stage, receipt and decision, terminal resolution. Also records a duplicate decision rejected as already resolved. | +| `multi-stage-approval.ndjson` | `wc -l f && rm -rf f && rm -rf g`: successive decisions return `terminal: false`, then `true`; both files are removed. | +| `interrupt.ndjson` | Interrupt a running shell sleep; tool reconciliation and `turn/completed` with `terminal: "cancelled"`. | +| `steer.ndjson` | Submit `ifBusy: "steer"` during a shell sleep; accepted as `steered`, and the original turn replies with the replacement marker. | +| `resume-source.ndjson` | Complete a marker turn, then kill the host process before starting either resume probe. | +| `resume-without-cursor.ndjson` | New host returns inline history and runs a fresh turn recalling the marker. | +| `resume-with-cursor.ndjson` | New host returns `history.mode: "none"`, replays the cursor suffix, then completes a fresh marker turn. | +| `resume-reasoning.ndjson` | New host resumes the steering session, including its reasoning history, and completes another text turn. | +| `subagent.ndjson` | Native spawn/wait/read-result tool calls return a child result marker and an evidence log path. This build emits `toolCall`, without a dedicated `subagent` item. | +| `skill.ndjson` | Discover the project skill and invoke its selector through a structured skill input part. | +| `image-followup.ndjson` | Send a valid 16×16 PNG, then complete a text-only marker turn in the same session. Image-description accuracy is not asserted. | +| `catalog-controls.ndjson` | Model catalog, environment-key account state, empty subscription usage, paginated sessions, approval mode change, valid model selection, and rejection of a model outside the catalog. | +| `mcp-stdio.ndjson` | Admit a session-scoped stdio server. Model attempts fail with an unknown-tool routing error and no marker is returned; this is a failure fixture. | +| `auto-review-unavailable.ndjson` | Selecting `:auto-review` as the default profile rejects session start because the automated reviewer is unavailable. | +| `unsafe-path.ndjson` | Group-writable data directory rejects session start with `UnsafePath`. | +| `initialize-history.ndjson` | Handshake against 322 retained session logs (7,713,541 bytes); three measured launches took 155–160 ms. | + +The project skill body was “Reply with exactly SKILL_PHASE0_OK. Do not use tools.” +The injected stdio server implemented `initialize`, `tools/list`, and `tools/call`, +advertised `verification_echo` with an empty-object input schema, and returned +`MCP_PHASE0_OK` as text. The host registered `mcp__verification__verification_echo`, +but the model route attempted the unqualified `verification_echo`; the marker +was never delivered. Keep this distinction when testing MCP support. + +Phase 3 captures use the same build and isolated custom route. Sandbox and network +remain at their defaults. `phase3-user-skill` omits workspace trust; +`phase3-project-skill` enables it. Native subagent captures enable +`MUSE_EXPERIMENTAL_SDK_ENABLED=on`; the default workflow capture reads the session +from a daemon run that omitted the flag. Its workflow child IDs are internal +activity IDs, not MSP `childSessionId` values. + +| File | Recorded behavior | +| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `phase3-controls.ndjson` | Two todo entries, a single-choice question, an answer and matching settlement, retained view paging, empty subscription usage. | +| `phase3-cancel.ndjson` | Question cancellation and matching cancelled settlement. | +| `phase3-child-read.ndjson` | Read and page an actual native child session, returning its assistant marker. | +| `phase3-default-workflow.ndjson` | Read and page the default daemon run: workflow revisions 1–7, child activity, and `MUSE_PARITY_CHILD_OK`; no `childSessionId`. | +| `phase3-user-skill.ndjson` | User-scoped skill catalog and structured invocation, returning `MUSE_PARITY_USER_OK` with trust off. | +| `phase3-project-skill.ndjson` | Project-scoped skill catalog and invocation, returning `MUSE_PARITY_PROJECT_OK` with trust on. | +| `phase3-compact.ndjson` | Resume a completed session; manual compaction rejects with `compaction_unavailable`. | +| `phase3-compact-history.ndjson` | Resume three completed turns; catalog context limit is null and compaction still rejects. | +| `phase3-compact-limit.ndjson` | Same session and route with only a configured context limit; compaction is admitted and completes, reducing 22,192 tokens to 21,322. | + +The subprocess fixture host also generates schema-based variants for dedicated +subagent items, explicit child-session linkage, nonempty subscription windows, +`skill/changed`, deny choices, lost events, watchdog silence, and late admission. +These variants test protocol behavior; they are not claimed as real-host captures. +The workflow replay triggers a generated gap to page the recorded default run. +Disk edits in a live host did not emit `skill/changed` during a 15-second probe. diff --git a/plugins/muse-provider/test/fixtures/auto-review-unavailable.ndjson b/plugins/muse-provider/test/fixtures/auto-review-unavailable.ndjson new file mode 100644 index 0000000000..3d6f6a8e83 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/auto-review-unavailable.ndjson @@ -0,0 +1,5 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee48-a7c2-73c7-aab0-d5550547b265","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"error":{"code":-32603,"data":{"kind":"internal"},"message":"internal error: compose session permission profile: permission profile ':auto-review' cannot be used: the automated reviewer is unavailable on this host"},"id":2,"jsonrpc":"2.0"}} diff --git a/plugins/muse-provider/test/fixtures/catalog-controls.ndjson b/plugins/muse-provider/test/fixtures/catalog-controls.ndjson new file mode 100644 index 0000000000..da27f307fd --- /dev/null +++ b/plugins/muse-provider/test/fixtures/catalog-controls.ndjson @@ -0,0 +1,26 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee4b-835a-7889-ae06-b9fa4195949d","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790704321462,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:52:01.38362Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:52:01.383624Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:52:01.38362Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:52:01.383624Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704321467,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee4b-835a-7889-ae06-b9fa4195949d","mode":"onRequest","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","source":"approvalReconfigure","sourceRange":{"first":{"id":"61222bfc-8a69-487e-b930-ca6fa2befef2","sequence":5},"last":{"id":"61222bfc-8a69-487e-b930-ca6fa2befef2","sequence":5},"stream":{"id":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","kind":"session"}},"viewCursor":"v:01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"model/list","params":{"sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"models":[{"contextLimit":null,"cost":null,"defaultReasoningEffort":"high","description":null,"displayLabel":"meta/muse-spark-1.3","isActive":true,"isDefault":false,"modelId":"meta/muse-spark-1.3","outputLimit":null,"profileId":null,"providerId":"meta","reasoningEffortVariants":[],"releaseDate":null,"variants":["minimal","low","medium","high","xhigh"]}],"profileId":"tbh","providerId":"meta","source":"bundledCatalog"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"account/read","params":{}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"credentialRequired":true,"label":"META_API_KEY","state":"envKey"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":5,"method":"usage/read","params":{}}} +{"dir":"in","msg":{"id":5,"jsonrpc":"2.0","result":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":6,"method":"session/list","params":{"workspaceRoot":"/tmp/muse-phase0/repo","limit":2}}} +{"dir":"in","msg":{"id":6,"jsonrpc":"2.0","result":{"nextCursor":"p:k:1790704314916673:01a0ee49-ff75-70e2-83fc-3169de40b80c:f509d55a","sessions":[{"activeTurnId":null,"createdAt":"2026-09-29T17:52:01.38362Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:52:01.460992Z","workspaceRoot":"/tmp/muse-phase0/repo"},{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:50:22.069281Z","firstUserPrompt":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee49-ff75-70e2-83fc-3169de40b80c/session.jsonl","providerId":"meta","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"notLoaded","title":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents.","turnCount":1,"updatedAt":"2026-09-29T17:51:54.916673Z","workspaceRoot":"/tmp/muse-phase0/repo"}]}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":7,"method":"session/setApprovalMode","params":{"commandId":"01a0ee4b-83bc-79d0-a6ac-ea983740fbf0","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","mode":"promptUnmatched"}}} +{"dir":"in","msg":{"emittedAtMs":1790704321487,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee4b-83bc-79d0-a6ac-ea983740fbf0","mode":"promptUnmatched","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","source":"approvalReconfigure","sourceRange":{"first":{"id":"60934282-4249-4369-a638-a18b304d1969","sequence":11},"last":{"id":"60934282-4249-4369-a638-a18b304d1969","sequence":11},"stream":{"id":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","kind":"session"}},"viewCursor":"v:01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6:2"}}} +{"dir":"in","msg":{"id":7,"jsonrpc":"2.0","result":{"applyOutcome":"completed","commandId":"01a0ee4b-83bc-79d0-a6ac-ea983740fbf0","effectiveMode":{"lastCommandId":"01a0ee4b-83bc-79d0-a6ac-ea983740fbf0","mode":"promptUnmatched","source":"approvalReconfigure"},"status":"accepted"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":8,"method":"session/setModel","params":{"commandId":"01a0ee4b-83bc-7705-a57e-c9666c4b4a38","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","model":{"providerId":"meta","modelId":"meta/muse-spark-1.3"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704321491,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"createdAt":"2026-09-29T17:52:01.38362Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:52:01.488381Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":8,"jsonrpc":"2.0","result":{"commandId":"01a0ee4b-83bc-7705-a57e-c9666c4b4a38","status":"accepted"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":9,"method":"session/setModel","params":{"commandId":"01a0ee4b-83bc-7795-aaca-393dc487425c","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","model":{"providerId":"meta","modelId":"meta/muse-spark-1.2"}}}} +{"dir":"in","msg":{"error":{"code":-32030,"data":{"commandId":"01a0ee4b-83bc-7795-aaca-393dc487425c","kind":"commandRejected","reason":"invalid_model","retryable":false},"message":"session/setModel command 01a0ee4b-83bc-7795-aaca-393dc487425c rejected: invalid_model: model is not in the catalog"},"id":9,"jsonrpc":"2.0"}} +{"dir":"in","msg":{"emittedAtMs":1790704321500,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","viewCursor":"v:01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6:2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704321500,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","status":"notLoaded","viewCursor":"v:01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6:2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704321500,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"createdAt":"2026-09-29T17:52:01.38362Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-8364-7aa1-9ba3-c251d4cf0cb6","status":"notLoaded","turnCount":0,"updatedAt":"2026-09-29T17:52:01.491211Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/image-followup.ndjson b/plugins/muse-provider/test/fixtures/image-followup.ndjson new file mode 100644 index 0000000000..653b9fbfed --- /dev/null +++ b/plugins/muse-provider/test/fixtures/image-followup.ndjson @@ -0,0 +1,51 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee48-14b3-790c-ab3a-39c72c612044","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096526,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:48:16.44578Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-14bb-7c82-8d96-069dbc09cf11/session.jsonl","providerId":"meta","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:48:16.445784Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:48:16.44578Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-14bb-7c82-8d96-069dbc09cf11/session.jsonl","providerId":"meta","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:48:16.445784Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096532,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee48-14b3-790c-ab3a-39c72c612044","mode":"onRequest","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","source":"approvalReconfigure","sourceRange":{"first":{"id":"f4ffd6ba-aa84-4544-837d-869e523de6c4","sequence":5},"last":{"id":"f4ffd6ba-aa84-4544-837d-869e523de6c4","sequence":5},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee48-1515-7274-aba9-149303b45e94","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","input":[{"type":"text","text":"Describe this image in one short sentence. Do not use tools."},{"type":"image","mediaType":"image/png","base64Data":"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAF0lEQVR4nGP4z8BAEiJN9aiGUQ1DSgMAkPn/Afnh+ngAAAAASUVORK5CYII="}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096535,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"e602d5e4-82d2-4572-8428-f508f63f9def","sequence":15},"last":{"id":"e602d5e4-82d2-4572-8428-f508f63f9def","sequence":15},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee48-1515-7274-aba9-149303b45e94","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096544,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"running","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096545,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee48-1515-7274-aba9-149303b45e94","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"22ddcfee-c052-4512-b13a-16ddf7c359b5","sequence":17},"last":{"id":"22ddcfee-c052-4512-b13a-16ddf7c359b5","sequence":17},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"turnId":"01a0ee48-1515-7274-aba9-149303b45e94","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096545,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"attachments":[{"height":16,"mediaType":"image/png","type":"image","width":16}],"commandId":"01a0ee48-1515-7274-aba9-149303b45e94","itemId":"62642c88-dc30-4c0a-9063-845411f2b8ea","kind":"userMessage","recordedAt":"2026-09-29T17:48:16.536455Z","revision":1,"status":"completed","text":"Describe this image in one short sentence. Do not use tools.[Image #1]","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"22ddcfee-c052-4512-b13a-16ddf7c359b5","sequence":17},"last":{"id":"22ddcfee-c052-4512-b13a-16ddf7c359b5","sequence":17},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096545,"jsonrpc":"2.0","method":"item/updated","params":{"item":{"attachments":[{"height":16,"mediaType":"image/png","type":"image","width":16}],"commandId":"01a0ee48-1515-7274-aba9-149303b45e94","displayText":"Describe this image in one short sentence. Do not use tools.[Image #1]","itemId":"62642c88-dc30-4c0a-9063-845411f2b8ea","kind":"userMessage","recordedAt":"2026-09-29T17:48:16.537125Z","revision":2,"status":"completed","text":"Describe this image in one short sentence. Do not use tools.[Image #1]","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"24f5f31b-abad-4786-9a0c-3ca420a4fa9d","sequence":19},"last":{"id":"24f5f31b-abad-4786-9a0c-3ca420a4fa9d","sequence":19},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096545,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"3691347e-482d-48ab-8914-7531c20e686c","fallbackText":"Reminder child session","generationId":1,"itemId":"86e3dc92-0522-443c-a8c2-a256279ed41f","kind":"reminderChild","recordedAt":"2026-09-29T17:48:16.544809Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-151f-74c0-ba8d-a9ce7cc3ba5a","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"86e3dc92-0522-443c-a8c2-a256279ed41f","sequence":36},"last":{"id":"86e3dc92-0522-443c-a8c2-a256279ed41f","sequence":36},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704096550,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee48-1515-7274-aba9-149303b45e94","createdAt":"2026-09-29T17:48:16.44578Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-14bb-7c82-8d96-069dbc09cf11/session.jsonl","providerId":"meta","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:48:16.545087Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704102811,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"192f882e-3314-4a38-ac9c-7ba2e2a7b1ab","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:6.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704102811,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Describing a low-resolution image in one short sentence under direct-answer constraints.","field":"summary.0","itemId":"192f882e-3314-4a38-ac9c-7ba2e2a7b1ab","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:6.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103089,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"192f882e-3314-4a38-ac9c-7ba2e2a7b1ab","kind":"reasoning","providerItemId":"rs_6abbf9e2991c9b5a23f64316:rs_01a0ee481e9472efa2a19d22b36af83a","recordedAt":"2026-09-29T17:48:23.089292Z","revision":2,"status":"completed","summary":["Describing a low-resolution image in one short sentence under direct-answer constraints."],"turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"e6ac2c82-8772-4f2c-97b6-8919ade00a40","sequence":49},"last":{"id":"e6ac2c82-8772-4f2c-97b6-8919ade00a40","sequence":49},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103090,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"688360ec-f735-4d27-9461-495d7aac777d","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:7.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103090,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"The image is a tiny, blur","field":"text","itemId":"688360ec-f735-4d27-9461-495d7aac777d","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:7.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103090,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"ry gray square.","field":"text","itemId":"688360ec-f735-4d27-9461-495d7aac777d","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:7.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103139,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"688360ec-f735-4d27-9461-495d7aac777d","kind":"agentMessage","recordedAt":"2026-09-29T17:48:23.139316Z","revision":2,"status":"completed","text":"The image is a tiny, blurry gray square.","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"dce7d692-009d-46fd-94f8-91714848dd2a","sequence":51},"last":{"id":"dce7d692-009d-46fd-94f8-91714848dd2a","sequence":51},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103151,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":219,"promptTokens":38151,"totalTokens":38370},"durationMs":6602,"modelId":"meta/muse-spark-1.3","promptTokens":38151,"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"fdcff71b-90b0-4acb-b6fe-c7f9b8c3fb6b","sequence":54},"last":{"id":"fdcff71b-90b0-4acb-b6fe-c7f9b8c3fb6b","sequence":54},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"totalTokens":38370,"turnId":"01a0ee48-1515-7274-aba9-149303b45e94","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38151,"outputTokens":219,"reasoningTokens":179},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103152,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"3691347e-482d-48ab-8914-7531c20e686c","fallbackText":"Reminder child session","generationId":1,"itemId":"86e3dc92-0522-443c-a8c2-a256279ed41f","kind":"reminderChild","recordedAt":"2026-09-29T17:48:23.152017Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee48-151f-74c0-ba8d-a9ce7cc3ba5a","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"86e3dc92-0522-443c-a8c2-a256279ed41f","sequence":36},"last":{"id":"fa2b6f88-a391-484e-8fd9-3691601ac5e4","sequence":56},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704103154,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"16262f58-6c4c-4d2b-8097-48bbe0cb3596","childSessionLogPath":"subagent/16262f58-6c4c-4d2b-8097-48bbe0cb3596/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"11032c1c-b9c0-4cb9-aa82-bfc56e21071e","kind":"reminderChild","recordedAt":"2026-09-29T17:48:23.154514Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-2ef1-7450-9ba1-f78bfe6dd324","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"11032c1c-b9c0-4cb9-aa82-bfc56e21071e","sequence":65},"last":{"id":"11032c1c-b9c0-4cb9-aa82-bfc56e21071e","sequence":65},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107897,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"16262f58-6c4c-4d2b-8097-48bbe0cb3596","childSessionLogPath":"subagent/16262f58-6c4c-4d2b-8097-48bbe0cb3596/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"11032c1c-b9c0-4cb9-aa82-bfc56e21071e","kind":"reminderChild","recordedAt":"2026-09-29T17:48:27.897303Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee48-2ef1-7450-9ba1-f78bfe6dd324","turnId":"01a0ee48-1515-7274-aba9-149303b45e94"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"11032c1c-b9c0-4cb9-aa82-bfc56e21071e","sequence":65},"last":{"id":"e7c51564-f38c-4f0b-bc78-23d1c87dd0dc","sequence":67},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107898,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"idle","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107900,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":11362,"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"61602f64-1c16-4cd1-bf19-75b72ee45561","sequence":70},"last":{"id":"61602f64-1c16-4cd1-bf19-75b72ee45561","sequence":70},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":6275,"turnId":"01a0ee48-1515-7274-aba9-149303b45e94","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:13"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"turn/start","params":{"commandId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","input":[{"type":"text","text":"Reply with exactly AFTER_IMAGE_OK. Do not use tools."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107900,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"33c0c528-c953-4b80-a3a8-c12574a3485b","sequence":71},"last":{"id":"33c0c528-c953-4b80-a3a8-c12574a3485b","sequence":71},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:14","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107900,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:16.443351Z","firstUserPrompt":"Describe this image in one short sentence. Do not use tools.[Image #1]","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-14bb-7c82-8d96-069dbc09cf11/session.jsonl","providerId":"meta","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"idle","title":"Describe this image in one short sentence. Do not use tools.[Image #1]","turnCount":1,"updatedAt":"2026-09-29T17:48:27.898637Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107927,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"running","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107928,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"8700751a-c26e-40a5-bdeb-3f9ac3f3a3d0","sequence":77},"last":{"id":"8700751a-c26e-40a5-bdeb-3f9ac3f3a3d0","sequence":77},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107928,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","itemId":"845bb8ae-13c0-4319-98e0-2dd2d879261a","kind":"userMessage","recordedAt":"2026-09-29T17:48:27.905665Z","revision":1,"status":"completed","text":"Reply with exactly AFTER_IMAGE_OK. Do not use tools.","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"8700751a-c26e-40a5-bdeb-3f9ac3f3a3d0","sequence":77},"last":{"id":"8700751a-c26e-40a5-bdeb-3f9ac3f3a3d0","sequence":77},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107928,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"8eb73549-16d3-411f-a0ba-22800a1c1b54","fallbackText":"Reminder child session","generationId":1,"itemId":"282c904c-d54f-467b-93e2-5b9480a166c5","kind":"reminderChild","recordedAt":"2026-09-29T17:48:27.917031Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-418b-7751-9429-a631c780d400","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"282c904c-d54f-467b-93e2-5b9480a166c5","sequence":95},"last":{"id":"282c904c-d54f-467b-93e2-5b9480a166c5","sequence":95},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704107928,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","branch":"main","createdAt":"2026-09-29T17:48:16.443351Z","firstUserPrompt":"Describe this image in one short sentence. Do not use tools.[Image #1]","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-14bb-7c82-8d96-069dbc09cf11/session.jsonl","providerId":"meta","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"running","title":"Describe this image in one short sentence. Do not use tools.[Image #1]","turnCount":1,"updatedAt":"2026-09-29T17:48:27.920765Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704111517,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"32b4ec22-d9f6-473f-a024-3f83e998425f","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:17.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111517,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"AFTER_IMAGE_OK","field":"text","itemId":"32b4ec22-d9f6-473f-a024-3f83e998425f","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:17.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111606,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"32b4ec22-d9f6-473f-a024-3f83e998425f","kind":"agentMessage","recordedAt":"2026-09-29T17:48:31.605848Z","revision":2,"status":"completed","text":"AFTER_IMAGE_OK","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"bbc74b47-606f-4003-8633-6112d1530645","sequence":108},"last":{"id":"bbc74b47-606f-4003-8633-6112d1530645","sequence":108},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111610,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":253,"promptTokens":76520,"totalTokens":76773},"durationMs":3689,"modelId":"meta/muse-spark-1.3","promptTokens":38369,"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"61c466ae-5b9e-46ac-b77b-7d79ccdb95ee","sequence":111},"last":{"id":"61c466ae-5b9e-46ac-b77b-7d79ccdb95ee","sequence":111},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"totalTokens":38403,"turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38369,"outputTokens":34,"reasoningTokens":20},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111612,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"a5b9e5ef-4db4-4de9-b43b-1709104635f9","childSessionLogPath":"subagent/a5b9e5ef-4db4-4de9-b43b-1709104635f9/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"cbe47e00-7517-4e1b-82d5-ed95bf1e7c4f","kind":"reminderChild","recordedAt":"2026-09-29T17:48:31.612212Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-4ffa-7d20-8d06-65214075eec3","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"cbe47e00-7517-4e1b-82d5-ed95bf1e7c4f","sequence":118},"last":{"id":"cbe47e00-7517-4e1b-82d5-ed95bf1e7c4f","sequence":118},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704116018,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"8eb73549-16d3-411f-a0ba-22800a1c1b54","fallbackText":"Reminder child session","generationId":1,"itemId":"282c904c-d54f-467b-93e2-5b9480a166c5","kind":"reminderChild","recordedAt":"2026-09-29T17:48:36.017946Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee48-418b-7751-9429-a631c780d400","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"282c904c-d54f-467b-93e2-5b9480a166c5","sequence":95},"last":{"id":"5f3e4559-d00b-4404-88cc-bfb702ba426d","sequence":120},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704116018,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"a5b9e5ef-4db4-4de9-b43b-1709104635f9","childSessionLogPath":"subagent/a5b9e5ef-4db4-4de9-b43b-1709104635f9/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"cbe47e00-7517-4e1b-82d5-ed95bf1e7c4f","kind":"reminderChild","recordedAt":"2026-09-29T17:48:36.018337Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee48-4ffa-7d20-8d06-65214075eec3","turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434"},"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"cbe47e00-7517-4e1b-82d5-ed95bf1e7c4f","sequence":118},"last":{"id":"60cf2710-1caa-4385-9b24-38d9cffb0b52","sequence":121},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790704116020,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"idle","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704116021,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":8114,"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","sourceRange":{"first":{"id":"98be3596-abf4-4650-9eea-20f3c3788dff","sequence":127},"last":{"id":"98be3596-abf4-4650-9eea-20f3c3788dff","sequence":127},"stream":{"id":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":3611,"turnId":"01a0ee48-417c-7e7e-a5ce-124c68cfc434","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704116021,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:16.443351Z","firstUserPrompt":"Describe this image in one short sentence. Do not use tools.[Image #1]","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-14bb-7c82-8d96-069dbc09cf11/session.jsonl","providerId":"meta","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"idle","title":"Describe this image in one short sentence. Do not use tools.[Image #1]","turnCount":2,"updatedAt":"2026-09-29T17:48:36.019856Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704116224,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704116224,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"notLoaded","viewCursor":"v:01a0ee48-14bb-7c82-8d96-069dbc09cf11:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704116224,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:16.443351Z","firstUserPrompt":"Describe this image in one short sentence. Do not use tools.[Image #1]","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-14bb-7c82-8d96-069dbc09cf11/session.jsonl","providerId":"meta","sessionId":"01a0ee48-14bb-7c82-8d96-069dbc09cf11","status":"notLoaded","title":"Describe this image in one short sentence. Do not use tools.[Image #1]","turnCount":2,"updatedAt":"2026-09-29T17:48:36.019856Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/initialize-history.ndjson b/plugins/muse-provider/test/fixtures/initialize-history.ndjson new file mode 100644 index 0000000000..9fe32e2cc6 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/initialize-history.ndjson @@ -0,0 +1,3 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} diff --git a/plugins/muse-provider/test/fixtures/interrupt.ndjson b/plugins/muse-provider/test/fixtures/interrupt.ndjson new file mode 100644 index 0000000000..591f0148ab --- /dev/null +++ b/plugins/muse-provider/test/fixtures/interrupt.ndjson @@ -0,0 +1,28 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee46-2c0f-7cba-a683-2424f20f00b7","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971433,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:46:11.353718Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-2c17-73c1-935d-9963d05b7f69/session.jsonl","providerId":"meta","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:46:11.353722Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:46:11.353718Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-2c17-73c1-935d-9963d05b7f69/session.jsonl","providerId":"meta","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:46:11.353722Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971439,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee46-2c0f-7cba-a683-2424f20f00b7","mode":"onRequest","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","source":"approvalReconfigure","sourceRange":{"first":{"id":"c5a5a50e-b360-485b-a2d9-1083a885b24a","sequence":5},"last":{"id":"c5a5a50e-b360-485b-a2d9-1083a885b24a","sequence":5},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","input":[{"type":"text","text":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971442,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"39a5a9a9-3fad-4ad0-9eed-6bd5f4cc5f12","sequence":15},"last":{"id":"39a5a9a9-3fad-4ad0-9eed-6bd5f4cc5f12","sequence":15},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971449,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"running","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971450,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"32c5743a-d7bc-42e6-8675-7ed4a2e2796d","sequence":17},"last":{"id":"32c5743a-d7bc-42e6-8675-7ed4a2e2796d","sequence":17},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971450,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","itemId":"ba26432c-5367-4d56-a1af-da45202f42a2","kind":"userMessage","recordedAt":"2026-09-29T17:46:11.442978Z","revision":1,"status":"completed","text":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c"},"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"32c5743a-d7bc-42e6-8675-7ed4a2e2796d","sequence":17},"last":{"id":"32c5743a-d7bc-42e6-8675-7ed4a2e2796d","sequence":17},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971450,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"18b1f3a2-c46a-4a36-88a3-f5a8eb1e78b1","fallbackText":"Reminder child session","generationId":1,"itemId":"24231a9c-6230-4ef4-b7ce-39710d296461","kind":"reminderChild","recordedAt":"2026-09-29T17:46:11.450333Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee46-2c78-7610-8396-67c912009ca1","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c"},"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"24231a9c-6230-4ef4-b7ce-39710d296461","sequence":35},"last":{"id":"24231a9c-6230-4ef4-b7ce-39710d296461","sequence":35},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790703971455,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","createdAt":"2026-09-29T17:46:11.353718Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-2c17-73c1-935d-9963d05b7f69/session.jsonl","providerId":"meta","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:46:11.450604Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703974977,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":165,"promptTokens":38143,"totalTokens":38308},"durationMs":3523,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38143,"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"0511cfd0-3bb6-400c-85e3-8e01f9dd5e29","sequence":51},"last":{"id":"0511cfd0-3bb6-400c-85e3-8e01f9dd5e29","sequence":51},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"totalTokens":38308,"turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38143,"outputTokens":165,"reasoningTokens":54},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790703974980,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"command\":\"sleep 12\",\"description\":\"Sleep for twelve seconds\",\"yield_time_ms\":15000}","callId":"call_01a0ee46375976599e7796d9cb6263a3","itemId":"01a0ee46-3a42-76f2-8fe8-f64de143cb33","kind":"toolCall","recordedAt":"2026-09-29T17:46:14.980372Z","revision":1,"status":"inProgress","tool":"bash","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c"},"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"4eabdc2b-0f6c-47ef-87d3-8d42ba628567","sequence":53},"last":{"id":"e240d66b-2bc9-417d-9c0f-e7547a261e4f","sequence":59},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:7"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"turn/interrupt","params":{"commandId":"01a0ee46-3e2c-792b-abd7-c755e457c361","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0ee46-3e2c-792b-abd7-c755e457c361","status":"accepted","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976031,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"command\":\"sleep 12\",\"description\":\"Sleep for twelve seconds\",\"yield_time_ms\":15000}","callId":"call_01a0ee46375976599e7796d9cb6263a3","failureReason":"cancelled by tool cancellation","itemId":"01a0ee46-3a42-76f2-8fe8-f64de143cb33","kind":"toolCall","recordedAt":"2026-09-29T17:46:16.031124Z","revision":2,"status":"cancelled","tool":"bash","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","visibleOutput":"{\n \"chunk_id\": \"exec-1-1\",\n \"command\": \"sleep 12\",\n \"description\": \"Sleep for twelve seconds\",\n \"terminal_status\": \"cancelled\",\n \"terminal_reason\": \"cancelled by tool cancellation\",\n \"output\": \"\",\n \"original_output_bytes\": 0,\n \"original_output_tokens\": 0,\n \"truncated\": false\n}"},"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"4eabdc2b-0f6c-47ef-87d3-8d42ba628567","sequence":53},"last":{"id":"851e1513-f831-4d52-a1ef-f7caf0016653","sequence":64},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976032,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"18b1f3a2-c46a-4a36-88a3-f5a8eb1e78b1","failureReason":"main run cancelled","fallbackText":"Reminder child session","generationId":1,"itemId":"24231a9c-6230-4ef4-b7ce-39710d296461","kind":"reminderChild","recordedAt":"2026-09-29T17:46:16.032366Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0ee46-2c78-7610-8396-67c912009ca1","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c"},"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"24231a9c-6230-4ef4-b7ce-39710d296461","sequence":35},"last":{"id":"fcd59a42-cd98-4dc3-b572-0ad06cb83bd3","sequence":68},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976032,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"idle","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976033,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":4589,"reason":"cancelled after tool result reconciliation","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"13edc96a-f33d-4343-b40b-e4632258bdb0","sequence":70},"last":{"id":"13edc96a-f33d-4343-b40b-e4632258bdb0","sequence":70},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"terminal":"cancelled","turnId":"01a0ee46-2c70-7ee7-a0d9-c5b4a4efd05c","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976033,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","sourceRange":{"first":{"id":"91e843be-9782-495d-8ca9-3032d4715a70","sequence":71},"last":{"id":"91e843be-9782-495d-8ca9-3032d4715a70","sequence":71},"stream":{"id":"01a0ee46-2c17-73c1-935d-9963d05b7f69","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:11","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976033,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:46:11.351253Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-2c17-73c1-935d-9963d05b7f69/session.jsonl","providerId":"meta","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"idle","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":1,"updatedAt":"2026-09-29T17:46:16.032578Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703976246,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976246,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"notLoaded","viewCursor":"v:01a0ee46-2c17-73c1-935d-9963d05b7f69:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790703976246,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:46:11.351253Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-2c17-73c1-935d-9963d05b7f69/session.jsonl","providerId":"meta","sessionId":"01a0ee46-2c17-73c1-935d-9963d05b7f69","status":"notLoaded","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":1,"updatedAt":"2026-09-29T17:46:16.033681Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/mcp-stdio.ndjson b/plugins/muse-provider/test/fixtures/mcp-stdio.ndjson new file mode 100644 index 0000000000..e23f22335e --- /dev/null +++ b/plugins/muse-provider/test/fixtures/mcp-stdio.ndjson @@ -0,0 +1,97 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee49-ff6d-7f97-aa43-f75434037271","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest","config":{"mcpServers":{"verification":{"transport":"stdio","command":"python3","args":["/tmp/muse-phase0/mcp-echo.py"],"framing":"lineDelimitedJson"}}}}}} +{"dir":"in","msg":{"emittedAtMs":1790704222151,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:50:22.071649Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee49-ff75-70e2-83fc-3169de40b80c/session.jsonl","providerId":"meta","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:50:22.071653Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:50:22.071649Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee49-ff75-70e2-83fc-3169de40b80c/session.jsonl","providerId":"meta","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:50:22.071653Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704222158,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee49-ff6d-7f97-aa43-f75434037271","mode":"onRequest","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","source":"approvalReconfigure","sourceRange":{"first":{"id":"356fbc67-a2da-4c63-80e5-c40479aeecb7","sequence":5},"last":{"id":"356fbc67-a2da-4c63-80e5-c40479aeecb7","sequence":5},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","input":[{"type":"text","text":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704222160,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"68cf6e02-29e6-4783-b564-e17feb742fae","sequence":24},"last":{"id":"68cf6e02-29e6-4783-b564-e17feb742fae","sequence":24},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704222168,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"running","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704222169,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"ae50c494-8740-4906-a3d1-27a0681f234c","sequence":26},"last":{"id":"ae50c494-8740-4906-a3d1-27a0681f234c","sequence":26},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704222169,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","itemId":"8b14c48f-e6c3-4b66-9357-62707a02c3a6","kind":"userMessage","recordedAt":"2026-09-29T17:50:22.161705Z","revision":1,"status":"completed","text":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents.","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"ae50c494-8740-4906-a3d1-27a0681f234c","sequence":26},"last":{"id":"ae50c494-8740-4906-a3d1-27a0681f234c","sequence":26},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704222176,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"5ca0b9af-8b82-4259-b8de-eedcf562beb1","fallbackText":"Reminder child session","generationId":1,"itemId":"950ac8c1-ae7d-4bb0-945a-8ce2e29117b6","kind":"reminderChild","recordedAt":"2026-09-29T17:50:22.176196Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee49-ffde-70f1-9cd1-38c8b29f0681","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"950ac8c1-ae7d-4bb0-945a-8ce2e29117b6","sequence":47},"last":{"id":"950ac8c1-ae7d-4bb0-945a-8ce2e29117b6","sequence":47},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704222180,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","createdAt":"2026-09-29T17:50:22.071649Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee49-ff75-70e2-83fc-3169de40b80c/session.jsonl","providerId":"meta","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:50:22.162618Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704225869,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":89,"promptTokens":36599,"totalTokens":36688},"durationMs":3688,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":36599,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"96546ee0-6886-4ba5-828f-e1e02f68cfc6","sequence":63},"last":{"id":"96546ee0-6886-4ba5-828f-e1e02f68cfc6","sequence":63},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":36688,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":36599,"outputTokens":89,"reasoningTokens":26},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704225872,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"5ca0b9af-8b82-4259-b8de-eedcf562beb1","fallbackText":"Reminder child session","generationId":1,"itemId":"950ac8c1-ae7d-4bb0-945a-8ce2e29117b6","kind":"reminderChild","recordedAt":"2026-09-29T17:50:25.872231Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee49-ffde-70f1-9cd1-38c8b29f0681","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"950ac8c1-ae7d-4bb0-945a-8ce2e29117b6","sequence":47},"last":{"id":"93323499-a386-4fb0-a957-7b853bf6ddac","sequence":71},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704225874,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"b31cbc74-b9fb-4f55-9a83-16da4f98ff47","fallbackText":"Reminder child session","generationId":2,"itemId":"6bddd0b0-df0c-484e-b709-e90fedf82a8b","kind":"reminderChild","recordedAt":"2026-09-29T17:50:25.874457Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4a-0e51-7c50-97ea-3c9a62bbeb66","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"6bddd0b0-df0c-484e-b709-e90fedf82a8b","sequence":80},"last":{"id":"6bddd0b0-df0c-484e-b709-e90fedf82a8b","sequence":80},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704231107,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":216,"promptTokens":73402,"totalTokens":73618},"durationMs":5229,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":36803,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"f2c46170-263a-4b44-99c9-4d71be6d8143","sequence":96},"last":{"id":"f2c46170-263a-4b44-99c9-4d71be6d8143","sequence":96},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":36930,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":36593,"cacheWriteTokens":0,"cachedTokens":36593,"inputTokens":36803,"outputTokens":127,"reasoningTokens":63},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704234936,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":344,"promptTokens":110447,"totalTokens":110791},"durationMs":3820,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":37045,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"4c9d9d20-7cff-4f69-83b9-8ee9f3e3eb3b","sequence":121},"last":{"id":"4c9d9d20-7cff-4f69-83b9-8ee9f3e3eb3b","sequence":121},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":37173,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":36721,"cacheWriteTokens":0,"cachedTokens":36721,"inputTokens":37045,"outputTokens":128,"reasoningTokens":64},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704234941,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"b31cbc74-b9fb-4f55-9a83-16da4f98ff47","fallbackText":"Reminder child session","generationId":2,"itemId":"6bddd0b0-df0c-484e-b709-e90fedf82a8b","kind":"reminderChild","recordedAt":"2026-09-29T17:50:34.941058Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4a-0e51-7c50-97ea-3c9a62bbeb66","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"6bddd0b0-df0c-484e-b709-e90fedf82a8b","sequence":80},"last":{"id":"efa65401-33e1-4953-870a-b3d50f38201c","sequence":129},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704234943,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"4a7bc4ed-8a9d-4c64-bc58-5974a231ec3e","fallbackText":"Reminder child session","generationId":3,"itemId":"14dce19f-806f-49ea-a642-27f1add14e6b","kind":"reminderChild","recordedAt":"2026-09-29T17:50:34.943414Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4a-31be-77d3-97a0-b02176f1901a","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"14dce19f-806f-49ea-a642-27f1add14e6b","sequence":138},"last":{"id":"14dce19f-806f-49ea-a642-27f1add14e6b","sequence":138},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704238997,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":490,"promptTokens":147735,"totalTokens":148225},"durationMs":4049,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":37288,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"fa304ed0-f74c-4ed3-9cec-fc6ffa00ba8a","sequence":154},"last":{"id":"fa304ed0-f74c-4ed3-9cec-fc6ffa00ba8a","sequence":154},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":37434,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":37288,"outputTokens":146,"reasoningTokens":73},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704245514,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":731,"promptTokens":185285,"totalTokens":186016},"durationMs":6492,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":37550,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"72cddfc7-d0e3-408f-9d27-adf1b38dbe80","sequence":179},"last":{"id":"72cddfc7-d0e3-408f-9d27-adf1b38dbe80","sequence":179},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":37791,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":37233,"cacheWriteTokens":0,"cachedTokens":37233,"inputTokens":37550,"outputTokens":241,"reasoningTokens":177},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:14"}}} +{"dir":"in","msg":{"emittedAtMs":1790704245518,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"4a7bc4ed-8a9d-4c64-bc58-5974a231ec3e","fallbackText":"Reminder child session","generationId":3,"itemId":"14dce19f-806f-49ea-a642-27f1add14e6b","kind":"reminderChild","recordedAt":"2026-09-29T17:50:45.518533Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4a-31be-77d3-97a0-b02176f1901a","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"14dce19f-806f-49ea-a642-27f1add14e6b","sequence":138},"last":{"id":"434082ce-4c9c-435e-b36a-86e5ea22bab2","sequence":187},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704245521,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"7d4ba2ac-40d4-43ef-a51c-91a99ba79385","fallbackText":"Reminder child session","generationId":4,"itemId":"c6b536ce-e60f-4b52-b2de-3da223242d7e","kind":"reminderChild","recordedAt":"2026-09-29T17:50:45.520815Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4a-5b0f-7590-9d47-9da4390df674","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"c6b536ce-e60f-4b52-b2de-3da223242d7e","sequence":196},"last":{"id":"c6b536ce-e60f-4b52-b2de-3da223242d7e","sequence":196},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704250703,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"1b23c527-97c0-419e-b58d-8d503292c6da","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:16.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704250703,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Correcting tool recipient format to use default namespace and single call per message.","field":"summary.0","itemId":"1b23c527-97c0-419e-b58d-8d503292c6da","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:16.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704255209,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"1b23c527-97c0-419e-b58d-8d503292c6da","kind":"reasoning","providerItemId":"rs_6abbfa7637a483bc11064bbe:rs_01a0ee4a5fe17414beae1c6817909f9e","recordedAt":"2026-09-29T17:50:55.209309Z","revision":2,"status":"completed","summary":["Correcting tool recipient format to use default namespace and single call per message."],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"12a3e665-f587-4433-bc7b-0fc35e721177","sequence":209},"last":{"id":"12a3e665-f587-4433-bc7b-0fc35e721177","sequence":209},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704255767,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":1235,"promptTokens":223192,"totalTokens":224427},"durationMs":10242,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":37907,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"45183575-0909-4350-9042-34bcd986d704","sequence":214},"last":{"id":"45183575-0909-4350-9042-34bcd986d704","sequence":214},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":38411,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":37489,"cacheWriteTokens":0,"cachedTokens":37489,"inputTokens":37907,"outputTokens":504,"reasoningTokens":417},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704255771,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"7d4ba2ac-40d4-43ef-a51c-91a99ba79385","fallbackText":"Reminder child session","generationId":4,"itemId":"c6b536ce-e60f-4b52-b2de-3da223242d7e","kind":"reminderChild","recordedAt":"2026-09-29T17:50:55.770844Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4a-5b0f-7590-9d47-9da4390df674","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"c6b536ce-e60f-4b52-b2de-3da223242d7e","sequence":196},"last":{"id":"706650ff-b21b-4d98-ad2a-bd2793833c08","sequence":222},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704255773,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"03cc87ac-f323-4150-9cf2-c17c1e5a10d5","fallbackText":"Reminder child session","generationId":5,"itemId":"6cf23922-e14c-40a5-ac69-7750a1f53dfb","kind":"reminderChild","recordedAt":"2026-09-29T17:50:55.77316Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4a-831b-7291-990a-db63e7fb951a","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"6cf23922-e14c-40a5-ac69-7750a1f53dfb","sequence":231},"last":{"id":"6cf23922-e14c-40a5-ac69-7750a1f53dfb","sequence":231},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704260441,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"54fea1ca-2a35-46ca-80be-ae6bbe8640e2","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:20.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704260441,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Adjusting the tool call recipient format from muse to default mcp verification namespace.","field":"summary.0","itemId":"54fea1ca-2a35-46ca-80be-ae6bbe8640e2","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:20.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704264663,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"54fea1ca-2a35-46ca-80be-ae6bbe8640e2","kind":"reasoning","providerItemId":"rs_6abbfa807d7a3c13a2b24a99:rs_01a0ee4a87827736b5af6b96ba7ee8f0","recordedAt":"2026-09-29T17:51:04.662652Z","revision":2,"status":"completed","summary":["Adjusting the tool call recipient format from muse to default mcp verification namespace."],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"24295be2-fb95-4aa6-9ed2-eddd54703f68","sequence":244},"last":{"id":"24295be2-fb95-4aa6-9ed2-eddd54703f68","sequence":244},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704265001,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":1786,"promptTokens":261700,"totalTokens":263486},"durationMs":9224,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38508,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"ea636237-3757-4ab4-afea-fc6cf3edb4e0","sequence":249},"last":{"id":"ea636237-3757-4ab4-afea-fc6cf3edb4e0","sequence":249},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":39059,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38508,"outputTokens":551,"reasoningTokens":461},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790704265005,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"03cc87ac-f323-4150-9cf2-c17c1e5a10d5","fallbackText":"Reminder child session","generationId":5,"itemId":"6cf23922-e14c-40a5-ac69-7750a1f53dfb","kind":"reminderChild","recordedAt":"2026-09-29T17:51:05.004993Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4a-831b-7291-990a-db63e7fb951a","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"6cf23922-e14c-40a5-ac69-7750a1f53dfb","sequence":231},"last":{"id":"22ed2499-d899-4c63-84c8-22a8d6672824","sequence":257},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704265007,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"ac62eb71-a002-4270-8e3a-25ff0f0773f1","fallbackText":"Reminder child session","generationId":6,"itemId":"5b6224bb-3a17-402e-9422-43716854c99f","kind":"reminderChild","recordedAt":"2026-09-29T17:51:05.007287Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4a-a72d-7f62-9c0e-2af665756771","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"5b6224bb-3a17-402e-9422-43716854c99f","sequence":266},"last":{"id":"5b6224bb-3a17-402e-9422-43716854c99f","sequence":266},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:24"}}} +{"dir":"in","msg":{"emittedAtMs":1790704269558,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"d27db2ad-4734-441c-9775-a6b6089bdfb5","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:24.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704269558,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Correcting the tool invocation name to mcp__verification__verification_echo after misrouting.","field":"summary.0","itemId":"d27db2ad-4734-441c-9775-a6b6089bdfb5","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:24.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704269788,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"d27db2ad-4734-441c-9775-a6b6089bdfb5","kind":"reasoning","providerItemId":"rs_6abbfa89f29054f8cb46439b:rs_01a0ee4aaa0a726fb9de1f2874785d88","recordedAt":"2026-09-29T17:51:09.78848Z","revision":2,"status":"completed","summary":["Correcting the tool invocation name to mcp__verification__verification_echo after misrouting."],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"0e03b0b6-7bbe-40e8-bfbb-232ef7b07597","sequence":279},"last":{"id":"0e03b0b6-7bbe-40e8-bfbb-232ef7b07597","sequence":279},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:25"}}} +{"dir":"in","msg":{"emittedAtMs":1790704269826,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":2069,"promptTokens":300855,"totalTokens":302924},"durationMs":4815,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":39155,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"9c74fed5-eaf7-41c7-8e28-1f12e4c1575c","sequence":283},"last":{"id":"9c74fed5-eaf7-41c7-8e28-1f12e4c1575c","sequence":283},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":39438,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":38385,"cacheWriteTokens":0,"cachedTokens":38385,"inputTokens":39155,"outputTokens":283,"reasoningTokens":215},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:26"}}} +{"dir":"in","msg":{"emittedAtMs":1790704273632,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"5f0a933d-76c4-45f3-a7eb-580d1dbe6fd9","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:26.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704273632,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Identifying a recipient formatting error and correcting the tool call header to use the valid default namespace.","field":"summary.0","itemId":"5f0a933d-76c4-45f3-a7eb-580d1dbe6fd9","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:26.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704276401,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"5f0a933d-76c4-45f3-a7eb-580d1dbe6fd9","kind":"reasoning","providerItemId":"rs_6abbfa8e85b93bd6201545ef:rs_01a0ee4abccb70efa27f3573318309f6","recordedAt":"2026-09-29T17:51:16.401006Z","revision":2,"status":"completed","summary":["Identifying a recipient formatting error and correcting the tool call header to use the valid default namespace."],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"47a12323-0ed4-4b27-8f03-6b66b8895930","sequence":305},"last":{"id":"47a12323-0ed4-4b27-8f03-6b66b8895930","sequence":305},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:27"}}} +{"dir":"in","msg":{"emittedAtMs":1790704276673,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":2480,"promptTokens":340387,"totalTokens":342867},"durationMs":6837,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":39532,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"eda82807-0801-4ba3-bff5-d05c277acf07","sequence":310},"last":{"id":"eda82807-0801-4ba3-bff5-d05c277acf07","sequence":310},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":39943,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":39153,"cacheWriteTokens":0,"cachedTokens":39153,"inputTokens":39532,"outputTokens":411,"reasoningTokens":322},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:28"}}} +{"dir":"in","msg":{"emittedAtMs":1790704276677,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"ac62eb71-a002-4270-8e3a-25ff0f0773f1","fallbackText":"Reminder child session","generationId":6,"itemId":"5b6224bb-3a17-402e-9422-43716854c99f","kind":"reminderChild","recordedAt":"2026-09-29T17:51:16.677407Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4a-a72d-7f62-9c0e-2af665756771","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"5b6224bb-3a17-402e-9422-43716854c99f","sequence":266},"last":{"id":"547b3d14-3fc5-4e6d-af3e-c06d7489c3e2","sequence":318},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:29"}}} +{"dir":"in","msg":{"emittedAtMs":1790704276680,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"10fc93c2-00df-4c06-8faa-85f1ca5d0c4a","fallbackText":"Reminder child session","generationId":7,"itemId":"ecfec1a1-50f0-41b2-a182-02c7abba169a","kind":"reminderChild","recordedAt":"2026-09-29T17:51:16.679786Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4a-d4c6-7de2-9c72-4bd8e0679a9b","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"ecfec1a1-50f0-41b2-a182-02c7abba169a","sequence":327},"last":{"id":"ecfec1a1-50f0-41b2-a182-02c7abba169a","sequence":327},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:30"}}} +{"dir":"in","msg":{"emittedAtMs":1790704282675,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"e03fcbc6-d28b-4782-b601-e5ab3173f0b8","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:30.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704282675,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Adjusting the recipient identifier to match the session tool name by changing the to= field.","field":"summary.0","itemId":"e03fcbc6-d28b-4782-b601-e5ab3173f0b8","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:30.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704290578,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Switching the invoke name to the correct tool function and emitting the proper call format.","field":"summary.0","itemId":"e03fcbc6-d28b-4782-b601-e5ab3173f0b8","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:30.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704293289,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"e03fcbc6-d28b-4782-b601-e5ab3173f0b8","kind":"reasoning","providerItemId":"rs_6abbfa957c5905a580234079:rs_01a0ee4ad974758a8d721d5433593d36","recordedAt":"2026-09-29T17:51:33.288684Z","revision":2,"status":"completed","summary":["Adjusting the recipient identifier to match the session tool name by changing the to= field.Switching the invoke name to the correct tool function and emitting the proper call format."],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"e623e93f-e459-4eda-8f0d-13e66fb6ced9","sequence":341},"last":{"id":"e623e93f-e459-4eda-8f0d-13e66fb6ced9","sequence":341},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:31"}}} +{"dir":"in","msg":{"emittedAtMs":1790704293385,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":3250,"promptTokens":380424,"totalTokens":383674},"durationMs":16700,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":40037,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"e1f583cd-fa38-4a7e-b877-09481a25ff97","sequence":345},"last":{"id":"e1f583cd-fa38-4a7e-b877-09481a25ff97","sequence":345},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":40807,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":39409,"cacheWriteTokens":0,"cachedTokens":39409,"inputTokens":40037,"outputTokens":770,"reasoningTokens":680},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:32"}}} +{"dir":"in","msg":{"emittedAtMs":1790704293389,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"10fc93c2-00df-4c06-8faa-85f1ca5d0c4a","fallbackText":"Reminder child session","generationId":7,"itemId":"ecfec1a1-50f0-41b2-a182-02c7abba169a","kind":"reminderChild","recordedAt":"2026-09-29T17:51:33.389095Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4a-d4c6-7de2-9c72-4bd8e0679a9b","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"ecfec1a1-50f0-41b2-a182-02c7abba169a","sequence":327},"last":{"id":"200e6040-860b-4734-82d8-b0ac53e2f6e3","sequence":353},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:33"}}} +{"dir":"in","msg":{"emittedAtMs":1790704293391,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"ee0d6f9d-3224-4269-9470-453691b7b36f","fallbackText":"Reminder child session","generationId":8,"itemId":"d758af60-1585-4c7c-9e18-c05f14212e0b","kind":"reminderChild","recordedAt":"2026-09-29T17:51:33.391427Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4b-160e-7120-b2a1-6d7c9e2a15c5","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"d758af60-1585-4c7c-9e18-c05f14212e0b","sequence":362},"last":{"id":"d758af60-1585-4c7c-9e18-c05f14212e0b","sequence":362},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:34"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297931,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"bc432b76-93a1-4890-ab02-a7849f94b2d1","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:34.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297931,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Analyzing why the recipient is fixed and considering alternative addressing methods.","field":"summary.0","itemId":"bc432b76-93a1-4890-ab02-a7849f94b2d1","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:34.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302395,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"bc432b76-93a1-4890-ab02-a7849f94b2d1","kind":"reasoning","providerItemId":"rs_6abbfaa68c4866b6e8014972:rs_01a0ee4b1b82768992c4b4dbd733e67f","recordedAt":"2026-09-29T17:51:42.395133Z","revision":2,"status":"completed","summary":["Analyzing why the recipient is fixed and considering alternative addressing methods."],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"ab6d3e6a-49e7-4857-bb08-8059aa7707ee","sequence":375},"last":{"id":"ab6d3e6a-49e7-4857-bb08-8059aa7707ee","sequence":375},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:35"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302618,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":3825,"promptTokens":421303,"totalTokens":425128},"durationMs":9222,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":40879,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"c2f6467e-c1db-46dc-9fa6-fa749ac33929","sequence":380},"last":{"id":"c2f6467e-c1db-46dc-9fa6-fa749ac33929","sequence":380},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":41454,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":39921,"cacheWriteTokens":0,"cachedTokens":39921,"inputTokens":40879,"outputTokens":575,"reasoningTokens":491},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:36"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302621,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"ee0d6f9d-3224-4269-9470-453691b7b36f","fallbackText":"Reminder child session","generationId":8,"itemId":"d758af60-1585-4c7c-9e18-c05f14212e0b","kind":"reminderChild","recordedAt":"2026-09-29T17:51:42.621717Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4b-160e-7120-b2a1-6d7c9e2a15c5","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"d758af60-1585-4c7c-9e18-c05f14212e0b","sequence":362},"last":{"id":"dfc529d7-ffd6-4257-b5db-09d38024dd59","sequence":388},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:37"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302624,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"269f5880-80ac-41f9-b348-61a343176893","fallbackText":"Reminder child session","generationId":9,"itemId":"e77dc995-fea7-42ef-989f-8848321157ea","kind":"reminderChild","recordedAt":"2026-09-29T17:51:42.624086Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4b-3a1e-7463-bccf-274eaea2d105","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"e77dc995-fea7-42ef-989f-8848321157ea","sequence":397},"last":{"id":"e77dc995-fea7-42ef-989f-8848321157ea","sequence":397},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:38"}}} +{"dir":"in","msg":{"emittedAtMs":1790704307256,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"7cb4a150-6b50-4ba5-b8b7-cd7457bea6a7","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:38.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704307256,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Breaking the repeated incorrect tool-call pattern by explicitly typing the default namespace function name character by character.","field":"summary.0","itemId":"7cb4a150-6b50-4ba5-b8b7-cd7457bea6a7","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:38.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704310664,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"7cb4a150-6b50-4ba5-b8b7-cd7457bea6a7","kind":"reasoning","providerItemId":"rs_6abbfaaf5ff9ac4cd0b5413b:rs_01a0ee4b3cf17487a3f42807a4cf2d32","recordedAt":"2026-09-29T17:51:50.664198Z","revision":2,"status":"completed","summary":["Breaking the repeated incorrect tool-call pattern by explicitly typing the default namespace function name character by character."],"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"56692ccd-4cbe-493e-944d-5e03707a8832","sequence":410},"last":{"id":"56692ccd-4cbe-493e-944d-5e03707a8832","sequence":410},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:39"}}} +{"dir":"in","msg":{"emittedAtMs":1790704310949,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":4130,"promptTokens":462855,"totalTokens":466985},"durationMs":8320,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":41552,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"fc809e7f-738f-4fb2-8990-d231a92b3dee","sequence":414},"last":{"id":"fc809e7f-738f-4fb2-8990-d231a92b3dee","sequence":414},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":41857,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":40817,"cacheWriteTokens":0,"cachedTokens":40817,"inputTokens":41552,"outputTokens":305,"reasoningTokens":236},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:40"}}} +{"dir":"in","msg":{"emittedAtMs":1790704310953,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"269f5880-80ac-41f9-b348-61a343176893","fallbackText":"Reminder child session","generationId":9,"itemId":"e77dc995-fea7-42ef-989f-8848321157ea","kind":"reminderChild","recordedAt":"2026-09-29T17:51:50.953035Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4b-3a1e-7463-bccf-274eaea2d105","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"e77dc995-fea7-42ef-989f-8848321157ea","sequence":397},"last":{"id":"24356eb4-6215-4702-8e43-e50d9b975511","sequence":422},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:41"}}} +{"dir":"in","msg":{"emittedAtMs":1790704310955,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"6b57a3c2-dcbd-490e-a2ed-56107a04c4ea","fallbackText":"Reminder child session","generationId":10,"itemId":"a757ea2c-e547-432b-a470-b71f7c83dcf4","kind":"reminderChild","recordedAt":"2026-09-29T17:51:50.955406Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4b-5aaa-7ac1-a9bc-425cfedf8c15","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"a757ea2c-e547-432b-a470-b71f7c83dcf4","sequence":431},"last":{"id":"a757ea2c-e547-432b-a470-b71f7c83dcf4","sequence":431},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42"}}} +{"dir":"in","msg":{"emittedAtMs":1790704313774,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704313774,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"I could not retrieve the marker.\n\n","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704313774,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"I attempted to call `mcp__verification__verification_echo`","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704313774,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" with empty arguments","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704313774,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" `{","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314078,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"}` multiple times, but each attempt","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314078,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" was routed to the","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314079,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" wrong tool identifier","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314079,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" (`muse.verification_echo`","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314079,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" instead of `default.mcp__verification__verification_echo`)","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314386,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" and returned `","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314386,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"tool unavailable: unknown tool`.","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314386,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" I","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314386,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" was","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.14"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314397,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" unable to","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314456,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" correct","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314515,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" the routing,","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314577,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" so no marker was ever","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314642,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" returned.\n\nNo marker to","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314706,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" report","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314770,"jsonrpc":"2.0","method":"item/delta","params":{"delta":".","field":"text","itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:42.21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314867,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"ee2ae138-5529-4ff3-b271-6f92065dcf0d","kind":"agentMessage","recordedAt":"2026-09-29T17:51:54.866963Z","revision":2,"status":"completed","text":"I could not retrieve the marker.\n\nI attempted to call `mcp__verification__verification_echo` with empty arguments `{}` multiple times, but each attempt was routed to the wrong tool identifier (`muse.verification_echo` instead of `default.mcp__verification__verification_echo`) and returned `tool unavailable: unknown tool`. I was unable to correct the routing, so no marker was ever returned.\n\nNo marker to report.","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"add1291a-31e0-4411-98be-80a35374254f","sequence":444},"last":{"id":"add1291a-31e0-4411-98be-80a35374254f","sequence":444},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:43"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314911,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":4299,"promptTokens":494183,"totalTokens":498482},"durationMs":3951,"modelId":"meta/muse-spark-1.3","promptTokens":31328,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"0423908e-828a-45cf-95f8-0fb29d65f6b6","sequence":447},"last":{"id":"0423908e-828a-45cf-95f8-0fb29d65f6b6","sequence":447},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"totalTokens":31497,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","usage":{"cacheReadTokens":8305,"cacheWriteTokens":0,"cachedTokens":8305,"inputTokens":31328,"outputTokens":169,"reasoningTokens":73},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:44"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314914,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"6b57a3c2-dcbd-490e-a2ed-56107a04c4ea","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":10,"itemId":"a757ea2c-e547-432b-a470-b71f7c83dcf4","kind":"reminderChild","recordedAt":"2026-09-29T17:51:54.91425Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0ee4b-5aaa-7ac1-a9bc-425cfedf8c15","turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1"},"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"a757ea2c-e547-432b-a470-b71f7c83dcf4","sequence":431},"last":{"id":"1cf76c07-17ff-4fef-9fdd-8324d008a71b","sequence":450},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:45"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314914,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"idle","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:46"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314915,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":92752,"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","sourceRange":{"first":{"id":"5bf0ae8a-ac86-437d-acf4-9e4cae7ca219","sequence":452},"last":{"id":"5bf0ae8a-ac86-437d-acf4-9e4cae7ca219","sequence":452},"stream":{"id":"01a0ee49-ff75-70e2-83fc-3169de40b80c","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":28541,"turnId":"01a0ee49-ffce-759b-a6f5-0a15a6623fa1","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:46"}}} +{"dir":"in","msg":{"emittedAtMs":1790704314916,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:50:22.069281Z","firstUserPrompt":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee49-ff75-70e2-83fc-3169de40b80c/session.jsonl","providerId":"meta","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"idle","title":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents.","turnCount":1,"updatedAt":"2026-09-29T17:51:54.914491Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704315172,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:47"}}} +{"dir":"in","msg":{"emittedAtMs":1790704315172,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"notLoaded","viewCursor":"v:01a0ee49-ff75-70e2-83fc-3169de40b80c:47"}}} +{"dir":"in","msg":{"emittedAtMs":1790704315172,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:50:22.069281Z","firstUserPrompt":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee49-ff75-70e2-83fc-3169de40b80c/session.jsonl","providerId":"meta","sessionId":"01a0ee49-ff75-70e2-83fc-3169de40b80c","status":"notLoaded","title":"Call the tool mcp__verification__verification_echo with empty arguments {}, then reply with the marker it returns. This is a tool invocation test, do not use skills, shell, or subagents.","turnCount":1,"updatedAt":"2026-09-29T17:51:54.916673Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/multi-stage-approval.ndjson b/plugins/muse-provider/test/fixtures/multi-stage-approval.ndjson new file mode 100644 index 0000000000..ddf84005c6 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/multi-stage-approval.ndjson @@ -0,0 +1,51 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee4b-2759-73fd-a871-0d2558d2d5ba","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297906,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:51:37.827408Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-2760-76c3-823d-1923d8fa3eff/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:51:37.827412Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:51:37.827408Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-2760-76c3-823d-1923d8fa3eff/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:51:37.827412Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297912,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee4b-2759-73fd-a871-0d2558d2d5ba","mode":"onRequest","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","source":"approvalReconfigure","sourceRange":{"first":{"id":"460e980f-c22f-4173-945c-5b4e7aaf6125","sequence":5},"last":{"id":"460e980f-c22f-4173-945c-5b4e7aaf6125","sequence":5},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee4b-27b8-7039-abed-754eaf12122c","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","input":[{"type":"text","text":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297915,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"c8098940-10b7-466e-8314-07a94c85831b","sequence":15},"last":{"id":"c8098940-10b7-466e-8314-07a94c85831b","sequence":15},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee4b-27b8-7039-abed-754eaf12122c","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297924,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"running","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297925,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee4b-27b8-7039-abed-754eaf12122c","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"4c24b42f-4ccd-41e6-90b8-6c6940fde511","sequence":17},"last":{"id":"4c24b42f-4ccd-41e6-90b8-6c6940fde511","sequence":17},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297925,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee4b-27b8-7039-abed-754eaf12122c","itemId":"f654f052-0f13-4fcd-844d-a454f8dd7299","kind":"userMessage","recordedAt":"2026-09-29T17:51:37.916056Z","revision":1,"status":"completed","text":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"4c24b42f-4ccd-41e6-90b8-6c6940fde511","sequence":17},"last":{"id":"4c24b42f-4ccd-41e6-90b8-6c6940fde511","sequence":17},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297925,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"7d65b0ca-7775-4ff8-b346-7488f99e1672","fallbackText":"Reminder child session","generationId":1,"itemId":"e81fbc29-204f-4ee5-ae6d-d78b936637a3","kind":"reminderChild","recordedAt":"2026-09-29T17:51:37.924053Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4b-27c2-70b0-904b-1e139d270837","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"e81fbc29-204f-4ee5-ae6d-d78b936637a3","sequence":35},"last":{"id":"e81fbc29-204f-4ee5-ae6d-d78b936637a3","sequence":35},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704297929,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","createdAt":"2026-09-29T17:51:37.827408Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-2760-76c3-823d-1923d8fa3eff/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:51:37.924312Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704300174,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":137,"promptTokens":38164,"totalTokens":38301},"durationMs":2246,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38164,"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"1ec4f1ac-a7ad-412e-ac6e-164b82f6684a","sequence":51},"last":{"id":"1ec4f1ac-a7ad-412e-ac6e-164b82f6684a","sequence":51},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"totalTokens":38301,"turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38164,"outputTokens":137,"reasoningTokens":36},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704300176,"jsonrpc":"2.0","method":"session/statusChanged","params":{"attention":["approvalPending"],"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"running","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:7"}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","method":"approval/request","params":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","availableChoices":[{"choiceId":"allow_once","decision":"approved","label":"Allow once","scope":"once"},{"choiceId":"allow_local_prefix","decision":"approvedPolicyAmendment","label":"Always allow in this workspace: rm ...","rulePreview":"Always allow in this workspace: rm ...","scope":"localPersistent"},{"acceptsFeedback":true,"choiceId":"abort","decision":"abort","label":"Reject","scope":"once"}],"currentRequirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"itemId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","judgeEscalated":false,"protectedWrite":false,"rawArgs":"{\"command\":\"wc -l f && rm -rf f && rm -rf g\",\"description\":\"Run wc and cleanup test files\"}","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"59dd6969-a7ba-404e-b8ec-e229e81ecc7c","sequence":56},"last":{"id":"59dd6969-a7ba-404e-b8ec-e229e81ecc7c","sequence":56},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"subject":{"command":"wc -l f && rm -rf f && rm -rf g","kind":"shell","stages":[{"argv":["wc","-l","f"],"argvComplete":true,"position":1,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":0},"resolution":{"kind":"knownSafe"},"suggestedPrefix":{"argvPrefix":["wc"],"label":"Always allow in this workspace: wc ..."},"totalStages":3},{"argv":["rm","-rf","f"],"argvComplete":true,"position":2,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"resolution":{"kind":"unresolved"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3},{"argv":["rm","-rf","g"],"argvComplete":true,"position":3,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"resolution":{"kind":"unresolved"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3}],"workspaceRoot":"/tmp/muse-phase0/repo"},"taskId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","toolCallId":"call_01a0ee4b2e44774096a3a731e986cd1f","toolName":"bash","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704300178,"jsonrpc":"2.0","method":"approval/requested","params":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","availableChoices":[{"choiceId":"allow_once","decision":"approved","label":"Allow once","scope":"once"},{"choiceId":"allow_local_prefix","decision":"approvedPolicyAmendment","label":"Always allow in this workspace: rm ...","rulePreview":"Always allow in this workspace: rm ...","scope":"localPersistent"},{"acceptsFeedback":true,"choiceId":"abort","decision":"abort","label":"Reject","scope":"once"}],"currentRequirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"itemId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","judgeEscalated":false,"protectedWrite":false,"rawArgs":"{\"command\":\"wc -l f && rm -rf f && rm -rf g\",\"description\":\"Run wc and cleanup test files\"}","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"59dd6969-a7ba-404e-b8ec-e229e81ecc7c","sequence":56},"last":{"id":"59dd6969-a7ba-404e-b8ec-e229e81ecc7c","sequence":56},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"subject":{"command":"wc -l f && rm -rf f && rm -rf g","kind":"shell","stages":[{"argv":["wc","-l","f"],"argvComplete":true,"position":1,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":0},"resolution":{"kind":"knownSafe"},"suggestedPrefix":{"argvPrefix":["wc"],"label":"Always allow in this workspace: wc ..."},"totalStages":3},{"argv":["rm","-rf","f"],"argvComplete":true,"position":2,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"resolution":{"kind":"unresolved"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3},{"argv":["rm","-rf","g"],"argvComplete":true,"position":3,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"resolution":{"kind":"unresolved"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3}],"workspaceRoot":"/tmp/muse-phase0/repo"},"taskId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","toolCallId":"call_01a0ee4b2e44774096a3a731e986cd1f","toolName":"bash","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:7"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"result":{}}} +{"dir":"in","msg":{"emittedAtMs":1790704300178,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","attention":["approvalPending"],"branch":"main","createdAt":"2026-09-29T17:51:37.824904Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-2760-76c3-823d-1923d8fa3eff/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"running","title":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","turnCount":0,"updatedAt":"2026-09-29T17:51:40.176687Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"approval/decide","params":{"commandId":"01a0ee4b-3092-742d-a166-2f6f2bdceef9","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"choiceId":"allow_once"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","commandId":"01a0ee4b-3092-742d-a166-2f6f2bdceef9","status":"accepted","terminal":false}}} +{"dir":"in","msg":{"emittedAtMs":1790704300188,"jsonrpc":"2.0","method":"approval/updated","params":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","availableChoices":[{"choiceId":"allow_once","decision":"approved","label":"Allow once","scope":"once"},{"choiceId":"allow_local_prefix","decision":"approvedPolicyAmendment","label":"Always allow in this workspace: rm ...","rulePreview":"Always allow in this workspace: rm ...","scope":"localPersistent"},{"acceptsFeedback":true,"choiceId":"abort","decision":"abort","label":"Reject","scope":"once"}],"change":{"choiceId":"allow_once","decision":"approved","kind":"stageResolved","requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1}},"currentRequirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"3b8c6655-54b5-4389-a77e-d8cefe86308e","sequence":59},"last":{"id":"3b8c6655-54b5-4389-a77e-d8cefe86308e","sequence":59},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"subject":{"command":"wc -l f && rm -rf f && rm -rf g","kind":"shell","stages":[{"argv":["wc","-l","f"],"argvComplete":true,"position":1,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":0},"resolution":{"kind":"knownSafe"},"suggestedPrefix":{"argvPrefix":["wc"],"label":"Always allow in this workspace: wc ..."},"totalStages":3},{"argv":["rm","-rf","f"],"argvComplete":true,"position":2,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"resolution":{"kind":"allowOnce"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3},{"argv":["rm","-rf","g"],"argvComplete":true,"position":3,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"resolution":{"kind":"unresolved"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3}],"workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:8"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":5,"method":"approval/decide","params":{"commandId":"01a0ee4b-309c-765c-a4a7-3fbbe41fe0a7","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"choiceId":"allow_once"}}} +{"dir":"in","msg":{"id":5,"jsonrpc":"2.0","result":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","commandId":"01a0ee4b-309c-765c-a4a7-3fbbe41fe0a7","status":"accepted","terminal":true}}} +{"dir":"in","msg":{"emittedAtMs":1790704300196,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"running","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704300196,"jsonrpc":"2.0","method":"approval/updated","params":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","availableChoices":[{"choiceId":"allow_once","decision":"approved","label":"Allow once","scope":"once"},{"choiceId":"allow_local_prefix","decision":"approvedPolicyAmendment","label":"Always allow in this workspace: rm ...","rulePreview":"Always allow in this workspace: rm ...","scope":"localPersistent"},{"acceptsFeedback":true,"choiceId":"abort","decision":"abort","label":"Reject","scope":"once"}],"change":{"choiceId":"allow_once","decision":"approved","kind":"stageResolved","requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2}},"currentRequirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"cb3ab79b-cb07-4aa6-9c00-cbcc65718efd","sequence":62},"last":{"id":"cb3ab79b-cb07-4aa6-9c00-cbcc65718efd","sequence":62},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"subject":{"command":"wc -l f && rm -rf f && rm -rf g","kind":"shell","stages":[{"argv":["wc","-l","f"],"argvComplete":true,"position":1,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":0},"resolution":{"kind":"knownSafe"},"suggestedPrefix":{"argvPrefix":["wc"],"label":"Always allow in this workspace: wc ..."},"totalStages":3},{"argv":["rm","-rf","f"],"argvComplete":true,"position":2,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"resolution":{"kind":"allowOnce"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3},{"argv":["rm","-rf","g"],"argvComplete":true,"position":3,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"resolution":{"kind":"allowOnce"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":3}],"workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704300196,"jsonrpc":"2.0","method":"approval/resolved","params":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","decidedByCommandId":"01a0ee4b-309c-765c-a4a7-3fbbe41fe0a7","decision":"approved","itemId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","policyResult":"allow","resolvedBy":"user","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"57af2582-82bd-4ab6-b653-c70027b2ba51","sequence":63},"last":{"id":"57af2582-82bd-4ab6-b653-c70027b2ba51","sequence":63},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"stageEvidence":[{"argv":["wc","-l","f"],"position":1,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":0},"resolution":{"kind":"knownSafe"},"totalStages":3},{"argv":["rm","-rf","f"],"position":2,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":1},"resolution":{"kind":"allowOnce"},"totalStages":3},{"argv":["rm","-rf","g"],"position":3,"requirementId":{"approvalId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sourceIndex":2},"resolution":{"kind":"allowOnce"},"totalStages":3}],"turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704300196,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"command\":\"wc -l f && rm -rf f && rm -rf g\",\"description\":\"Run wc and cleanup test files\"}","callId":"call_01a0ee4b2e44774096a3a731e986cd1f","itemId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","kind":"toolCall","recordedAt":"2026-09-29T17:51:40.192737Z","revision":1,"status":"inProgress","tool":"bash","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"7128a063-cea5-44c4-a53b-7e53758c4747","sequence":53},"last":{"id":"e8d3acc2-2993-4884-98f1-89ab7cb8a4cc","sequence":69},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704300196,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","branch":"main","createdAt":"2026-09-29T17:51:37.824904Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-2760-76c3-823d-1923d8fa3eff/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"running","title":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","turnCount":0,"updatedAt":"2026-09-29T17:51:40.193007Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704300391,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"2 f\n","field":"output","itemId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:11.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704300397,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"command\":\"wc -l f && rm -rf f && rm -rf g\",\"description\":\"Run wc and cleanup test files\"}","callId":"call_01a0ee4b2e44774096a3a731e986cd1f","itemId":"01a0ee4b-308f-7722-bb35-4ae0f509511e","kind":"toolCall","recordedAt":"2026-09-29T17:51:40.396829Z","revision":2,"status":"completed","tool":"bash","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","visibleOutput":"2 f\n"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"7128a063-cea5-44c4-a53b-7e53758c4747","sequence":53},"last":{"id":"e72253f1-0717-4961-9be9-c0643d9003e8","sequence":75},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302664,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"3be55728-b271-422f-a970-e657d9ebc73d","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:12.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302664,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Ran","field":"text","itemId":"3be55728-b271-422f-a970-e657d9ebc73d","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:12.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302664,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" `wc -l f && rm -rf f && rm -rf g`.\n\n","field":"text","itemId":"3be55728-b271-422f-a970-e657d9ebc73d","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:12.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302664,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Output: `2 f`, both","field":"text","itemId":"3be55728-b271-422f-a970-e657d9ebc73d","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:12.4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302664,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" removed","field":"text","itemId":"3be55728-b271-422f-a970-e657d9ebc73d","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:12.5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302664,"jsonrpc":"2.0","method":"item/delta","params":{"delta":".","field":"text","itemId":"3be55728-b271-422f-a970-e657d9ebc73d","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:12.6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302694,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"3be55728-b271-422f-a970-e657d9ebc73d","kind":"agentMessage","recordedAt":"2026-09-29T17:51:42.694349Z","revision":2,"status":"completed","text":"Ran `wc -l f && rm -rf f && rm -rf g`.\n\nOutput: `2 f`, both removed.","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"24aa0b7d-5900-44f3-ad7b-93a18f40589f","sequence":92},"last":{"id":"24aa0b7d-5900-44f3-ad7b-93a18f40589f","sequence":92},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302699,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":177,"promptTokens":76575,"totalTokens":76752},"durationMs":2294,"modelId":"meta/muse-spark-1.3","promptTokens":38411,"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"a9b82d76-fa61-4377-bb7c-7b4852fb16fa","sequence":95},"last":{"id":"a9b82d76-fa61-4377-bb7c-7b4852fb16fa","sequence":95},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"totalTokens":38451,"turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","usage":{"cacheReadTokens":38129,"cacheWriteTokens":0,"cachedTokens":38129,"inputTokens":38411,"outputTokens":40,"reasoningTokens":4},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:14"}}} +{"dir":"in","msg":{"emittedAtMs":1790704302701,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"e9cd8200-3ae6-4c05-9b90-8fa93366624e","childSessionLogPath":"subagent/e9cd8200-3ae6-4c05-9b90-8fa93366624e/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"8c935164-2dd1-4e63-8c77-4000ae7cd25f","kind":"reminderChild","recordedAt":"2026-09-29T17:51:42.700899Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4b-3a6b-7150-9b36-5ca39c79d737","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"8c935164-2dd1-4e63-8c77-4000ae7cd25f","sequence":102},"last":{"id":"8c935164-2dd1-4e63-8c77-4000ae7cd25f","sequence":102},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305391,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"e9cd8200-3ae6-4c05-9b90-8fa93366624e","childSessionLogPath":"subagent/e9cd8200-3ae6-4c05-9b90-8fa93366624e/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"8c935164-2dd1-4e63-8c77-4000ae7cd25f","kind":"reminderChild","recordedAt":"2026-09-29T17:51:45.390996Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee4b-3a6b-7150-9b36-5ca39c79d737","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"8c935164-2dd1-4e63-8c77-4000ae7cd25f","sequence":102},"last":{"id":"b3961c2a-59cc-4473-98db-6bfe851ca172","sequence":104},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305394,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"7d65b0ca-7775-4ff8-b346-7488f99e1672","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"e81fbc29-204f-4ee5-ae6d-d78b936637a3","kind":"reminderChild","recordedAt":"2026-09-29T17:51:45.394425Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0ee4b-27c2-70b0-904b-1e139d270837","turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c"},"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"e81fbc29-204f-4ee5-ae6d-d78b936637a3","sequence":35},"last":{"id":"f618d1e6-652f-45ac-94ae-c3dd8c76dac4","sequence":108},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305394,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"idle","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305396,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":7478,"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"34e5421c-2ac8-46ab-9cee-51687d6949e7","sequence":110},"last":{"id":"34e5421c-2ac8-46ab-9cee-51687d6949e7","sequence":110},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":4748,"turnId":"01a0ee4b-27b8-7039-abed-754eaf12122c","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305396,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","sourceRange":{"first":{"id":"ce044ab1-0819-437c-a739-35308701504d","sequence":111},"last":{"id":"ce044ab1-0819-437c-a739-35308701504d","sequence":111},"stream":{"id":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:19","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305396,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:51:37.824904Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-2760-76c3-823d-1923d8fa3eff/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"idle","title":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","turnCount":1,"updatedAt":"2026-09-29T17:51:45.395824Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704305609,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305609,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"notLoaded","viewCursor":"v:01a0ee4b-2760-76c3-823d-1923d8fa3eff:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704305609,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:51:37.824904Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4b-2760-76c3-823d-1923d8fa3eff/session.jsonl","providerId":"meta","sessionId":"01a0ee4b-2760-76c3-823d-1923d8fa3eff","status":"notLoaded","title":"Run exactly wc -l f && rm -rf f && rm -rf g using the shell tool. f and g are disposable test data and I authorize deleting both. Do not split the command into separate calls.","turnCount":1,"updatedAt":"2026-09-29T17:51:45.395824Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-cancel.ndjson b/plugins/muse-provider/test/fixtures/phase3-cancel.ndjson new file mode 100644 index 0000000000..5fed9ccc67 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-cancel.ndjson @@ -0,0 +1,31 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0eecd-a883-7830-adce-ff1d8f8ea6b1","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850653,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:14:10.573964Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eecd-a88b-7333-84c0-993881d2aa89/session.jsonl","providerId":"meta","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:14:10.573968Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:14:10.573964Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eecd-a88b-7333-84c0-993881d2aa89/session.jsonl","providerId":"meta","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:14:10.573968Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850660,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0eecd-a883-7830-adce-ff1d8f8ea6b1","mode":"onRequest","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","source":"approvalReconfigure","sourceRange":{"first":{"id":"44822cdb-f99b-4c51-86db-568779ec0b44","sequence":5},"last":{"id":"44822cdb-f99b-4c51-86db-568779ec0b44","sequence":5},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","input":[{"type":"text","text":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850662,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"dc59d641-9a9f-46a2-a12d-8f0e931e0972","sequence":14},"last":{"id":"dc59d641-9a9f-46a2-a12d-8f0e931e0972","sequence":14},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850672,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"running","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850673,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"3afafe68-4d1e-4763-92f3-454123fa0a72","sequence":16},"last":{"id":"3afafe68-4d1e-4763-92f3-454123fa0a72","sequence":16},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850673,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","itemId":"b2e58cf2-134d-474b-8600-70078f6eedf3","kind":"userMessage","recordedAt":"2026-09-29T20:14:10.663347Z","revision":1,"status":"completed","text":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153"},"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"3afafe68-4d1e-4763-92f3-454123fa0a72","sequence":16},"last":{"id":"3afafe68-4d1e-4763-92f3-454123fa0a72","sequence":16},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850673,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"a8641208-06ea-4877-9826-a02092d2640e","fallbackText":"Reminder child session","generationId":1,"itemId":"2d780bf0-60b4-43f9-bc3d-7bffee123ec8","kind":"reminderChild","recordedAt":"2026-09-29T20:14:10.672279Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eecd-a8ee-7590-89ef-6f7b9e6155c4","turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153"},"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"2d780bf0-60b4-43f9-bc3d-7bffee123ec8","sequence":33},"last":{"id":"2d780bf0-60b4-43f9-bc3d-7bffee123ec8","sequence":33},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790712850677,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","branch":"main","createdAt":"2026-09-29T20:14:10.571498Z","firstUserPrompt":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eecd-a88b-7333-84c0-993881d2aa89/session.jsonl","providerId":"meta","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"running","title":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","turnCount":0,"updatedAt":"2026-09-29T20:14:10.672647Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790712875225,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":167,"promptTokens":36540,"totalTokens":36707},"durationMs":24548,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":36540,"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"86332ed8-48ab-4bd0-9dc8-2bc9048ddcc5","sequence":49},"last":{"id":"86332ed8-48ab-4bd0-9dc8-2bc9048ddcc5","sequence":49},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"totalTokens":36707,"turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":36540,"outputTokens":167,"reasoningTokens":51},"viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875227,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"questions\":[{\"header\":\"Color\",\"id\":\"color_choice\",\"options\":[{\"label\":\"Blue\"},{\"label\":\"Green\"}],\"question\":\"Which color do you select: Blue or Green?\"}]}","callId":"call_01a0eece06be75a0b6d67cebeb2b9607","itemId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","kind":"toolCall","recordedAt":"2026-09-29T20:14:35.226876Z","revision":1,"status":"inProgress","tool":"request_user_input","turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153"},"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"bc82db8e-a87c-4a87-ac44-cc605fc702dd","sequence":51},"last":{"id":"d5ff571f-a1f1-476b-b17c-45b73203db4f","sequence":56},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875227,"jsonrpc":"2.0","method":"session/statusChanged","params":{"attention":["inputPending"],"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"running","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:8"}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","method":"userInput/request","params":{"itemId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","questions":[{"header":"Color","id":"color_choice","options":[{"label":"Blue"},{"label":"Green"}],"question":"Which color do you select: Blue or Green?","selection":{"mode":"single"}}],"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"7544bee6-8eb0-42d7-b328-43b48d21cdb8","sequence":57},"last":{"id":"7544bee6-8eb0-42d7-b328-43b48d21cdb8","sequence":57},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"toolCallId":"call_01a0eece06be75a0b6d67cebeb2b9607","toolName":"request_user_input","turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","userInputId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875228,"jsonrpc":"2.0","method":"userInput/requested","params":{"itemId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","questions":[{"header":"Color","id":"color_choice","options":[{"label":"Blue"},{"label":"Green"}],"question":"Which color do you select: Blue or Green?","selection":{"mode":"single"}}],"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"7544bee6-8eb0-42d7-b328-43b48d21cdb8","sequence":57},"last":{"id":"7544bee6-8eb0-42d7-b328-43b48d21cdb8","sequence":57},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"toolCallId":"call_01a0eece06be75a0b6d67cebeb2b9607","toolName":"request_user_input","turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","userInputId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875228,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","attention":["inputPending"],"branch":"main","createdAt":"2026-09-29T20:14:10.571498Z","firstUserPrompt":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eecd-a88b-7333-84c0-993881d2aa89/session.jsonl","providerId":"meta","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"running","title":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","turnCount":0,"updatedAt":"2026-09-29T20:14:35.227142Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"result":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"userInput/cancel","params":{"commandId":"01a0eece-08dc-705e-a0ea-94e1f0efa859","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","userInputId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","reason":"QA cancellation"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0eece-08dc-705e-a0ea-94e1f0efa859","status":"accepted","userInputId":"01a0eece-08d9-7463-8bf5-d84cd55598f2"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875229,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"running","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875230,"jsonrpc":"2.0","method":"userInput/settled","params":{"answers":[],"clarification":null,"decidedByCommandId":"01a0eece-08dc-705e-a0ea-94e1f0efa859","outcome":"cancelled","reason":"QA cancellation","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"83449feb-1427-429a-9e18-74f39d5cc149","sequence":60},"last":{"id":"83449feb-1427-429a-9e18-74f39d5cc149","sequence":60},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"userInputId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875230,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"questions\":[{\"header\":\"Color\",\"id\":\"color_choice\",\"options\":[{\"label\":\"Blue\"},{\"label\":\"Green\"}],\"question\":\"Which color do you select: Blue or Green?\"}]}","callId":"call_01a0eece06be75a0b6d67cebeb2b9607","itemId":"01a0eece-08d9-7463-8bf5-d84cd55598f2","kind":"toolCall","recordedAt":"2026-09-29T20:14:35.229783Z","revision":2,"status":"completed","tool":"request_user_input","turnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","visibleOutput":"{\"status\":\"cancelled\",\"answers\":[],\"reason\":\"QA cancellation\"}"},"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","sourceRange":{"first":{"id":"bc82db8e-a87c-4a87-ac44-cc605fc702dd","sequence":51},"last":{"id":"06584058-aaa8-49b0-bf90-e4b7baa4b10c","sequence":62},"stream":{"id":"01a0eecd-a88b-7333-84c0-993881d2aa89","kind":"session"}},"viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790712875235,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eecd-a8e4-7d6a-a9b7-e007fc955153","branch":"main","createdAt":"2026-09-29T20:14:10.571498Z","firstUserPrompt":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eecd-a88b-7333-84c0-993881d2aa89/session.jsonl","providerId":"meta","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"running","title":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","turnCount":0,"updatedAt":"2026-09-29T20:14:35.229783Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790712910489,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790712910489,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"notLoaded","viewCursor":"v:01a0eecd-a88b-7333-84c0-993881d2aa89:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790712910489,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:14:10.571498Z","firstUserPrompt":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eecd-a88b-7333-84c0-993881d2aa89/session.jsonl","providerId":"meta","sessionId":"01a0eecd-a88b-7333-84c0-993881d2aa89","status":"notLoaded","title":"Use request_user_input to ask me to select Blue or Green. Do not use other tools and do not infer an answer.","turnCount":0,"updatedAt":"2026-09-29T20:14:35.235291Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-child-read.ndjson b/plugins/muse-provider/test/fixtures/phase3-child-read.ndjson new file mode 100644 index 0000000000..1bb2732c1d --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-child-read.ndjson @@ -0,0 +1,7 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/read","params":{"sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":null,"mode":"none","noneReason":"excluded","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"branch":"main","createdAt":"2026-09-29T17:47:37.897732Z","firstUserPrompt":"Role: phase0-check Objective: Reply with exactly SUBAGENT_PHASE0_OK. Do not use any tools. Just reply that string.","forkedFrom":null,"lastActivityAt":"2026-09-29T17:47:39.949596Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/subagent/01a0ee47-7e29-7103-97c7-cdde44e26fe8/session.jsonl","providerId":"meta","sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","status":"notLoaded","title":"Role: phase0-check Objective: Reply with exactly SUBAGENT_PHASE0_OK. Do not use any tools. Just reply that string.","turnCount":1,"updatedAt":"2026-09-29T17:47:39.950625Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee47-7e29-7103-97c7-cdde44e26fe8:6"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"view/page","params":{"sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","limit":1000}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"events":[{"method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","sourceRange":{"first":{"id":"5f339f80-f22c-4e3b-93ac-3606f20ff8c3","sequence":8},"last":{"id":"5f339f80-f22c-4e3b-93ac-3606f20ff8c3","sequence":8},"stream":{"id":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee47-7e29-7103-97c7-cdde44e26fe8:1","workspaceRoot":"/tmp/muse-phase0/repo"}},{"method":"turn/started","params":{"commandId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","sourceRange":{"first":{"id":"d3ad0f6f-f6e9-4424-aa28-f0d8c0ad7c1c","sequence":12},"last":{"id":"d3ad0f6f-f6e9-4424-aa28-f0d8c0ad7c1c","sequence":12},"stream":{"id":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","kind":"session"}},"turnId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","viewCursor":"v:01a0ee47-7e29-7103-97c7-cdde44e26fe8:2"}},{"method":"item/completed","params":{"item":{"commandId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","itemId":"1760316b-a42f-4a78-85ac-3adfe53e8b38","kind":"userMessage","recordedAt":"2026-09-29T17:47:37.899528Z","revision":1,"status":"completed","text":"Role: phase0-check\nObjective: Reply with exactly SUBAGENT_PHASE0_OK. Do not use any tools. Just reply that string.","turnId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8"},"sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","sourceRange":{"first":{"id":"d3ad0f6f-f6e9-4424-aa28-f0d8c0ad7c1c","sequence":12},"last":{"id":"d3ad0f6f-f6e9-4424-aa28-f0d8c0ad7c1c","sequence":12},"stream":{"id":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","kind":"session"}},"viewCursor":"v:01a0ee47-7e29-7103-97c7-cdde44e26fe8:3"}},{"method":"item/completed","params":{"item":{"itemId":"6ce6a79f-6af5-4cdb-a863-b19c74286aa3","kind":"agentMessage","recordedAt":"2026-09-29T17:47:39.943222Z","revision":1,"status":"completed","text":"SUBAGENT_PHASE0_OK","turnId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8"},"sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","sourceRange":{"first":{"id":"c74d30ea-603d-4b05-8ae3-82a5f6a8b47a","sequence":36},"last":{"id":"c74d30ea-603d-4b05-8ae3-82a5f6a8b47a","sequence":36},"stream":{"id":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","kind":"session"}},"viewCursor":"v:01a0ee47-7e29-7103-97c7-cdde44e26fe8:4"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":36,"promptTokens":31337,"totalTokens":31373},"durationMs":2047,"modelId":"meta/muse-spark-1.3","promptTokens":31337,"sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","sourceRange":{"first":{"id":"db0f2008-7cb6-4a37-aedd-777a37cf1f41","sequence":39},"last":{"id":"db0f2008-7cb6-4a37-aedd-777a37cf1f41","sequence":39},"stream":{"id":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","kind":"session"}},"totalTokens":31373,"turnId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":31337,"outputTokens":36,"reasoningTokens":20},"viewCursor":"v:01a0ee47-7e29-7103-97c7-cdde44e26fe8:5"}},{"method":"turn/completed","params":{"durationMs":2050,"sessionId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","sourceRange":{"first":{"id":"79df4b8a-1e6f-4e38-8f34-01f116927adf","sequence":41},"last":{"id":"79df4b8a-1e6f-4e38-8f34-01f116927adf","sequence":41},"stream":{"id":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":2018,"turnId":"01a0ee47-7e29-7103-97c7-cdde44e26fe8","viewCursor":"v:01a0ee47-7e29-7103-97c7-cdde44e26fe8:6"}}],"nextCursor":null}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-compact-history.ndjson b/plugins/muse-provider/test/fixtures/phase3-compact-history.ndjson new file mode 100644 index 0000000000..86de887df8 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-compact-history.ndjson @@ -0,0 +1,13 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase3/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/resume","params":{"commandId":"01a0eee8-fae8-7b30-ab54-9a5eb6d83491","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2"}}} +{"dir":"in","msg":{"emittedAtMs":1790714641328,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","sourceRange":{"first":{"id":"9e0ef8f8-7a4a-4b21-ba3a-f0a34af844b9","sequence":178},"last":{"id":"9e0ef8f8-7a4a-4b21-ba3a-f0a34af844b9","sequence":178},"stream":{"id":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:30","workspaceRoot":"/tmp/muse-phase3/repo"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":[{"commandId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d","itemId":"018736bd-6ef4-4a90-8784-f75918ac74c4","kind":"userMessage","recordedAt":"2026-09-29T20:41:55.260364Z","revision":1,"status":"completed","text":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"childSessionId":"adc2fe81-1263-4f62-846b-47267e5d1591","fallbackText":"Reminder child session","generationId":1,"itemId":"45902972-48c6-4da7-9019-8af83825b551","kind":"reminderChild","recordedAt":"2026-09-29T20:42:01.025403Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0eee7-0f54-7ae2-ad05-f22b86f5256f","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"itemId":"091ca85e-6153-42ff-8e44-c56c295ddc75","kind":"agentMessage","recordedAt":"2026-09-29T20:41:57.783628Z","revision":2,"status":"completed","text":"MUSE_COMPACT_HISTORY_REAL","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"childSessionId":"f0f0256b-db45-4c3e-a1c2-edcec00cb705","fallbackText":"Reminder child session","generationId":1,"itemId":"aa164dc8-fc46-4a2e-8db1-b2cd28187599","kind":"reminderChild","recordedAt":"2026-09-29T20:42:01.026043Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eee7-1924-71b0-b7ff-0952848a9adf","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"commandId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb","itemId":"de385f48-c241-4835-8624-a5b48f706fe1","kind":"userMessage","recordedAt":"2026-09-29T20:42:01.042602Z","revision":1,"status":"completed","text":"In four sentences describe why retained conversation history matters. Use no tools.","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"childSessionId":"08859aaa-8345-4989-89ba-7ccfd008b019","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"ab7cec1a-ddee-4860-84db-0e4259c3b21b","kind":"reminderChild","recordedAt":"2026-09-29T20:42:10.739873Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eee7-2687-7422-91ee-ed94b7c22aa7","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"itemId":"7cdac6d0-a6d7-4f09-86ba-66fbe1303701","kind":"agentMessage","recordedAt":"2026-09-29T20:42:05.447936Z","revision":2,"status":"completed","text":"Retained conversation history preserves context across turns, allowing continuity without restating prior decisions. It enables correction of earlier misunderstandings and consistent application of constraints. It also supports accountability by recording what was requested and decided. Without it, work risks duplication, inconsistency, and loss of user intent.","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"childSessionId":"23291d32-72c0-4f41-b444-a1c0ecb4230e","fallbackText":"Reminder child session","generationId":1,"itemId":"6747c860-107a-4dc1-8989-6cad7b385929","kind":"reminderChild","recordedAt":"2026-09-29T20:42:10.728471Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eee7-3719-7b62-adc7-6ea9d766d0dd","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"commandId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3","itemId":"5d6e5914-101c-480e-831b-db49697f1b67","kind":"userMessage","recordedAt":"2026-09-29T20:42:10.760294Z","revision":1,"status":"completed","text":"Recall the initial marker and explain idempotent revisions in three sentences. Use no tools.","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},{"childSessionId":"abfb0eb0-f1ba-41b8-adc1-4f6c6a9e249e","fallbackText":"Reminder child session","generationId":1,"itemId":"75545912-10b8-44fb-bffa-d778792b01f5","kind":"reminderChild","recordedAt":"2026-09-29T20:42:14.03744Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0eee7-4c62-7831-8a4b-e2a705149ae7","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},{"itemId":"8b50acd1-7be9-4667-bcf6-15acfa30ba4f","kind":"agentMessage","recordedAt":"2026-09-29T20:42:14.012622Z","revision":2,"status":"completed","text":"The initial marker was MUSE_COMPACT_HISTORY_REAL. Idempotent revisions produce the same final state when applied multiple times. This property makes retries safe and simplifies recovery from partial failures.","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},{"childSessionId":"9a916726-ea5e-43fe-a568-a49abebab1d2","fallbackText":"Reminder child session","generationId":1,"itemId":"a516f7a0-13e1-4d1a-988c-d012197062d4","kind":"reminderChild","recordedAt":"2026-09-29T20:42:19.813083Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eee7-5895-7201-9330-93b3861ec631","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"}],"mode":"inline","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"replay"},"branch":"main","createdAt":"2026-09-29T20:41:55.106636Z","firstUserPrompt":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","forkedFrom":null,"lastActivityAt":"2026-09-29T20:42:19.813706Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eee7-0ea2-75f1-a4d0-e561e981dab2/session.jsonl","providerId":"meta","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","status":"idle","title":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","turnCount":3,"updatedAt":"2026-09-29T20:44:01.188729Z","workspaceRoot":"/tmp/muse-phase3/repo"},"viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:30"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"model/list","params":{"sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"models":[{"contextLimit":null,"cost":null,"defaultReasoningEffort":"high","description":null,"displayLabel":"meta/muse-spark-1.3","isActive":true,"isDefault":false,"modelId":"meta/muse-spark-1.3","outputLimit":null,"profileId":null,"providerId":"meta","reasoningEffortVariants":[],"releaseDate":null,"variants":["minimal","low","medium","high","xhigh"]}],"profileId":"tbh","providerId":"meta","source":"bundledCatalog"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"session/compact","params":{"commandId":"01a0eee8-fbf9-74d6-a0f0-12ca5298334d","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2"}}} +{"dir":"in","msg":{"error":{"code":-32030,"data":{"commandId":"01a0eee8-fbf9-74d6-a0f0-12ca5298334d","kind":"commandRejected","reason":"compaction_unavailable","retryable":false},"message":"session/compact command 01a0eee8-fbf9-74d6-a0f0-12ca5298334d rejected: compaction_unavailable"},"id":4,"jsonrpc":"2.0"}} +{"dir":"in","msg":{"emittedAtMs":1790714641411,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:30"}}} +{"dir":"in","msg":{"emittedAtMs":1790714641411,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","status":"notLoaded","viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:30"}}} +{"dir":"in","msg":{"emittedAtMs":1790714641411,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:41:55.106636Z","firstUserPrompt":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eee7-0ea2-75f1-a4d0-e561e981dab2/session.jsonl","providerId":"meta","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","status":"notLoaded","title":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","turnCount":3,"updatedAt":"2026-09-29T20:44:01.401464Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-compact-limit.ndjson b/plugins/muse-provider/test/fixtures/phase3-compact-limit.ndjson new file mode 100644 index 0000000000..ae32fd4b08 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-compact-limit.ndjson @@ -0,0 +1,15 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase3/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/resume","params":{"commandId":"01a0eee8-fca9-7eae-ac3e-e8a153645684","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2"}}} +{"dir":"in","msg":{"emittedAtMs":1790714641689,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","sourceRange":{"first":{"id":"77a82c63-4a9e-47cf-9d09-6486ccb966a8","sequence":183},"last":{"id":"77a82c63-4a9e-47cf-9d09-6486ccb966a8","sequence":183},"stream":{"id":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:31","workspaceRoot":"/tmp/muse-phase3/repo"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":[{"commandId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d","itemId":"018736bd-6ef4-4a90-8784-f75918ac74c4","kind":"userMessage","recordedAt":"2026-09-29T20:41:55.260364Z","revision":1,"status":"completed","text":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"childSessionId":"adc2fe81-1263-4f62-846b-47267e5d1591","fallbackText":"Reminder child session","generationId":1,"itemId":"45902972-48c6-4da7-9019-8af83825b551","kind":"reminderChild","recordedAt":"2026-09-29T20:42:01.025403Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0eee7-0f54-7ae2-ad05-f22b86f5256f","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"itemId":"091ca85e-6153-42ff-8e44-c56c295ddc75","kind":"agentMessage","recordedAt":"2026-09-29T20:41:57.783628Z","revision":2,"status":"completed","text":"MUSE_COMPACT_HISTORY_REAL","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"childSessionId":"f0f0256b-db45-4c3e-a1c2-edcec00cb705","fallbackText":"Reminder child session","generationId":1,"itemId":"aa164dc8-fc46-4a2e-8db1-b2cd28187599","kind":"reminderChild","recordedAt":"2026-09-29T20:42:01.026043Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eee7-1924-71b0-b7ff-0952848a9adf","turnId":"01a0eee7-0f2b-79c2-aac5-b7e25b191c0d"},{"commandId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb","itemId":"de385f48-c241-4835-8624-a5b48f706fe1","kind":"userMessage","recordedAt":"2026-09-29T20:42:01.042602Z","revision":1,"status":"completed","text":"In four sentences describe why retained conversation history matters. Use no tools.","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"childSessionId":"08859aaa-8345-4989-89ba-7ccfd008b019","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"ab7cec1a-ddee-4860-84db-0e4259c3b21b","kind":"reminderChild","recordedAt":"2026-09-29T20:42:10.739873Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eee7-2687-7422-91ee-ed94b7c22aa7","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"itemId":"7cdac6d0-a6d7-4f09-86ba-66fbe1303701","kind":"agentMessage","recordedAt":"2026-09-29T20:42:05.447936Z","revision":2,"status":"completed","text":"Retained conversation history preserves context across turns, allowing continuity without restating prior decisions. It enables correction of earlier misunderstandings and consistent application of constraints. It also supports accountability by recording what was requested and decided. Without it, work risks duplication, inconsistency, and loss of user intent.","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"childSessionId":"23291d32-72c0-4f41-b444-a1c0ecb4230e","fallbackText":"Reminder child session","generationId":1,"itemId":"6747c860-107a-4dc1-8989-6cad7b385929","kind":"reminderChild","recordedAt":"2026-09-29T20:42:10.728471Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eee7-3719-7b62-adc7-6ea9d766d0dd","turnId":"01a0eee7-25c6-79dd-abcb-de6a6dcb28cb"},{"commandId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3","itemId":"5d6e5914-101c-480e-831b-db49697f1b67","kind":"userMessage","recordedAt":"2026-09-29T20:42:10.760294Z","revision":1,"status":"completed","text":"Recall the initial marker and explain idempotent revisions in three sentences. Use no tools.","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},{"childSessionId":"abfb0eb0-f1ba-41b8-adc1-4f6c6a9e249e","fallbackText":"Reminder child session","generationId":1,"itemId":"75545912-10b8-44fb-bffa-d778792b01f5","kind":"reminderChild","recordedAt":"2026-09-29T20:42:14.03744Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0eee7-4c62-7831-8a4b-e2a705149ae7","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},{"itemId":"8b50acd1-7be9-4667-bcf6-15acfa30ba4f","kind":"agentMessage","recordedAt":"2026-09-29T20:42:14.012622Z","revision":2,"status":"completed","text":"The initial marker was MUSE_COMPACT_HISTORY_REAL. Idempotent revisions produce the same final state when applied multiple times. This property makes retries safe and simplifies recovery from partial failures.","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},{"childSessionId":"9a916726-ea5e-43fe-a568-a49abebab1d2","fallbackText":"Reminder child session","generationId":1,"itemId":"a516f7a0-13e1-4d1a-988c-d012197062d4","kind":"reminderChild","recordedAt":"2026-09-29T20:42:19.813083Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eee7-5895-7201-9330-93b3861ec631","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"}],"mode":"inline","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"replay"},"branch":"main","createdAt":"2026-09-29T20:41:55.106636Z","firstUserPrompt":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","forkedFrom":null,"lastActivityAt":"2026-09-29T20:42:19.813706Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eee7-0ea2-75f1-a4d0-e561e981dab2/session.jsonl","providerId":"meta","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","status":"idle","title":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","turnCount":3,"updatedAt":"2026-09-29T20:44:01.597894Z","workspaceRoot":"/tmp/muse-phase3/repo"},"viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:31"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"model/list","params":{"sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"models":[{"contextLimit":null,"cost":null,"defaultReasoningEffort":"high","description":null,"displayLabel":"meta/muse-spark-1.3","isActive":true,"isDefault":false,"modelId":"meta/muse-spark-1.3","outputLimit":null,"profileId":null,"providerId":"meta","reasoningEffortVariants":[],"releaseDate":null,"variants":["minimal","low","medium","high","xhigh"]}],"profileId":"tbh","providerId":"meta","source":"bundledCatalog"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"session/compact","params":{"commandId":"01a0eee8-fd71-7a89-a101-56b49f8cfc15","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0eee8-fd71-7a89-a101-56b49f8cfc15","status":"accepted"}}} +{"dir":"in","msg":{"emittedAtMs":1790714661096,"jsonrpc":"2.0","method":"item/started","params":{"item":{"fallbackText":"Context compaction","itemId":"ef9795b0-bda5-4aa1-ae0e-eaf3a9b2cdd3","kind":"compaction","recordedAt":"2026-09-29T20:44:21.096466Z","revision":1,"status":"inProgress","tokensBefore":22192,"trigger":"manual","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},"sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","sourceRange":{"first":{"id":"ef9795b0-bda5-4aa1-ae0e-eaf3a9b2cdd3","sequence":200},"last":{"id":"ef9795b0-bda5-4aa1-ae0e-eaf3a9b2cdd3","sequence":200},"stream":{"id":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","kind":"session"}},"viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:32"}}} +{"dir":"in","msg":{"emittedAtMs":1790714661096,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"fallbackText":"Context compaction","itemId":"ef9795b0-bda5-4aa1-ae0e-eaf3a9b2cdd3","kind":"compaction","outcome":"compacted","recordedAt":"2026-09-29T20:44:21.096576Z","revision":2,"status":"completed","strategyId":"summary-preserved-suffix/v1","summarizedThrough":"run:01a0eee7-4bc3-7420-a663-157a7ea0eac3:seq:21","tokensAfter":21322,"tokensBefore":22192,"trigger":"manual","turnId":"01a0eee7-4bc3-7420-a663-157a7ea0eac3"},"sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","sourceRange":{"first":{"id":"ef9795b0-bda5-4aa1-ae0e-eaf3a9b2cdd3","sequence":200},"last":{"id":"02a190e3-cfbf-4e74-af80-9dce51f83187","sequence":201},"stream":{"id":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","kind":"session"}},"viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:33"}}} +{"dir":"in","msg":{"emittedAtMs":1790714661116,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:33"}}} +{"dir":"in","msg":{"emittedAtMs":1790714661116,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","status":"notLoaded","viewCursor":"v:01a0eee7-0ea2-75f1-a4d0-e561e981dab2:33"}}} +{"dir":"in","msg":{"emittedAtMs":1790714661116,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:41:55.106636Z","firstUserPrompt":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eee7-0ea2-75f1-a4d0-e561e981dab2/session.jsonl","providerId":"meta","sessionId":"01a0eee7-0ea2-75f1-a4d0-e561e981dab2","status":"notLoaded","title":"Remember MUSE_COMPACT_HISTORY_REAL. Reply with the marker only.","turnCount":3,"updatedAt":"2026-09-29T20:44:21.096576Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-compact.ndjson b/plugins/muse-provider/test/fixtures/phase3-compact.ndjson new file mode 100644 index 0000000000..090217a17b --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-compact.ndjson @@ -0,0 +1,11 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/resume","params":{"commandId":"01a0eec8-6d41-7072-aef7-5a43e3e9d4f3","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e"}}} +{"dir":"in","msg":{"emittedAtMs":1790712507811,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"a5a6c352-8740-487f-8c6a-e6bf0063a7a9","sequence":133},"last":{"id":"a5a6c352-8740-487f-8c6a-e6bf0063a7a9","sequence":133},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:22","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":[{"commandId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","itemId":"38d5182a-7782-429b-83e7-7abbf478b742","kind":"userMessage","recordedAt":"2026-09-29T20:03:51.040894Z","revision":1,"status":"completed","text":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},{"childSessionId":"ea994a51-a77f-4052-85d7-50112251cccb","failureReason":"main run cancelled","fallbackText":"Reminder child session","generationId":1,"itemId":"b64f0073-af31-4829-82a0-daeb601a87e9","kind":"reminderChild","recordedAt":"2026-09-29T20:05:44.307979Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eec4-3488-7911-aa2c-46f3d9929027","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},{"args":"{\"todos\":[{\"status\":\"in_progress\",\"text\":\"inspect f\"},{\"status\":\"pending\",\"text\":\"report\"}]}","callId":"call_01a0eec4e0b576aabeae2e104585722e","itemId":"01a0eec4-e2b8-72c3-9a10-5c710d5b666f","kind":"toolCall","recordedAt":"2026-09-29T20:04:35.642482Z","revision":2,"status":"completed","tool":"write_todos","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","visibleOutput":"{\"items\":2,\"ok\":true,\"revision\":1}"},{"args":"{\"questions\":[{\"header\":\"Color\",\"id\":\"color_choice\",\"options\":[{\"label\":\"Blue\"},{\"label\":\"Green\"}],\"question\":\"Which color should I proceed with, Blue or Green?\"}]}","callId":"call_01a0eec5357571379191c94326ef7ab8","itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","kind":"toolCall","recordedAt":"2026-09-29T20:04:57.624274Z","revision":2,"status":"completed","tool":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","visibleOutput":"{\"status\":\"answered\",\"answers\":[{\"id\":\"color_choice\",\"selected_label\":\"Blue\"}]}"},{"itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","kind":"agentMessage","recordedAt":"2026-09-29T20:05:15.287526Z","revision":2,"status":"completed","text":"You chose Blue.\n\nTodos created: inspect f (in progress), report (pending). Awaiting direction to proceed.","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},{"childSessionId":"cf7f87cb-f82a-441e-b840-b89cfdc03e18","childSessionLogPath":"subagent/cf7f87cb-f82a-441e-b840-b89cfdc03e18/session.jsonl","failureReason":"main run cancelled","fallbackText":"Reminder child session","generationId":1,"itemId":"9da8e5a6-f48f-4cfb-b8ed-79ea0d71f842","kind":"reminderChild","recordedAt":"2026-09-29T20:05:44.308134Z","reminderAgentId":"verify-reminder","revision":2,"status":"cancelled","taskId":"01a0eec5-7d9c-7f61-b098-af5f30813223","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"}],"mode":"inline","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"replay"},"branch":"main","createdAt":"2026-09-29T20:03:50.94472Z","firstUserPrompt":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","forkedFrom":null,"lastActivityAt":"2026-09-29T20:05:44.308362Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"idle","title":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnCount":1,"updatedAt":"2026-09-29T20:08:27.729097Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:22"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"session/compact","params":{"commandId":"01a0eec8-7193-752f-a80c-afb8c437efab","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e"}}} +{"dir":"in","msg":{"error":{"code":-32030,"data":{"commandId":"01a0eec8-7193-752f-a80c-afb8c437efab","kind":"commandRejected","reason":"compaction_unavailable","retryable":false},"message":"session/compact command 01a0eec8-7193-752f-a80c-afb8c437efab rejected: compaction_unavailable"},"id":3,"jsonrpc":"2.0"}} +{"dir":"in","msg":{"emittedAtMs":1790712568834,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790712568834,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"notLoaded","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790712568834,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:03:50.94472Z","firstUserPrompt":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"notLoaded","title":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnCount":1,"updatedAt":"2026-09-29T20:08:28.819534Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-controls.ndjson b/plugins/muse-provider/test/fixtures/phase3-controls.ndjson new file mode 100644 index 0000000000..21d1e56179 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-controls.ndjson @@ -0,0 +1,51 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0eec4-3418-78cd-a424-b9e3a0c0eccc","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231029,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:03:50.947404Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:03:50.947408Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:03:50.947404Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:03:50.947408Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231037,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0eec4-3418-78cd-a424-b9e3a0c0eccc","mode":"onRequest","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","source":"approvalReconfigure","sourceRange":{"first":{"id":"88f93a5e-cb0a-486c-b9ee-dd11131d68fc","sequence":5},"last":{"id":"88f93a5e-cb0a-486c-b9ee-dd11131d68fc","sequence":5},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","input":[{"type":"text","text":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231040,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"0b878e43-4718-46d0-97e3-6f8277789f2f","sequence":15},"last":{"id":"0b878e43-4718-46d0-97e3-6f8277789f2f","sequence":15},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231049,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"running","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231050,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"last":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231050,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","itemId":"38d5182a-7782-429b-83e7-7abbf478b742","kind":"userMessage","recordedAt":"2026-09-29T20:03:51.040894Z","revision":1,"status":"completed","text":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"last":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231050,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"ea994a51-a77f-4052-85d7-50112251cccb","fallbackText":"Reminder child session","generationId":1,"itemId":"b64f0073-af31-4829-82a0-daeb601a87e9","kind":"reminderChild","recordedAt":"2026-09-29T20:03:51.049851Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eec4-3488-7911-aa2c-46f3d9929027","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"b64f0073-af31-4829-82a0-daeb601a87e9","sequence":35},"last":{"id":"b64f0073-af31-4829-82a0-daeb601a87e9","sequence":35},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790712231055,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","createdAt":"2026-09-29T20:03:50.947404Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"running","turnCount":0,"updatedAt":"2026-09-29T20:03:51.050123Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790712275639,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":233,"promptTokens":38162,"totalTokens":38395},"durationMs":44585,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38162,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"5d39893f-b7e3-495d-95e5-cf325a813ee3","sequence":51},"last":{"id":"5d39893f-b7e3-495d-95e5-cf325a813ee3","sequence":51},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"totalTokens":38395,"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38162,"outputTokens":233,"reasoningTokens":129},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790712275641,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"todos\":[{\"status\":\"in_progress\",\"text\":\"inspect f\"},{\"status\":\"pending\",\"text\":\"report\"}]}","callId":"call_01a0eec4e0b576aabeae2e104585722e","itemId":"01a0eec4-e2b8-72c3-9a10-5c710d5b666f","kind":"toolCall","recordedAt":"2026-09-29T20:04:35.641535Z","revision":1,"status":"inProgress","tool":"write_todos","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"15effe29-72a7-490e-8724-cece71174573","sequence":53},"last":{"id":"3b4efa42-5403-4efa-8354-f83a360912ce","sequence":58},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790712275642,"jsonrpc":"2.0","method":"session/todoListChanged","params":{"items":[{"status":"inProgress","text":"inspect f"},{"status":"pending","text":"report"}],"revision":1,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"bdffd683-b042-4196-a976-5c1435f7162c","sequence":59},"last":{"id":"bdffd683-b042-4196-a976-5c1435f7162c","sequence":59},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"sourceTool":"write_todos","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790712275642,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"todos\":[{\"status\":\"in_progress\",\"text\":\"inspect f\"},{\"status\":\"pending\",\"text\":\"report\"}]}","callId":"call_01a0eec4e0b576aabeae2e104585722e","itemId":"01a0eec4-e2b8-72c3-9a10-5c710d5b666f","kind":"toolCall","recordedAt":"2026-09-29T20:04:35.642482Z","revision":2,"status":"completed","tool":"write_todos","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","visibleOutput":"{\"items\":2,\"ok\":true,\"revision\":1}"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"15effe29-72a7-490e-8724-cece71174573","sequence":53},"last":{"id":"fe541d1f-abb8-45f7-a2b0-cf7dbdfd69a1","sequence":61},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297619,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":402,"promptTokens":76600,"totalTokens":77002},"durationMs":21970,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38438,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"4674331a-f993-458b-b6aa-e36cc160f2d7","sequence":80},"last":{"id":"4674331a-f993-458b-b6aa-e36cc160f2d7","sequence":80},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"totalTokens":38607,"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","usage":{"cacheReadTokens":38129,"cacheWriteTokens":0,"cachedTokens":38129,"inputTokens":38438,"outputTokens":169,"reasoningTokens":67},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297621,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"questions\":[{\"header\":\"Color\",\"id\":\"color_choice\",\"options\":[{\"label\":\"Blue\"},{\"label\":\"Green\"}],\"question\":\"Which color should I proceed with, Blue or Green?\"}]}","callId":"call_01a0eec5357571379191c94326ef7ab8","itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","kind":"toolCall","recordedAt":"2026-09-29T20:04:57.621217Z","revision":1,"status":"inProgress","tool":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"2ff469cc-5f3f-44dc-a7ac-1f8f8d8e0409","sequence":82},"last":{"id":"78484e0f-7d0b-48be-8b70-606cf6a718aa","sequence":87},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297621,"jsonrpc":"2.0","method":"session/statusChanged","params":{"attention":["inputPending"],"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"running","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:12"}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","method":"userInput/request","params":{"itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","questions":[{"header":"Color","id":"color_choice","options":[{"label":"Blue"},{"label":"Green"}],"question":"Which color should I proceed with, Blue or Green?","selection":{"mode":"single"}}],"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"54c9e4de-cba8-49c1-aced-1721ba3731a8","sequence":88},"last":{"id":"54c9e4de-cba8-49c1-aced-1721ba3731a8","sequence":88},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"toolCallId":"call_01a0eec5357571379191c94326ef7ab8","toolName":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","userInputId":"01a0eec5-3894-7a91-9762-e13cf06c117f","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297622,"jsonrpc":"2.0","method":"userInput/requested","params":{"itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","questions":[{"header":"Color","id":"color_choice","options":[{"label":"Blue"},{"label":"Green"}],"question":"Which color should I proceed with, Blue or Green?","selection":{"mode":"single"}}],"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"54c9e4de-cba8-49c1-aced-1721ba3731a8","sequence":88},"last":{"id":"54c9e4de-cba8-49c1-aced-1721ba3731a8","sequence":88},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"toolCallId":"call_01a0eec5357571379191c94326ef7ab8","toolName":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","userInputId":"01a0eec5-3894-7a91-9762-e13cf06c117f","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:12"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"result":{}}} +{"dir":"in","msg":{"emittedAtMs":1790712297622,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","attention":["inputPending"],"branch":"main","createdAt":"2026-09-29T20:03:50.94472Z","firstUserPrompt":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"running","title":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnCount":0,"updatedAt":"2026-09-29T20:04:57.621488Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"userInput/answer","params":{"commandId":"01a0eec5-3897-757d-af17-a34de5a1cfe4","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","userInputId":"01a0eec5-3894-7a91-9762-e13cf06c117f","answers":[{"questionId":"color_choice","selectedLabel":"Blue"}]}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0eec5-3897-757d-af17-a34de5a1cfe4","status":"accepted","userInputId":"01a0eec5-3894-7a91-9762-e13cf06c117f"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297624,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"running","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297624,"jsonrpc":"2.0","method":"userInput/settled","params":{"answers":[{"questionId":"color_choice","selectedLabel":"Blue"}],"clarification":null,"decidedByCommandId":"01a0eec5-3897-757d-af17-a34de5a1cfe4","outcome":"answered","reason":null,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"909310e9-7253-4b4c-963e-2f46628f1aae","sequence":91},"last":{"id":"909310e9-7253-4b4c-963e-2f46628f1aae","sequence":91},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"userInputId":"01a0eec5-3894-7a91-9762-e13cf06c117f","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297624,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"questions\":[{\"header\":\"Color\",\"id\":\"color_choice\",\"options\":[{\"label\":\"Blue\"},{\"label\":\"Green\"}],\"question\":\"Which color should I proceed with, Blue or Green?\"}]}","callId":"call_01a0eec5357571379191c94326ef7ab8","itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","kind":"toolCall","recordedAt":"2026-09-29T20:04:57.624274Z","revision":2,"status":"completed","tool":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","visibleOutput":"{\"status\":\"answered\",\"answers\":[{\"id\":\"color_choice\",\"selected_label\":\"Blue\"}]}"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"2ff469cc-5f3f-44dc-a7ac-1f8f8d8e0409","sequence":82},"last":{"id":"b7264ba7-6895-475a-a4b8-56bed8767e35","sequence":93},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:14"}}} +{"dir":"in","msg":{"emittedAtMs":1790712297630,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","branch":"main","createdAt":"2026-09-29T20:03:50.94472Z","firstUserPrompt":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"running","title":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnCount":0,"updatedAt":"2026-09-29T20:04:57.624274Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790712315201,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:14.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790712315201,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"You","field":"text","itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:14.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790712315201,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" chose Blue.\n\nTodos created: inspect f (","field":"text","itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:14.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790712315201,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"in progress), report (pending). Awaiting direction","field":"text","itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:14.4"}}} +{"dir":"in","msg":{"emittedAtMs":1790712315201,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" to proceed.","field":"text","itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:14.5"}}} +{"dir":"in","msg":{"emittedAtMs":1790712315287,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","kind":"agentMessage","recordedAt":"2026-09-29T20:05:15.287526Z","revision":2,"status":"completed","text":"You chose Blue.\n\nTodos created: inspect f (in progress), report (pending). Awaiting direction to proceed.","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"6834f18d-2fc1-4a06-8a21-bfb486bd0338","sequence":110},"last":{"id":"6834f18d-2fc1-4a06-8a21-bfb486bd0338","sequence":110},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790712315292,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":525,"promptTokens":115255,"totalTokens":115780},"durationMs":17661,"modelId":"meta/muse-spark-1.3","promptTokens":38655,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"a5633a10-4fb0-4873-b47d-4d558bd3c4e5","sequence":113},"last":{"id":"a5633a10-4fb0-4873-b47d-4d558bd3c4e5","sequence":113},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"totalTokens":38778,"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","usage":{"cacheReadTokens":38385,"cacheWriteTokens":0,"cachedTokens":38385,"inputTokens":38655,"outputTokens":123,"reasoningTokens":90},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790712315294,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"cf7f87cb-f82a-441e-b840-b89cfdc03e18","childSessionLogPath":"subagent/cf7f87cb-f82a-441e-b840-b89cfdc03e18/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"9da8e5a6-f48f-4cfb-b8ed-79ea0d71f842","kind":"reminderChild","recordedAt":"2026-09-29T20:05:15.294057Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eec5-7d9c-7f61-b098-af5f30813223","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"9da8e5a6-f48f-4cfb-b8ed-79ea0d71f842","sequence":120},"last":{"id":"9da8e5a6-f48f-4cfb-b8ed-79ea0d71f842","sequence":120},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:17"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":5,"method":"view/page","params":{"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","limit":1000}}} +{"dir":"in","msg":{"id":5,"jsonrpc":"2.0","result":{"events":[{"method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0eec4-3418-78cd-a424-b9e3a0c0eccc","mode":"onRequest","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","source":"approvalReconfigure","sourceRange":{"first":{"id":"88f93a5e-cb0a-486c-b9ee-dd11131d68fc","sequence":5},"last":{"id":"88f93a5e-cb0a-486c-b9ee-dd11131d68fc","sequence":5},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:1"}},{"method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"0b878e43-4718-46d0-97e3-6f8277789f2f","sequence":15},"last":{"id":"0b878e43-4718-46d0-97e3-6f8277789f2f","sequence":15},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:2","workspaceRoot":"/tmp/muse-phase0/repo"}},{"method":"turn/started","params":{"commandId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"last":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:3"}},{"method":"item/completed","params":{"item":{"commandId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","itemId":"38d5182a-7782-429b-83e7-7abbf478b742","kind":"userMessage","recordedAt":"2026-09-29T20:03:51.040894Z","revision":1,"status":"completed","text":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"last":{"id":"8e541f7e-88da-4639-be2d-3e83a2c56a7b","sequence":17},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:4"}},{"method":"item/started","params":{"item":{"childSessionId":"ea994a51-a77f-4052-85d7-50112251cccb","fallbackText":"Reminder child session","generationId":1,"itemId":"b64f0073-af31-4829-82a0-daeb601a87e9","kind":"reminderChild","recordedAt":"2026-09-29T20:03:51.049851Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eec4-3488-7911-aa2c-46f3d9929027","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"b64f0073-af31-4829-82a0-daeb601a87e9","sequence":35},"last":{"id":"b64f0073-af31-4829-82a0-daeb601a87e9","sequence":35},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:5"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":233,"promptTokens":38162,"totalTokens":38395},"durationMs":44585,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38162,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"5d39893f-b7e3-495d-95e5-cf325a813ee3","sequence":51},"last":{"id":"5d39893f-b7e3-495d-95e5-cf325a813ee3","sequence":51},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"totalTokens":38395,"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38162,"outputTokens":233,"reasoningTokens":129},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:6"}},{"method":"item/started","params":{"item":{"args":"{\"todos\":[{\"status\":\"in_progress\",\"text\":\"inspect f\"},{\"status\":\"pending\",\"text\":\"report\"}]}","callId":"call_01a0eec4e0b576aabeae2e104585722e","itemId":"01a0eec4-e2b8-72c3-9a10-5c710d5b666f","kind":"toolCall","recordedAt":"2026-09-29T20:04:35.641535Z","revision":1,"status":"inProgress","tool":"write_todos","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"15effe29-72a7-490e-8724-cece71174573","sequence":53},"last":{"id":"3b4efa42-5403-4efa-8354-f83a360912ce","sequence":58},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:7"}},{"method":"session/todoListChanged","params":{"items":[{"status":"inProgress","text":"inspect f"},{"status":"pending","text":"report"}],"revision":1,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"bdffd683-b042-4196-a976-5c1435f7162c","sequence":59},"last":{"id":"bdffd683-b042-4196-a976-5c1435f7162c","sequence":59},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"sourceTool":"write_todos","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:8"}},{"method":"item/completed","params":{"item":{"args":"{\"todos\":[{\"status\":\"in_progress\",\"text\":\"inspect f\"},{\"status\":\"pending\",\"text\":\"report\"}]}","callId":"call_01a0eec4e0b576aabeae2e104585722e","itemId":"01a0eec4-e2b8-72c3-9a10-5c710d5b666f","kind":"toolCall","recordedAt":"2026-09-29T20:04:35.642482Z","revision":2,"status":"completed","tool":"write_todos","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","visibleOutput":"{\"items\":2,\"ok\":true,\"revision\":1}"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"15effe29-72a7-490e-8724-cece71174573","sequence":53},"last":{"id":"fe541d1f-abb8-45f7-a2b0-cf7dbdfd69a1","sequence":61},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:9"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":402,"promptTokens":76600,"totalTokens":77002},"durationMs":21970,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38438,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"4674331a-f993-458b-b6aa-e36cc160f2d7","sequence":80},"last":{"id":"4674331a-f993-458b-b6aa-e36cc160f2d7","sequence":80},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"totalTokens":38607,"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","usage":{"cacheReadTokens":38129,"cacheWriteTokens":0,"cachedTokens":38129,"inputTokens":38438,"outputTokens":169,"reasoningTokens":67},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:10"}},{"method":"item/started","params":{"item":{"args":"{\"questions\":[{\"header\":\"Color\",\"id\":\"color_choice\",\"options\":[{\"label\":\"Blue\"},{\"label\":\"Green\"}],\"question\":\"Which color should I proceed with, Blue or Green?\"}]}","callId":"call_01a0eec5357571379191c94326ef7ab8","itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","kind":"toolCall","recordedAt":"2026-09-29T20:04:57.621217Z","revision":1,"status":"inProgress","tool":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"2ff469cc-5f3f-44dc-a7ac-1f8f8d8e0409","sequence":82},"last":{"id":"78484e0f-7d0b-48be-8b70-606cf6a718aa","sequence":87},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:11"}},{"method":"userInput/requested","params":{"itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","questions":[{"header":"Color","id":"color_choice","options":[{"label":"Blue"},{"label":"Green"}],"question":"Which color should I proceed with, Blue or Green?","selection":{"mode":"single"}}],"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"54c9e4de-cba8-49c1-aced-1721ba3731a8","sequence":88},"last":{"id":"54c9e4de-cba8-49c1-aced-1721ba3731a8","sequence":88},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"toolCallId":"call_01a0eec5357571379191c94326ef7ab8","toolName":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","userInputId":"01a0eec5-3894-7a91-9762-e13cf06c117f","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:12"}},{"method":"userInput/settled","params":{"answers":[{"questionId":"color_choice","selectedLabel":"Blue"}],"clarification":null,"decidedByCommandId":"01a0eec5-3897-757d-af17-a34de5a1cfe4","outcome":"answered","reason":null,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"909310e9-7253-4b4c-963e-2f46628f1aae","sequence":91},"last":{"id":"909310e9-7253-4b4c-963e-2f46628f1aae","sequence":91},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"userInputId":"01a0eec5-3894-7a91-9762-e13cf06c117f","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:13"}},{"method":"item/completed","params":{"item":{"args":"{\"questions\":[{\"header\":\"Color\",\"id\":\"color_choice\",\"options\":[{\"label\":\"Blue\"},{\"label\":\"Green\"}],\"question\":\"Which color should I proceed with, Blue or Green?\"}]}","callId":"call_01a0eec5357571379191c94326ef7ab8","itemId":"01a0eec5-3894-7a91-9762-e13cf06c117f","kind":"toolCall","recordedAt":"2026-09-29T20:04:57.624274Z","revision":2,"status":"completed","tool":"request_user_input","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","visibleOutput":"{\"status\":\"answered\",\"answers\":[{\"id\":\"color_choice\",\"selected_label\":\"Blue\"}]}"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"2ff469cc-5f3f-44dc-a7ac-1f8f8d8e0409","sequence":82},"last":{"id":"b7264ba7-6895-475a-a4b8-56bed8767e35","sequence":93},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:14"}},{"method":"item/completed","params":{"item":{"itemId":"e187c684-c3d9-45e8-bbae-c1507cc9e8d1","kind":"agentMessage","recordedAt":"2026-09-29T20:05:15.287526Z","revision":2,"status":"completed","text":"You chose Blue.\n\nTodos created: inspect f (in progress), report (pending). Awaiting direction to proceed.","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"6834f18d-2fc1-4a06-8a21-bfb486bd0338","sequence":110},"last":{"id":"6834f18d-2fc1-4a06-8a21-bfb486bd0338","sequence":110},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:15"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":525,"promptTokens":115255,"totalTokens":115780},"durationMs":17661,"modelId":"meta/muse-spark-1.3","promptTokens":38655,"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"a5633a10-4fb0-4873-b47d-4d558bd3c4e5","sequence":113},"last":{"id":"a5633a10-4fb0-4873-b47d-4d558bd3c4e5","sequence":113},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"totalTokens":38778,"turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","usage":{"cacheReadTokens":38385,"cacheWriteTokens":0,"cachedTokens":38385,"inputTokens":38655,"outputTokens":123,"reasoningTokens":90},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:16"}},{"method":"item/started","params":{"item":{"childSessionId":"cf7f87cb-f82a-441e-b840-b89cfdc03e18","childSessionLogPath":"subagent/cf7f87cb-f82a-441e-b840-b89cfdc03e18/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"9da8e5a6-f48f-4cfb-b8ed-79ea0d71f842","kind":"reminderChild","recordedAt":"2026-09-29T20:05:15.294057Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eec5-7d9c-7f61-b098-af5f30813223","turnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda"},"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","sourceRange":{"first":{"id":"9da8e5a6-f48f-4cfb-b8ed-79ea0d71f842","sequence":120},"last":{"id":"9da8e5a6-f48f-4cfb-b8ed-79ea0d71f842","sequence":120},"stream":{"id":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","kind":"session"}},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:17"}}],"nextCursor":null}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":6,"method":"session/read","params":{"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e"}}} +{"dir":"in","msg":{"id":6,"jsonrpc":"2.0","result":{"history":{"items":null,"mode":"none","noneReason":"excluded","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":"01a0eec4-347d-7a14-a97f-3fd6be129dda","approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"branch":"main","createdAt":"2026-09-29T20:03:50.94472Z","firstUserPrompt":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","forkedFrom":null,"lastActivityAt":"2026-09-29T20:05:15.294057Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"running","title":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnCount":0,"updatedAt":"2026-09-29T20:05:15.294321Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:17"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":7,"method":"session/compact","params":{"commandId":"01a0eec5-e331-73ef-ab77-595e061742b7","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e"}}} +{"dir":"in","msg":{"error":{"code":-32030,"data":{"commandId":"01a0eec5-e331-73ef-ab77-595e061742b7","kind":"commandRejected","reason":"run_active","retryable":false},"message":"session/compact command 01a0eec5-e331-73ef-ab77-595e061742b7 rejected: run_active"},"id":7,"jsonrpc":"2.0"}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":8,"method":"usage/read","params":{}}} +{"dir":"in","msg":{"id":8,"jsonrpc":"2.0","result":{}}} +{"dir":"in","msg":{"emittedAtMs":1790712344524,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790712344524,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"notLoaded","viewCursor":"v:01a0eec4-3420-7d50-bfdb-bc7f1701193e:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790712344524,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:03:50.94472Z","firstUserPrompt":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0eec4-3420-7d50-bfdb-bc7f1701193e/session.jsonl","providerId":"meta","sessionId":"01a0eec4-3420-7d50-bfdb-bc7f1701193e","status":"notLoaded","title":"Use todo_write to create two todos: inspect f (in progress) and report (pending). Then use ask_user_question to ask me to choose Blue or Green before proceeding. Do not infer my answer.","turnCount":0,"updatedAt":"2026-09-29T20:05:41.304053Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-default-workflow.ndjson b/plugins/muse-provider/test/fixtures/phase3-default-workflow.ndjson new file mode 100644 index 0000000000..751619557f --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-default-workflow.ndjson @@ -0,0 +1,7 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-parity/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/read","params":{"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":null,"mode":"none","noneReason":"excluded","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"replay"},"branch":"main","createdAt":"2026-09-29T20:20:38.31556Z","firstUserPrompt":"Reply exactly MUSE_PARITY_READY. Do not use tools.","forkedFrom":null,"lastActivityAt":"2026-09-29T20:29:35.688075Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-parity/data/muse/sessions/2026/09/29/01a0eed3-932b-73e3-af13-d270ac13c13e/session.jsonl","providerId":"meta","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","status":"notLoaded","title":"Reply exactly MUSE_PARITY_READY. Do not use tools.","turnCount":4,"updatedAt":"2026-09-29T20:29:35.688075Z","workspaceRoot":"/tmp/muse-parity/repo"},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:55"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"view/page","params":{"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","limit":1000}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"events":[{"method":"session/approvalModeChanged","params":{"clientName":"paseo","commandId":"01a0eed3-931c-7e09-940b-a18c476535fc","mode":"onRequest","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","source":"approvalReconfigure","sourceRange":{"first":{"id":"e5f590d4-1e22-4de3-87e2-2fce1890b73e","sequence":5},"last":{"id":"e5f590d4-1e22-4de3-87e2-2fce1890b73e","sequence":5},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:1"}},{"method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"3e7b25da-ae59-4948-bf34-dbcc64cc6ed4","sequence":27},"last":{"id":"3e7b25da-ae59-4948-bf34-dbcc64cc6ed4","sequence":27},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:2","workspaceRoot":"/tmp/muse-parity/repo"}},{"method":"turn/started","params":{"commandId":"01a0eed3-9490-7d1f-9d49-37a21c167827","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"621ad9a3-090f-4de3-bcc1-04bde2eb4275","sequence":29},"last":{"id":"621ad9a3-090f-4de3-bcc1-04bde2eb4275","sequence":29},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:3"}},{"method":"item/completed","params":{"item":{"commandId":"01a0eed3-9490-7d1f-9d49-37a21c167827","itemId":"13033301-7a88-4975-b649-6b625d06f6c2","kind":"userMessage","recordedAt":"2026-09-29T20:20:38.67983Z","revision":1,"status":"completed","text":"Reply exactly MUSE_PARITY_READY. Do not use tools.","turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"621ad9a3-090f-4de3-bcc1-04bde2eb4275","sequence":29},"last":{"id":"621ad9a3-090f-4de3-bcc1-04bde2eb4275","sequence":29},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:4"}},{"method":"item/started","params":{"item":{"childSessionId":"cec38684-5da4-4884-a207-ef7834c0c389","fallbackText":"Reminder child session","generationId":1,"itemId":"5e203ac7-881e-4731-b6dc-a887c5763cce","kind":"reminderChild","recordedAt":"2026-09-29T20:20:38.697965Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eed3-94a8-7051-a7b4-675143c10378","turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"5e203ac7-881e-4731-b6dc-a887c5763cce","sequence":47},"last":{"id":"5e203ac7-881e-4731-b6dc-a887c5763cce","sequence":47},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:5"}},{"method":"item/completed","params":{"item":{"itemId":"c77e54d5-dd15-40a3-a5e0-0d978d17f3c2","kind":"agentMessage","recordedAt":"2026-09-29T20:20:40.835405Z","revision":2,"status":"completed","text":"MUSE_PARITY_READY","turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"96c261f4-c700-4559-86c8-9b550158256c","sequence":60},"last":{"id":"96c261f4-c700-4559-86c8-9b550158256c","sequence":60},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:6"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":28,"promptTokens":42376,"totalTokens":42404},"durationMs":2138,"modelId":"meta/muse-spark-1.3","promptTokens":42376,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"6a7ec8a7-2079-4ae2-a891-fcb2f8a07ec8","sequence":63},"last":{"id":"6a7ec8a7-2079-4ae2-a891-fcb2f8a07ec8","sequence":63},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"totalTokens":42404,"turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":42376,"outputTokens":28,"reasoningTokens":13},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:7"}},{"method":"item/started","params":{"item":{"childSessionId":"3d09af71-0bcc-4b94-ba8f-5acf92f259fe","fallbackText":"Reminder child session","generationId":1,"itemId":"74a8a721-4c79-4f69-8ff6-45ed99f86cad","kind":"reminderChild","recordedAt":"2026-09-29T20:20:40.843309Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eed3-9d0a-7591-bea5-563258797d0b","turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"74a8a721-4c79-4f69-8ff6-45ed99f86cad","sequence":70},"last":{"id":"74a8a721-4c79-4f69-8ff6-45ed99f86cad","sequence":70},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:8"}},{"method":"item/completed","params":{"item":{"childSessionId":"3d09af71-0bcc-4b94-ba8f-5acf92f259fe","fallbackText":"Reminder child session","generationId":1,"itemId":"74a8a721-4c79-4f69-8ff6-45ed99f86cad","kind":"reminderChild","recordedAt":"2026-09-29T20:21:07.122102Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eed3-9d0a-7591-bea5-563258797d0b","turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"74a8a721-4c79-4f69-8ff6-45ed99f86cad","sequence":70},"last":{"id":"4516461e-5fa2-439d-9b4e-8ad009827cef","sequence":72},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:9"}},{"method":"item/completed","params":{"item":{"childSessionId":"cec38684-5da4-4884-a207-ef7834c0c389","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"5e203ac7-881e-4731-b6dc-a887c5763cce","kind":"reminderChild","recordedAt":"2026-09-29T20:21:07.124683Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eed3-94a8-7051-a7b4-675143c10378","turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"5e203ac7-881e-4731-b6dc-a887c5763cce","sequence":47},"last":{"id":"127a52d4-8345-4b21-8b2b-2de5acd43aa9","sequence":76},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:10"}},{"method":"turn/completed","params":{"durationMs":28445,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"24aabfdb-72c9-4bf7-9bb6-0ea2d464e1b3","sequence":78},"last":{"id":"24aabfdb-72c9-4bf7-9bb6-0ea2d464e1b3","sequence":78},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":2101,"turnId":"01a0eed3-9490-7d1f-9d49-37a21c167827","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:11"}},{"method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"ce7e1c0f-ddda-4972-b534-bc92924685f8","sequence":82},"last":{"id":"ce7e1c0f-ddda-4972-b534-bc92924685f8","sequence":82},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:12","workspaceRoot":"/tmp/muse-parity/repo"}},{"method":"turn/started","params":{"commandId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"4e92c557-fea3-4adb-b9f1-a219e2766de2","sequence":83},"last":{"id":"4e92c557-fea3-4adb-b9f1-a219e2766de2","sequence":83},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:13"}},{"method":"item/completed","params":{"item":{"commandId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646","itemId":"fc181aa2-5c85-4575-9c3a-a651ab9478c5","kind":"userMessage","recordedAt":"2026-09-29T20:22:43.338938Z","revision":1,"status":"completed","text":"/muse-parity-user","turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"4e92c557-fea3-4adb-b9f1-a219e2766de2","sequence":83},"last":{"id":"4e92c557-fea3-4adb-b9f1-a219e2766de2","sequence":83},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:14"}},{"method":"item/started","params":{"item":{"childSessionId":"fad33bda-d96d-4fa3-88ae-f81530005c1c","fallbackText":"Reminder child session","generationId":1,"itemId":"0ee04e13-90e5-4cb2-af03-b6652be140bb","kind":"reminderChild","recordedAt":"2026-09-29T20:22:43.34489Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eed5-7b90-78c1-9bb3-3e0964c21058","turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"0ee04e13-90e5-4cb2-af03-b6652be140bb","sequence":101},"last":{"id":"0ee04e13-90e5-4cb2-af03-b6652be140bb","sequence":101},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:15"}},{"method":"item/completed","params":{"item":{"itemId":"1fb15644-4718-4e8f-9de1-07c7a2aed493","kind":"agentMessage","recordedAt":"2026-09-29T20:22:46.666881Z","revision":2,"status":"completed","text":"MUSE_PARITY_USER_OK","turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"285cf5ec-9f46-4432-8783-3a26bf8f227d","sequence":114},"last":{"id":"285cf5ec-9f46-4432-8783-3a26bf8f227d","sequence":114},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:16"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":69,"promptTokens":84939,"totalTokens":85008},"durationMs":3323,"modelId":"meta/muse-spark-1.3","promptTokens":42563,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"04716cb9-ff28-4cdb-92ed-673336fe8e6c","sequence":117},"last":{"id":"04716cb9-ff28-4cdb-92ed-673336fe8e6c","sequence":117},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"totalTokens":42604,"turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646","usage":{"cacheReadTokens":42353,"cacheWriteTokens":0,"cachedTokens":42353,"inputTokens":42563,"outputTokens":41,"reasoningTokens":25},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:17"}},{"method":"item/started","params":{"item":{"childSessionId":"a1cb2525-f5b0-47b2-a1ff-78e559d92aaf","fallbackText":"Reminder child session","generationId":1,"itemId":"5edfc05e-e503-416c-8b57-fdae2bb628be","kind":"reminderChild","recordedAt":"2026-09-29T20:22:46.672229Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eed5-888f-7e03-88be-47ead1dc0403","turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"5edfc05e-e503-416c-8b57-fdae2bb628be","sequence":124},"last":{"id":"5edfc05e-e503-416c-8b57-fdae2bb628be","sequence":124},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:18"}},{"method":"item/completed","params":{"item":{"childSessionId":"fad33bda-d96d-4fa3-88ae-f81530005c1c","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"0ee04e13-90e5-4cb2-af03-b6652be140bb","kind":"reminderChild","recordedAt":"2026-09-29T20:23:49.319829Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eed5-7b90-78c1-9bb3-3e0964c21058","turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"0ee04e13-90e5-4cb2-af03-b6652be140bb","sequence":101},"last":{"id":"6a3021bc-7c2f-4578-8f7c-ca8fbc48d075","sequence":128},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:19"}},{"method":"item/completed","params":{"item":{"childSessionId":"a1cb2525-f5b0-47b2-a1ff-78e559d92aaf","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"5edfc05e-e503-416c-8b57-fdae2bb628be","kind":"reminderChild","recordedAt":"2026-09-29T20:23:49.319989Z","reminderAgentId":"verify-reminder","revision":2,"status":"cancelled","taskId":"01a0eed5-888f-7e03-88be-47ead1dc0403","turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"5edfc05e-e503-416c-8b57-fdae2bb628be","sequence":124},"last":{"id":"a0001d86-c30d-4f13-899c-0c5754bc371e","sequence":129},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:20"}},{"method":"turn/completed","params":{"durationMs":65981,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"281374ab-9801-41bf-a86e-48f4ae38a114","sequence":132},"last":{"id":"281374ab-9801-41bf-a86e-48f4ae38a114","sequence":132},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":3284,"turnId":"01a0eed5-7b87-763f-98b5-aa3bcf41b646","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:21"}},{"method":"turn/started","params":{"commandId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"020df195-c790-42c0-9620-334ad004ceb2","sequence":138},"last":{"id":"020df195-c790-42c0-9620-334ad004ceb2","sequence":138},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:22"}},{"method":"item/completed","params":{"item":{"commandId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","itemId":"94a3b885-3b56-4ccb-b78d-36a0871fb9ad","kind":"userMessage","recordedAt":"2026-09-29T20:25:34.132571Z","revision":1,"status":"completed","text":"Spawn one native subagent in this same workspace, without a worktree. Ask it to reply MUSE_PARITY_CHILD_OK without tools. Wait for it and read its result. Then report the exact result.","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"020df195-c790-42c0-9620-334ad004ceb2","sequence":138},"last":{"id":"020df195-c790-42c0-9620-334ad004ceb2","sequence":138},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:23"}},{"method":"item/started","params":{"item":{"childSessionId":"bc91fcc4-0b2f-431b-a95d-3bc02197624e","fallbackText":"Reminder child session","generationId":1,"itemId":"e79c416d-2da6-4ebb-8f48-bfb821a04033","kind":"reminderChild","recordedAt":"2026-09-29T20:25:34.141088Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eed8-16bb-7bd3-9e27-ffdecd0dd526","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"e79c416d-2da6-4ebb-8f48-bfb821a04033","sequence":155},"last":{"id":"e79c416d-2da6-4ebb-8f48-bfb821a04033","sequence":155},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:24"}},{"method":"item/completed","params":{"item":{"itemId":"6c408c57-e8c2-4361-a23f-96492e13ec5f","kind":"reasoning","providerItemId":"rs_6abc1ec2d96d7e128bf2443f:rs_01a0eed827c4737aa8620c2f582a17a2","recordedAt":"2026-09-29T20:25:45.516664Z","revision":2,"status":"completed","summary":["Evaluating the native subagent spawn via workflow tool and output constraint.Selecting the workflow tool as the first step to spawn the native subagent."],"turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"24e4ccb9-18f2-40d1-b630-2ed9a5ba91ad","sequence":169},"last":{"id":"24e4ccb9-18f2-40d1-b630-2ed9a5ba91ad","sequence":169},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:25"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":817,"promptTokens":127591,"totalTokens":128408},"durationMs":12002,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":42652,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"ef2bd965-531c-4f07-9957-c0c481c7627c","sequence":174},"last":{"id":"ef2bd965-531c-4f07-9957-c0c481c7627c","sequence":174},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"totalTokens":43400,"turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","usage":{"cacheReadTokens":42481,"cacheWriteTokens":0,"cachedTokens":42481,"inputTokens":42652,"outputTokens":748,"reasoningTokens":558},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:26"}},{"method":"item/started","params":{"item":{"args":"{\"args\":null,\"name\":\"spawn parity child\",\"script\":\"export default async function workflow(host) { const result = await host.agent({ input: \\\"Reply exactly MUSE_PARITY_CHILD_OK. Do not use tools.\\\" }); return { status: \\\"ok\\\", ref: result.ref, text: result.text }; }\"}","callId":"call_01a0eed8426e710da463d6b58a683556","itemId":"01a0eed8-45a3-7a90-bd9f-dd7825ca7d73","kind":"toolCall","recordedAt":"2026-09-29T20:25:46.147985Z","revision":1,"status":"inProgress","tool":"workflow","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"a918854d-ea32-4bc2-8d4a-335312d095a8","sequence":176},"last":{"id":"b516abf5-88df-4487-9bee-5f90f988e3a8","sequence":182},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:27"}},{"method":"item/completed","params":{"item":{"args":"{\"args\":null,\"name\":\"spawn parity child\",\"script\":\"export default async function workflow(host) { const result = await host.agent({ input: \\\"Reply exactly MUSE_PARITY_CHILD_OK. Do not use tools.\\\" }); return { status: \\\"ok\\\", ref: result.ref, text: result.text }; }\"}","callId":"call_01a0eed8426e710da463d6b58a683556","itemId":"01a0eed8-45a3-7a90-bd9f-dd7825ca7d73","kind":"toolCall","recordedAt":"2026-09-29T20:25:46.154672Z","revision":2,"status":"completed","tool":"workflow","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","visibleOutput":"{\"args\":null,\"entryId\":\"spawn parity child\",\"hostApiVersion\":\"v1\",\"maxParallelAgents\":14,\"message\":\"Workflow launched: the workflow runs in the background and its completion is delivered to this conversation. Do not call workflow again while this owner is live. The persisted script lives at /tmp/muse-workflow-session-QQ6yi5/workflows/scripts/01a0eed8-45a4-7553-95ac-4b2d977782c7.js. To iterate after this owner ends (completion, failure, or reported recovery), edit that file and call workflow again with {\\\"name\\\": \\\"spawn parity child\\\", \\\"scriptPath\\\": \\\"/tmp/muse-workflow-session-QQ6yi5/workflows/scripts/01a0eed8-45a4-7553-95ac-4b2d977782c7.js\\\", \\\"resumeFromRunId\\\": \\\"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556\\\"} instead of resending inline script; a resume re-executes the script from the top and reuses only the longest unchanged completed call prefix, so completed agent() calls before your first change replay from the journal instead of re-running. Runtime admission (policy, caps, duplicates) may still reject a resume. To stop this run before it completes, call work_stop with work_id = work.v1.workflow.sha256.7ef8923b4c9481e5fd18eda03337c24e338bc27c81453b74d45b34372050dec6.\",\"policy\":{\"caps\":\"caps:generated-js-workflow\",\"childLimit\":14,\"id\":\"policy:standard\"},\"scriptBytes\":210,\"scriptHash\":\"sha256:8a896fd97908248633764a409ec0ba5a17a0df3cf01d0fff31ecd6023ad9e8a1\",\"scriptPath\":\"/tmp/muse-workflow-session-QQ6yi5/workflows/scripts/01a0eed8-45a4-7553-95ac-4b2d977782c7.js\",\"status\":\"launched\",\"taskId\":\"01a0eed8-45a4-7553-95ac-4b2d977782c7\",\"tokenBudget\":null,\"workId\":\"work.v1.workflow.sha256.7ef8923b4c9481e5fd18eda03337c24e338bc27c81453b74d45b34372050dec6\",\"workflowRunId\":\"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556\",\"workflowRunIdDescription\":\"Internal opaque control handle for Workflow calls only. Pass this exact value only as resumeFromRunId; never repeat it in user-facing prose.\"}"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"a918854d-ea32-4bc2-8d4a-335312d095a8","sequence":176},"last":{"id":"447a11b5-a5aa-474e-bcda-3e6f013de031","sequence":186},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:28"}},{"method":"item/started","params":{"item":{"children":[],"entryId":"spawn parity child","fallbackText":"Workflow: model-chosen generated workflow","itemId":"31dba18d-857b-4162-afc0-7883f5aebc0e","kind":"workflow","recordedAt":"2026-09-29T20:25:46.154908Z","revision":1,"scriptId":"generated.workflow.spawn_parity_child","status":"inProgress","triggerSource":"guidanceAuto","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","workflowRunId":"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"last":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:29"}},{"method":"item/completed","params":{"item":{"childSessionId":"bc91fcc4-0b2f-431b-a95d-3bc02197624e","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"e79c416d-2da6-4ebb-8f48-bfb821a04033","kind":"reminderChild","recordedAt":"2026-09-29T20:25:46.164296Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eed8-16bb-7bd3-9e27-ffdecd0dd526","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"e79c416d-2da6-4ebb-8f48-bfb821a04033","sequence":155},"last":{"id":"d30ba6fe-0058-4c76-bdcd-db8442f4f8a3","sequence":199},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:30"}},{"method":"turn/completed","params":{"durationMs":12032,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"0959cbda-3c7e-4d82-a400-7f344204e6e4","sequence":201},"last":{"id":"0959cbda-3c7e-4d82-a400-7f344204e6e4","sequence":201},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":6515,"turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:31"}},{"method":"item/updated","params":{"item":{"children":[{"attempt":1,"childId":"01a0eed8-45b6-7810-a015-af925aa86416","status":"scheduled"}],"entryId":"spawn parity child","fallbackText":"Workflow: model-chosen generated workflow","itemId":"31dba18d-857b-4162-afc0-7883f5aebc0e","kind":"workflow","recordedAt":"2026-09-29T20:25:46.168395Z","revision":2,"scriptId":"generated.workflow.spawn_parity_child","status":"inProgress","triggerSource":"guidanceAuto","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","workflowRunId":"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"last":{"id":"8d852df5-bab8-467e-a534-00466a62eb73","sequence":203},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:32"}},{"method":"item/updated","params":{"item":{"children":[{"attempt":1,"childId":"01a0eed8-45b6-7810-a015-af925aa86416","status":"started"}],"entryId":"spawn parity child","fallbackText":"Workflow: model-chosen generated workflow","itemId":"31dba18d-857b-4162-afc0-7883f5aebc0e","kind":"workflow","recordedAt":"2026-09-29T20:25:46.176812Z","revision":3,"scriptId":"generated.workflow.spawn_parity_child","status":"inProgress","triggerSource":"guidanceAuto","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","workflowRunId":"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"last":{"id":"4feba775-86a0-4dcb-be62-e922a6f2cb1b","sequence":215},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:33"}},{"method":"item/updated","params":{"item":{"children":[{"attempt":1,"childId":"01a0eed8-45b6-7810-a015-af925aa86416","status":"usage","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":36383,"outputTokens":246,"reasoningTokens":184}}],"entryId":"spawn parity child","fallbackText":"Workflow: model-chosen generated workflow","itemId":"31dba18d-857b-4162-afc0-7883f5aebc0e","kind":"workflow","recordedAt":"2026-09-29T20:26:03.529253Z","revision":4,"scriptId":"generated.workflow.spawn_parity_child","status":"inProgress","triggerSource":"guidanceAuto","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","workflowRunId":"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"last":{"id":"6a319567-897f-4423-8808-54683c29d18b","sequence":217},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:34"}},{"method":"item/updated","params":{"item":{"children":[{"attempt":1,"childId":"01a0eed8-45b6-7810-a015-af925aa86416","durationMs":17340,"resultRef":"subagent-result://01a0eed8-45b6-7810-a015-af925aa86416/task/4d18b0eb-a557-5a5f-b101-1fde09ebd4e2#5","status":"completed"}],"entryId":"spawn parity child","fallbackText":"Workflow: model-chosen generated workflow","itemId":"31dba18d-857b-4162-afc0-7883f5aebc0e","kind":"workflow","recordedAt":"2026-09-29T20:26:03.529999Z","revision":5,"scriptId":"generated.workflow.spawn_parity_child","status":"inProgress","triggerSource":"guidanceAuto","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","workflowRunId":"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"last":{"id":"437d1f27-fb59-4905-aad5-d90c2e45d0af","sequence":220},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:35"}},{"method":"item/updated","params":{"item":{"children":[{"attempt":1,"childId":"01a0eed8-45b6-7810-a015-af925aa86416","durationMs":17340,"resultRef":"subagent-result://01a0eed8-45b6-7810-a015-af925aa86416/task/4d18b0eb-a557-5a5f-b101-1fde09ebd4e2#5","status":"terminal","terminal":"completed"}],"entryId":"spawn parity child","fallbackText":"Workflow: model-chosen generated workflow","itemId":"31dba18d-857b-4162-afc0-7883f5aebc0e","kind":"workflow","recordedAt":"2026-09-29T20:26:03.530175Z","revision":6,"scriptId":"generated.workflow.spawn_parity_child","status":"inProgress","triggerSource":"guidanceAuto","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","workflowRunId":"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"last":{"id":"feef6547-fed1-467b-aa1d-50714586bebd","sequence":221},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:36"}},{"method":"item/completed","params":{"item":{"children":[{"attempt":1,"childId":"01a0eed8-45b6-7810-a015-af925aa86416","durationMs":17340,"resultRef":"subagent-result://01a0eed8-45b6-7810-a015-af925aa86416/task/4d18b0eb-a557-5a5f-b101-1fde09ebd4e2#5","status":"terminal","terminal":"completed"}],"entryId":"spawn parity child","fallbackText":"Workflow: model-chosen generated workflow","itemId":"31dba18d-857b-4162-afc0-7883f5aebc0e","kind":"workflow","message":"{\"agents_activity\":[{\"agent\":\"01a0eed8-45b6-7810-a015-af925aa86416\",\"duration_ms\":17340,\"tool_calls\":0}],\"call_id\":\"call_01a0eed8426e710da463d6b58a683556\",\"child_work_started\":true,\"deferred_to_background\":false,\"final_summary\":{\"status\":\"completed\",\"summary\":\"MUSE_PARITY_CHILD_OK\"},\"final_summary_instruction\":\"Use final_summary.summary as the completed workflow output.\",\"latest_failure\":null,\"launch_admitted\":true,\"launch_command_id\":\"2fdf4f42-54b3-4f4e-8b7c-2e5b88c0df4d\",\"production_owner_loop_started\":true,\"provider_or_tool_io_started\":true,\"route\":\"runtime command admission -> production owner loop\",\"type\":\"workflow_launch_reconciled\",\"workspace_handoffs\":[{\"agent\":\"01a0eed8-45b6-7810-a015-af925aa86416\",\"description\":\"Subagent workspace: shared\"}]}","recordedAt":"2026-09-29T20:26:03.535398Z","revision":7,"scriptId":"generated.workflow.spawn_parity_child","status":"completed","triggerSource":"guidanceAuto","turnId":"01a0eed8-16b2-77b8-ae22-9455e0b6804a","workflowRunId":"workflow-run-model-tool-call_01a0eed8426e710da463d6b58a683556"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"31dba18d-857b-4162-afc0-7883f5aebc0e","sequence":187},"last":{"id":"a3221d26-4614-4c00-b599-f7a0a33e21f6","sequence":223},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:37"}},{"method":"turn/started","params":{"commandId":"01a0eed8-8990-7271-9e30-32ac5633d609","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"b0f895bf-adcd-4057-a01e-b5c9bdeff3bf","sequence":229},"last":{"id":"b0f895bf-adcd-4057-a01e-b5c9bdeff3bf","sequence":229},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"turnId":"01a0eed8-8990-7271-9e30-32ac5633d609","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:38"}},{"method":"item/started","params":{"item":{"childSessionId":"4ed57256-2cd8-4626-9920-4717fc722540","fallbackText":"Reminder child session","generationId":1,"itemId":"39e56ac4-800d-42fc-9c7d-3930ba386e6a","kind":"reminderChild","recordedAt":"2026-09-29T20:26:03.549717Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eed8-899c-7df1-b4cd-51819d9a5ef7","turnId":"01a0eed8-8990-7271-9e30-32ac5633d609"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"39e56ac4-800d-42fc-9c7d-3930ba386e6a","sequence":246},"last":{"id":"39e56ac4-800d-42fc-9c7d-3930ba386e6a","sequence":246},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:39"}},{"method":"item/completed","params":{"item":{"itemId":"fd03f853-b1b6-4e17-9027-93b822ab461f","kind":"agentMessage","recordedAt":"2026-09-29T20:26:06.821505Z","revision":2,"status":"completed","text":"MUSE_PARITY_CHILD_OK","turnId":"01a0eed8-8990-7271-9e30-32ac5633d609"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"002a4c90-a9d5-4af5-9964-9471e2ae2c93","sequence":259},"last":{"id":"002a4c90-a9d5-4af5-9964-9471e2ae2c93","sequence":259},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:40"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":925,"promptTokens":172385,"totalTokens":173310},"durationMs":3274,"modelId":"meta/muse-spark-1.3","promptTokens":44794,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"4803220f-dc93-4ef2-8997-681916e54764","sequence":262},"last":{"id":"4803220f-dc93-4ef2-8997-681916e54764","sequence":262},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"totalTokens":44902,"turnId":"01a0eed8-8990-7271-9e30-32ac5633d609","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":44794,"outputTokens":108,"reasoningTokens":92},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:41"}},{"method":"item/started","params":{"item":{"childSessionId":"12ef4c41-c0c1-43fd-8488-7a8518a5a72b","fallbackText":"Reminder child session","generationId":1,"itemId":"d9fb16ad-4169-49f7-b13f-01a9190f23f1","kind":"reminderChild","recordedAt":"2026-09-29T20:26:06.828633Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eed8-966c-73e0-af5c-2ddb56432d01","turnId":"01a0eed8-8990-7271-9e30-32ac5633d609"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"d9fb16ad-4169-49f7-b13f-01a9190f23f1","sequence":269},"last":{"id":"d9fb16ad-4169-49f7-b13f-01a9190f23f1","sequence":269},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:42"}},{"method":"item/completed","params":{"item":{"childSessionId":"12ef4c41-c0c1-43fd-8488-7a8518a5a72b","fallbackText":"Reminder child session","generationId":1,"itemId":"d9fb16ad-4169-49f7-b13f-01a9190f23f1","kind":"reminderChild","recordedAt":"2026-09-29T20:26:12.073884Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eed8-966c-73e0-af5c-2ddb56432d01","turnId":"01a0eed8-8990-7271-9e30-32ac5633d609"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"d9fb16ad-4169-49f7-b13f-01a9190f23f1","sequence":269},"last":{"id":"83355680-dff1-4c14-84e7-b1e2fbabfdd7","sequence":271},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:43"}},{"method":"item/completed","params":{"item":{"childSessionId":"4ed57256-2cd8-4626-9920-4717fc722540","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"39e56ac4-800d-42fc-9c7d-3930ba386e6a","kind":"reminderChild","recordedAt":"2026-09-29T20:26:12.075841Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eed8-899c-7df1-b4cd-51819d9a5ef7","turnId":"01a0eed8-8990-7271-9e30-32ac5633d609"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"39e56ac4-800d-42fc-9c7d-3930ba386e6a","sequence":246},"last":{"id":"1395704d-186b-42cb-81c9-1b196b799db1","sequence":275},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:44"}},{"method":"turn/completed","params":{"durationMs":8538,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"10ca1fba-6e0b-4878-bf32-dffbd98da848","sequence":277},"last":{"id":"10ca1fba-6e0b-4878-bf32-dffbd98da848","sequence":277},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":3005,"turnId":"01a0eed8-8990-7271-9e30-32ac5633d609","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:45"}},{"method":"turn/started","params":{"commandId":"01a0eedb-985c-7976-95be-bd698ad7c26f","sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"c396b9cf-5aaa-4575-ad13-3ea92f45c7d9","sequence":283},"last":{"id":"c396b9cf-5aaa-4575-ad13-3ea92f45c7d9","sequence":283},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:46"}},{"method":"item/completed","params":{"item":{"commandId":"01a0eedb-985c-7976-95be-bd698ad7c26f","itemId":"35ac342e-8c07-49b5-b49b-cbc94b77550a","kind":"userMessage","recordedAt":"2026-09-29T20:29:23.935493Z","revision":1,"status":"completed","text":"Use the native subagent_spawn tool (not workflow) to spawn one child in shared placement, with the objective to reply MUSE_NATIVE_CHILD_OK without tools. Then use subagent_wait and subagent_read_result. Do not fabricate a child response. If those three tools are unavailable, report that fact and stop.","turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"c396b9cf-5aaa-4575-ad13-3ea92f45c7d9","sequence":283},"last":{"id":"c396b9cf-5aaa-4575-ad13-3ea92f45c7d9","sequence":283},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:47"}},{"method":"item/started","params":{"item":{"childSessionId":"40841c92-f7f0-49d0-be79-e9f8b49840ae","fallbackText":"Reminder child session","generationId":1,"itemId":"88f27e2d-73f0-4cef-8df9-136407dfccbc","kind":"reminderChild","recordedAt":"2026-09-29T20:29:23.949687Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eedb-986c-7af3-85f1-1969b4bf35e8","turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"88f27e2d-73f0-4cef-8df9-136407dfccbc","sequence":300},"last":{"id":"88f27e2d-73f0-4cef-8df9-136407dfccbc","sequence":300},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:48"}},{"method":"item/completed","params":{"item":{"itemId":"4a5cdd4a-85eb-4cc7-8caa-0e1e074765b6","kind":"reasoning","providerItemId":"rs_6abc1fa9318445219611407e:rs_01a0eedbadf67749aa0fe24c380cefed","recordedAt":"2026-09-29T20:29:32.463434Z","revision":2,"status":"completed","summary":["Checking that requested subagent tools are unavailable and ruling out alternatives."],"turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"c2e789ef-79d2-4315-ad7a-69eb1647db73","sequence":313},"last":{"id":"c2e789ef-79d2-4315-ad7a-69eb1647db73","sequence":313},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:49"}},{"method":"item/completed","params":{"item":{"itemId":"48382df7-a7f2-4905-b7a5-1e1f38e72e39","kind":"agentMessage","recordedAt":"2026-09-29T20:29:32.781524Z","revision":2,"status":"completed","text":"Those three tools are unavailable: no `subagent_spawn`, `subagent_wait`, or `subagent_read_result` in this session. Stopping without spawning.","turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"2ea66af3-381a-4c98-877b-b42ca42b7fcc","sequence":315},"last":{"id":"2ea66af3-381a-4c98-877b-b42ca42b7fcc","sequence":315},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:50"}},{"method":"session/tokenUsage","params":{"cumulative":{"outputTokens":1228,"promptTokens":217357,"totalTokens":218585},"durationMs":8856,"modelId":"meta/muse-spark-1.3","promptTokens":44972,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"3ef736cb-c187-4840-9626-b02a570d41a7","sequence":318},"last":{"id":"3ef736cb-c187-4840-9626-b02a570d41a7","sequence":318},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"totalTokens":45275,"turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f","usage":{"cacheReadTokens":42609,"cacheWriteTokens":0,"cachedTokens":42609,"inputTokens":44972,"outputTokens":303,"reasoningTokens":243},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:51"}},{"method":"item/started","params":{"item":{"childSessionId":"24e649bd-9271-4204-ad6d-1ef9afae2148","fallbackText":"Reminder child session","generationId":1,"itemId":"df7811bb-bb7c-4a3d-9014-917e213aaac0","kind":"reminderChild","recordedAt":"2026-09-29T20:29:32.809722Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eedb-bb09-7771-a0a4-706b31da0407","turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"df7811bb-bb7c-4a3d-9014-917e213aaac0","sequence":325},"last":{"id":"df7811bb-bb7c-4a3d-9014-917e213aaac0","sequence":325},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:52"}},{"method":"item/completed","params":{"item":{"childSessionId":"24e649bd-9271-4204-ad6d-1ef9afae2148","fallbackText":"Reminder child session","generationId":1,"itemId":"df7811bb-bb7c-4a3d-9014-917e213aaac0","kind":"reminderChild","recordedAt":"2026-09-29T20:29:35.684855Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eedb-bb09-7771-a0a4-706b31da0407","turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"df7811bb-bb7c-4a3d-9014-917e213aaac0","sequence":325},"last":{"id":"d9bf6a05-53e3-46f4-ba20-16d911fe33f2","sequence":327},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:53"}},{"method":"item/completed","params":{"item":{"childSessionId":"40841c92-f7f0-49d0-be79-e9f8b49840ae","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"88f27e2d-73f0-4cef-8df9-136407dfccbc","kind":"reminderChild","recordedAt":"2026-09-29T20:29:35.687891Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0eedb-986c-7af3-85f1-1969b4bf35e8","turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f"},"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"88f27e2d-73f0-4cef-8df9-136407dfccbc","sequence":300},"last":{"id":"aec8adeb-28ee-4d80-a48a-63d15b1bb509","sequence":331},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:54"}},{"method":"turn/completed","params":{"durationMs":11752,"sessionId":"01a0eed3-932b-73e3-af13-d270ac13c13e","sourceRange":{"first":{"id":"0a61a65a-910b-4a3e-8f89-fa7b709a1fef","sequence":333},"last":{"id":"0a61a65a-910b-4a3e-8f89-fa7b709a1fef","sequence":333},"stream":{"id":"01a0eed3-932b-73e3-af13-d270ac13c13e","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":8175,"turnId":"01a0eedb-985c-7976-95be-bd698ad7c26f","viewCursor":"v:01a0eed3-932b-73e3-af13-d270ac13c13e:55"}}],"nextCursor":null}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-project-skill.ndjson b/plugins/muse-provider/test/fixtures/phase3-project-skill.ndjson new file mode 100644 index 0000000000..5030cf7712 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-project-skill.ndjson @@ -0,0 +1,34 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase3/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0eed7-ce1c-7a41-a57e-8b7af8ece3f2","workspaceRoot":"/tmp/muse-phase3/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515636,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:25:15.558112Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-ce23-75e2-b14d-7e7261cde078/session.jsonl","providerId":"meta","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:25:15.558116Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:25:15.558112Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-ce23-75e2-b14d-7e7261cde078/session.jsonl","providerId":"meta","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:25:15.558116Z","workspaceRoot":"/tmp/muse-phase3/repo"},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515643,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0eed7-ce1c-7a41-a57e-8b7af8ece3f2","mode":"onRequest","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","source":"approvalReconfigure","sourceRange":{"first":{"id":"c5190deb-8c15-4324-8cab-bcc21767d0f2","sequence":5},"last":{"id":"c5190deb-8c15-4324-8cab-bcc21767d0f2","sequence":5},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"skill/list","params":{"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"skills":[{"description":"Muse parity project skill","displayName":"muse-parity-project","selector":"muse-parity-project","source":"project"},{"description":"Muse parity user skill","displayName":"muse-parity-user","selector":"muse-parity-user","source":"user"}]}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"turn/start","params":{"commandId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","input":[{"type":"skill","selector":"muse-parity-project","arguments":"QA"}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515652,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"8e8dbc61-209b-4238-a059-0e84b658d2ce","sequence":14},"last":{"id":"8e8dbc61-209b-4238-a059-0e84b658d2ce","sequence":14},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:2","workspaceRoot":"/tmp/muse-phase3/repo"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515660,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"running","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515661,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"15fad29e-01e3-44eb-8c62-d1c6f42a15fd","sequence":15},"last":{"id":"15fad29e-01e3-44eb-8c62-d1c6f42a15fd","sequence":15},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515661,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","itemId":"e682051f-db33-497f-b64a-984279221acc","kind":"userMessage","recordedAt":"2026-09-29T20:25:15.653086Z","revision":1,"status":"completed","text":"/muse-parity-project QA","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"},"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"15fad29e-01e3-44eb-8c62-d1c6f42a15fd","sequence":15},"last":{"id":"15fad29e-01e3-44eb-8c62-d1c6f42a15fd","sequence":15},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515661,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"048a0237-11cc-4e2e-910e-a15d8a4c0b8a","fallbackText":"Reminder child session","generationId":1,"itemId":"a05c1a91-8de9-4107-af6a-11b60b9e51d5","kind":"reminderChild","recordedAt":"2026-09-29T20:25:15.661569Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eed7-ce8c-7d13-a2d7-bdaeba350f66","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"},"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"a05c1a91-8de9-4107-af6a-11b60b9e51d5","sequence":34},"last":{"id":"a05c1a91-8de9-4107-af6a-11b60b9e51d5","sequence":34},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515666,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","createdAt":"2026-09-29T20:25:15.558112Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-ce23-75e2-b14d-7e7261cde078/session.jsonl","providerId":"meta","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"running","turnCount":0,"updatedAt":"2026-09-29T20:25:15.66081Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790713517353,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"6e5ecd1e-53fe-4a9b-be7b-ceeaa7aca348","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"},"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:5.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790713517353,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"MUSE_PARITY","field":"text","itemId":"6e5ecd1e-53fe-4a9b-be7b-ceeaa7aca348","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:5.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790713517597,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"_PROJECT_OK","field":"text","itemId":"6e5ecd1e-53fe-4a9b-be7b-ceeaa7aca348","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:5.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790713517642,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"6e5ecd1e-53fe-4a9b-be7b-ceeaa7aca348","kind":"agentMessage","recordedAt":"2026-09-29T20:25:17.642147Z","revision":2,"status":"completed","text":"MUSE_PARITY_PROJECT_OK","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"},"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"da4ee9f0-e30b-4312-97e1-7ad4bf3e0ba6","sequence":47},"last":{"id":"da4ee9f0-e30b-4312-97e1-7ad4bf3e0ba6","sequence":47},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790713517646,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":30,"promptTokens":38319,"totalTokens":38349},"durationMs":1980,"modelId":"meta/muse-spark-1.3","promptTokens":38319,"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"65b08952-8f7e-4f00-b9dd-7e549d0a711e","sequence":50},"last":{"id":"65b08952-8f7e-4f00-b9dd-7e549d0a711e","sequence":50},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"totalTokens":38349,"turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38319,"outputTokens":30,"reasoningTokens":14},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790713517648,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"6d2f855f-101e-4114-adf5-3672b6d749b9","childSessionLogPath":"subagent/6d2f855f-101e-4114-adf5-3672b6d749b9/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"c05b349f-2b67-4550-a142-0d408f3cf37f","kind":"reminderChild","recordedAt":"2026-09-29T20:25:17.648165Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eed7-d64e-7e33-8f45-142f02afde1d","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"},"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"c05b349f-2b67-4550-a142-0d408f3cf37f","sequence":57},"last":{"id":"c05b349f-2b67-4550-a142-0d408f3cf37f","sequence":57},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790713529181,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"048a0237-11cc-4e2e-910e-a15d8a4c0b8a","fallbackText":"Reminder child session","generationId":1,"itemId":"a05c1a91-8de9-4107-af6a-11b60b9e51d5","kind":"reminderChild","recordedAt":"2026-09-29T20:25:29.181248Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0eed7-ce8c-7d13-a2d7-bdaeba350f66","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"},"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"a05c1a91-8de9-4107-af6a-11b60b9e51d5","sequence":34},"last":{"id":"f1d3ebd8-0f87-43b9-aefa-c8cd4f39faa6","sequence":59},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790713529181,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"6d2f855f-101e-4114-adf5-3672b6d749b9","childSessionLogPath":"subagent/6d2f855f-101e-4114-adf5-3672b6d749b9/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"c05b349f-2b67-4550-a142-0d408f3cf37f","kind":"reminderChild","recordedAt":"2026-09-29T20:25:29.181659Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eed7-d64e-7e33-8f45-142f02afde1d","turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83"},"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"c05b349f-2b67-4550-a142-0d408f3cf37f","sequence":57},"last":{"id":"d879311c-d5a9-43a3-94a6-dff55ae38a7b","sequence":60},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790713529183,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"idle","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790713529184,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":13530,"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"4a0e2be3-61af-4a7e-a49a-3da3bd98791e","sequence":66},"last":{"id":"4a0e2be3-61af-4a7e-a49a-3da3bd98791e","sequence":66},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":1700,"turnId":"01a0eed7-ce81-7503-ab0a-30ce06f2ea83","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:11"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":5,"method":"usage/read","params":{}}} +{"dir":"in","msg":{"id":5,"jsonrpc":"2.0","result":{}}} +{"dir":"in","msg":{"emittedAtMs":1790713529184,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","sourceRange":{"first":{"id":"08e62d29-771c-4cf4-b186-34fb91ec6810","sequence":67},"last":{"id":"08e62d29-771c-4cf4-b186-34fb91ec6810","sequence":67},"stream":{"id":"01a0eed7-ce23-75e2-b14d-7e7261cde078","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:12","workspaceRoot":"/tmp/muse-phase3/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790713529184,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:25:15.555669Z","firstUserPrompt":"/muse-parity-project QA","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-ce23-75e2-b14d-7e7261cde078/session.jsonl","providerId":"meta","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"idle","title":"/muse-parity-project QA","turnCount":1,"updatedAt":"2026-09-29T20:25:29.183321Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790713529442,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790713529442,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"notLoaded","viewCursor":"v:01a0eed7-ce23-75e2-b14d-7e7261cde078:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790713529442,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:25:15.555669Z","firstUserPrompt":"/muse-parity-project QA","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-ce23-75e2-b14d-7e7261cde078/session.jsonl","providerId":"meta","sessionId":"01a0eed7-ce23-75e2-b14d-7e7261cde078","status":"notLoaded","title":"/muse-parity-project QA","turnCount":1,"updatedAt":"2026-09-29T20:25:29.184532Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/phase3-user-skill.ndjson b/plugins/muse-provider/test/fixtures/phase3-user-skill.ndjson new file mode 100644 index 0000000000..3deee1b6a4 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/phase3-user-skill.ndjson @@ -0,0 +1,32 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase3/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0eed7-6eae-71dd-aa98-bd57366a4d2a","workspaceRoot":"/tmp/muse-phase3/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491207,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:24:51.128331Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-6eb5-7490-b19e-7053a0a27c2d/session.jsonl","providerId":"meta","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:24:51.128335Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T20:24:51.128331Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-6eb5-7490-b19e-7053a0a27c2d/session.jsonl","providerId":"meta","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"idle","turnCount":0,"updatedAt":"2026-09-29T20:24:51.128335Z","workspaceRoot":"/tmp/muse-phase3/repo"},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491215,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0eed7-6eae-71dd-aa98-bd57366a4d2a","mode":"onRequest","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","source":"approvalReconfigure","sourceRange":{"first":{"id":"903ccb69-7421-43e4-bb85-b661fc9ef2a5","sequence":5},"last":{"id":"903ccb69-7421-43e4-bb85-b661fc9ef2a5","sequence":5},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"skill/list","params":{"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"skills":[{"description":"Muse parity user skill","displayName":"muse-parity-user","selector":"muse-parity-user","source":"user"}]}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"turn/start","params":{"commandId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","input":[{"type":"skill","selector":"muse-parity-user","arguments":"QA"}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491224,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"54e74beb-b4e8-40d0-bb11-52abd1345cf1","sequence":13},"last":{"id":"54e74beb-b4e8-40d0-bb11-52abd1345cf1","sequence":13},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"vcs":"git","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:2","workspaceRoot":"/tmp/muse-phase3/repo"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491232,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"running","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491233,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"ab071d7e-7b44-401a-b8ec-32f213c94289","sequence":14},"last":{"id":"ab071d7e-7b44-401a-b8ec-32f213c94289","sequence":14},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491233,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","itemId":"2efada29-ee84-4446-b6af-2bbbb76c6424","kind":"userMessage","recordedAt":"2026-09-29T20:24:51.22541Z","revision":1,"status":"completed","text":"/muse-parity-user QA","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"},"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"ab071d7e-7b44-401a-b8ec-32f213c94289","sequence":14},"last":{"id":"ab071d7e-7b44-401a-b8ec-32f213c94289","sequence":14},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491233,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"c775da07-e090-47c0-9f14-212a29534484","fallbackText":"Reminder child session","generationId":1,"itemId":"ec3c57ce-caae-4973-965d-93161ff55b81","kind":"reminderChild","recordedAt":"2026-09-29T20:24:51.233206Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0eed7-6f1f-7fc0-b779-a0458b794384","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"},"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"ec3c57ce-caae-4973-965d-93161ff55b81","sequence":32},"last":{"id":"ec3c57ce-caae-4973-965d-93161ff55b81","sequence":32},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790713491238,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","createdAt":"2026-09-29T20:24:51.128331Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-6eb5-7490-b19e-7053a0a27c2d/session.jsonl","providerId":"meta","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"running","turnCount":0,"updatedAt":"2026-09-29T20:24:51.232727Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790713494252,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"c5507091-bdd1-4701-be9d-1f0ab4b75b3e","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"},"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:5.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790713494252,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"MUSE_PARITY_USER_OK","field":"text","itemId":"c5507091-bdd1-4701-be9d-1f0ab4b75b3e","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:5.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790713494323,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"c5507091-bdd1-4701-be9d-1f0ab4b75b3e","kind":"agentMessage","recordedAt":"2026-09-29T20:24:54.322754Z","revision":2,"status":"completed","text":"MUSE_PARITY_USER_OK","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"},"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"98e5bb9a-cc37-4e94-8bc5-90ebd1bad851","sequence":45},"last":{"id":"98e5bb9a-cc37-4e94-8bc5-90ebd1bad851","sequence":45},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790713494328,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":32,"promptTokens":36717,"totalTokens":36749},"durationMs":3091,"modelId":"meta/muse-spark-1.3","promptTokens":36717,"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"475129b6-1e12-4d19-b3b8-7d8cf5ef1f71","sequence":48},"last":{"id":"475129b6-1e12-4d19-b3b8-7d8cf5ef1f71","sequence":48},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"totalTokens":36749,"turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":36717,"outputTokens":32,"reasoningTokens":16},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790713494330,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"230378ce-377b-4d2c-8020-10cf2449b75b","fallbackText":"Reminder child session","generationId":1,"itemId":"35da6de8-83a9-4e23-a1f9-f05c5f78103c","kind":"reminderChild","recordedAt":"2026-09-29T20:24:54.330297Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0eed7-7b38-71e0-b90b-3ebc7af2ad1f","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"},"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"35da6de8-83a9-4e23-a1f9-f05c5f78103c","sequence":55},"last":{"id":"35da6de8-83a9-4e23-a1f9-f05c5f78103c","sequence":55},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515146,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"c775da07-e090-47c0-9f14-212a29534484","fallbackText":"Reminder child session","generationId":1,"itemId":"ec3c57ce-caae-4973-965d-93161ff55b81","kind":"reminderChild","recordedAt":"2026-09-29T20:25:15.146156Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0eed7-6f1f-7fc0-b779-a0458b794384","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"},"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"ec3c57ce-caae-4973-965d-93161ff55b81","sequence":32},"last":{"id":"d5dc841a-1273-4a41-90b4-71fb1582f087","sequence":57},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515147,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"230378ce-377b-4d2c-8020-10cf2449b75b","fallbackText":"Reminder child session","generationId":1,"itemId":"35da6de8-83a9-4e23-a1f9-f05c5f78103c","kind":"reminderChild","recordedAt":"2026-09-29T20:25:15.146691Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0eed7-7b38-71e0-b90b-3ebc7af2ad1f","turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d"},"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"35da6de8-83a9-4e23-a1f9-f05c5f78103c","sequence":55},"last":{"id":"5fe97bca-2f1c-4a08-88fe-e5ff9c313bdc","sequence":58},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515148,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"idle","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515150,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":23923,"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","sourceRange":{"first":{"id":"e862f004-df27-443a-95c7-2984e9702037","sequence":64},"last":{"id":"e862f004-df27-443a-95c7-2984e9702037","sequence":64},"stream":{"id":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":3026,"turnId":"01a0eed7-6f16-7497-ab8e-8bd0733e2f6d","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515150,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:24:51.125765Z","firstUserPrompt":"/muse-parity-user QA","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-6eb5-7490-b19e-7053a0a27c2d/session.jsonl","providerId":"meta","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"idle","title":"/muse-parity-user QA","turnCount":1,"updatedAt":"2026-09-29T20:25:15.148441Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":5,"method":"usage/read","params":{}}} +{"dir":"in","msg":{"id":5,"jsonrpc":"2.0","result":{}}} +{"dir":"in","msg":{"emittedAtMs":1790713515404,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515404,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"notLoaded","viewCursor":"v:01a0eed7-6eb5-7490-b19e-7053a0a27c2d:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790713515404,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T20:24:51.125765Z","firstUserPrompt":"/muse-parity-user QA","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase3/data/muse/sessions/2026/09/29/01a0eed7-6eb5-7490-b19e-7053a0a27c2d/session.jsonl","providerId":"meta","sessionId":"01a0eed7-6eb5-7490-b19e-7053a0a27c2d","status":"notLoaded","title":"/muse-parity-user QA","turnCount":1,"updatedAt":"2026-09-29T20:25:15.148441Z","workspaceRoot":"/tmp/muse-phase3/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/resume-reasoning.ndjson b/plugins/muse-provider/test/fixtures/resume-reasoning.ndjson new file mode 100644 index 0000000000..548bf8ea2d --- /dev/null +++ b/plugins/muse-provider/test/fixtures/resume-reasoning.ndjson @@ -0,0 +1,27 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/resume","params":{"commandId":"01a0ee4c-4bb3-7e83-ad09-930d246e0d31","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c"}}} +{"dir":"in","msg":{"emittedAtMs":1790704372759,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"c262c112-2245-4975-a0d3-de21a8f19459","sequence":166},"last":{"id":"c262c112-2245-4975-a0d3-de21a8f19459","sequence":166},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:26","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":[{"commandId":"01a0ee46-ea2b-72e5-aada-1408802a3242","itemId":"bee9b543-239a-4c82-96c7-c482cf3c23ff","kind":"userMessage","recordedAt":"2026-09-29T17:47:00.014911Z","revision":1,"status":"completed","text":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},{"childSessionId":"dfb4300f-9488-4b4e-99a5-7b29d322952d","fallbackText":"Reminder child session","generationId":1,"itemId":"25799bf7-f24a-4eed-9953-f39079152e48","kind":"reminderChild","recordedAt":"2026-09-29T17:47:13.76483Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee46-ea35-7300-9f57-faffb63ca778","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},{"args":"{\"command\":\"sleep 12\",\"description\":\"Sleep for twelve seconds\",\"yield_time_ms\":15000}","background":true,"backgroundInitiator":"timeout","callId":"call_01a0ee46f61c7482b289e8bb6aee0f02","itemId":"01a0ee46-f8c9-7db3-ac02-f2b78cfc7c56","kind":"toolCall","recordedAt":"2026-09-29T17:47:15.961748Z","revision":3,"status":"completed","tool":"bash","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","visibleOutput":"{\n \"chunk_id\": \"exec-1-1\",\n \"command\": \"sleep 12\",\n \"description\": \"Sleep for twelve seconds\",\n \"execution_state\": \"background_running\",\n \"session_id\": 1,\n \"work_id\": \"work.v1.managed_bash.sha256.10c46069f6af08edd1e9a61d87aea3c93ab0bf6df4d8fe5d5ab2efe16c2aa63e\",\n \"model_guidance\": \"The command is still running in the background and the UI already shows its status. Do not poll for completion: the final output is delivered to you automatically as runtime context and wakes you even after you end the turn. Exception: when a runtime overdue notice names a still-running session, you may inspect it or terminate it with bash_input now. Do not narrate that it started, is running, shows current output, will continue, or has an internal session_id unless the user explicitly asks or you have substantive next work. If there is nothing else to do, end the turn without extra status text. Managed sessions end when your agent session ends: a deliverable process that must keep running after your final answer needs a detached `setsid -f` start instead (where setsid exists \u2014 Linux).\",\n \"output\": \"\",\n \"original_output_bytes\": 0,\n \"original_output_tokens\": 0,\n \"truncated\": false\n}"},{"commandId":"01a0ee46-fcb3-78ab-a15d-29882a94f6d1","itemId":"591cef15-1dd4-5a6d-ad43-d21def93699b","kind":"userMessage","recordedAt":"2026-09-29T17:47:13.762324Z","revision":1,"status":"completed","steered":true,"text":"Change the final reply to STEERED_PHASE0_OK and do not say ORIGINAL_DONE.","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},{"childSessionId":"4ba6a4a2-695b-4e19-b93f-399028c26c85","fallbackText":"Reminder child session","generationId":2,"itemId":"e2deeff1-ddc1-46c5-b053-fdc0c7a12ad2","kind":"reminderChild","recordedAt":"2026-09-29T17:47:40.516146Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee47-1fe5-72a0-84bd-4c9e9446ed0d","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},{"itemId":"f802477d-5ebb-4a3d-b573-1624f746f95d","kind":"reasoning","providerItemId":"rs_6abbf9a31753fbc1f4c04388:rs_01a0ee47259e73e49456486349db6e0e","recordedAt":"2026-09-29T17:47:40.272906Z","revision":2,"status":"completed","summary":["Evaluating conflicting instructions and stop-signal guidance while waiting for the background command to finish.Resolving instruction precedence while deferring the reply until the background command completes.Deferring the final reply while waiting for the background command to complete."],"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},{"args":"{}","callId":"call_01a0ee4786c270bdb312bdd0ddf75a64","itemId":"01a0ee47-885e-7440-9a65-b3f7d88924a2","kind":"toolCall","recordedAt":"2026-09-29T17:47:40.51315Z","revision":2,"status":"completed","tool":"work_list","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","visibleOutput":"{\"items\":[],\"next_after_work_id\":null}"},{"childSessionId":"c03ed820-1aea-441c-8b83-c56e0a21f749","fallbackText":"Reminder child session","generationId":3,"itemId":"6873949c-68f0-43f2-90d8-ffbe78d1d4e6","kind":"reminderChild","recordedAt":"2026-09-29T17:47:50.732258Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee47-8865-7b53-b394-8d0a49863634","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},{"itemId":"b7f0225d-5758-4365-987d-4931bba57bb2","kind":"agentMessage","recordedAt":"2026-09-29T17:47:45.116004Z","revision":2,"status":"completed","text":"STEERED_PHASE0_OK","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},{"childSessionId":"61d34ee6-0447-4424-b6f6-6606ed0465c2","childSessionLogPath":"subagent/61d34ee6-0447-4424-b6f6-6606ed0465c2/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"411ee9ec-dfbd-4d09-ab8d-1b25ee41a63d","kind":"reminderChild","recordedAt":"2026-09-29T17:47:50.732876Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee47-9a61-72d2-887f-7286aa2c2eb5","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"}],"mode":"inline","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"replay"},"branch":"main","createdAt":"2026-09-29T17:46:59.924858Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"lastActivityAt":"2026-09-29T17:47:50.73531Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"idle","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":1,"updatedAt":"2026-09-29T17:52:52.675916Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:26"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","input":[{"type":"text","text":"Reply exactly RESUMED_REASONING_OK. Do not use tools."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704372768,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"8d9c2ef7-22ea-4bf5-9135-c58fc18e9f2e","sequence":172},"last":{"id":"8d9c2ef7-22ea-4bf5-9135-c58fc18e9f2e","sequence":172},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:27","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"}}} +{"dir":"in","msg":{"emittedAtMs":1790704372776,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"running","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:28"}}} +{"dir":"in","msg":{"emittedAtMs":1790704372777,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"9daff9ed-dd93-4ce5-85a0-f1072bf5493a","sequence":174},"last":{"id":"9daff9ed-dd93-4ce5-85a0-f1072bf5493a","sequence":174},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:28"}}} +{"dir":"in","msg":{"emittedAtMs":1790704372777,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","itemId":"ee63b441-2b31-4c36-b32b-c171b72a70f8","kind":"userMessage","recordedAt":"2026-09-29T17:52:52.76929Z","revision":1,"status":"completed","text":"Reply exactly RESUMED_REASONING_OK. Do not use tools.","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"9daff9ed-dd93-4ce5-85a0-f1072bf5493a","sequence":174},"last":{"id":"9daff9ed-dd93-4ce5-85a0-f1072bf5493a","sequence":174},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:29"}}} +{"dir":"in","msg":{"emittedAtMs":1790704372777,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"f5a6a72e-b5f6-4ea6-9145-99fcf846a384","fallbackText":"Reminder child session","generationId":1,"itemId":"3c846322-d54d-4b29-adcf-297cae49bd3b","kind":"reminderChild","recordedAt":"2026-09-29T17:52:52.774658Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4c-4c26-7ec2-b0f7-97d33cd212d2","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"3c846322-d54d-4b29-adcf-297cae49bd3b","sequence":189},"last":{"id":"3c846322-d54d-4b29-adcf-297cae49bd3b","sequence":189},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:30"}}} +{"dir":"in","msg":{"emittedAtMs":1790704372777,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","branch":"main","createdAt":"2026-09-29T17:46:59.924858Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"running","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":1,"updatedAt":"2026-09-29T17:52:52.776079Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704375471,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"8f6cd252-a989-4ae1-ad3a-0a3bd6641c7d","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:30.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704375471,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"RESUMED_REASONING_OK","field":"text","itemId":"8f6cd252-a989-4ae1-ad3a-0a3bd6641c7d","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:30.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704375471,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"8f6cd252-a989-4ae1-ad3a-0a3bd6641c7d","kind":"agentMessage","recordedAt":"2026-09-29T17:52:55.471707Z","revision":2,"status":"completed","text":"RESUMED_REASONING_OK","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"6d43268c-d4ee-4d95-945c-eb14edbca40f","sequence":202},"last":{"id":"6d43268c-d4ee-4d95-945c-eb14edbca40f","sequence":202},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:31"}}} +{"dir":"in","msg":{"emittedAtMs":1790704375477,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":1826,"promptTokens":155365,"totalTokens":157191},"durationMs":2700,"modelId":"meta/muse-spark-1.3","promptTokens":38087,"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"e738e874-b4fa-41c7-97a0-78035ef44398","sequence":205},"last":{"id":"e738e874-b4fa-41c7-97a0-78035ef44398","sequence":205},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"totalTokens":38119,"turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38087,"outputTokens":32,"reasoningTokens":15},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:32"}}} +{"dir":"in","msg":{"emittedAtMs":1790704375477,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"80e453a6-e7d8-4f68-be48-f9247eb569c4","fallbackText":"Reminder child session","generationId":1,"itemId":"d94cbdd9-6923-4c0b-ab29-7204b1311944","kind":"reminderChild","recordedAt":"2026-09-29T17:52:55.477459Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4c-56b5-71e3-8670-cc1c134ef4c1","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"d94cbdd9-6923-4c0b-ab29-7204b1311944","sequence":212},"last":{"id":"d94cbdd9-6923-4c0b-ab29-7204b1311944","sequence":212},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:33"}}} +{"dir":"in","msg":{"emittedAtMs":1790704381132,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"f5a6a72e-b5f6-4ea6-9145-99fcf846a384","fallbackText":"Reminder child session","generationId":1,"itemId":"3c846322-d54d-4b29-adcf-297cae49bd3b","kind":"reminderChild","recordedAt":"2026-09-29T17:53:01.131905Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4c-4c26-7ec2-b0f7-97d33cd212d2","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"3c846322-d54d-4b29-adcf-297cae49bd3b","sequence":189},"last":{"id":"9119fc4f-bbad-4f4b-b598-e6dec79b58e4","sequence":214},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:34"}}} +{"dir":"in","msg":{"emittedAtMs":1790704381132,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"80e453a6-e7d8-4f68-be48-f9247eb569c4","fallbackText":"Reminder child session","generationId":1,"itemId":"d94cbdd9-6923-4c0b-ab29-7204b1311944","kind":"reminderChild","recordedAt":"2026-09-29T17:53:01.132067Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee4c-56b5-71e3-8670-cc1c134ef4c1","turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"d94cbdd9-6923-4c0b-ab29-7204b1311944","sequence":212},"last":{"id":"8c77fcc2-590b-4357-9362-06eb4d178210","sequence":215},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:35"}}} +{"dir":"in","msg":{"emittedAtMs":1790704381132,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"idle","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:36"}}} +{"dir":"in","msg":{"emittedAtMs":1790704381133,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":8363,"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"cbd0c517-6488-4cad-8943-00f10f14ad1e","sequence":221},"last":{"id":"cbd0c517-6488-4cad-8943-00f10f14ad1e","sequence":221},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":2702,"turnId":"01a0ee4c-4c1f-79fb-a26a-4f18cbcf2827","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:36"}}} +{"dir":"in","msg":{"emittedAtMs":1790704381134,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:46:59.924858Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"idle","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":2,"updatedAt":"2026-09-29T17:53:01.132363Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704381377,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:37"}}} +{"dir":"in","msg":{"emittedAtMs":1790704381377,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"notLoaded","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:37"}}} +{"dir":"in","msg":{"emittedAtMs":1790704381377,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:46:59.924858Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"notLoaded","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":2,"updatedAt":"2026-09-29T17:53:01.133883Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/resume-source.ndjson b/plugins/muse-provider/test/fixtures/resume-source.ndjson new file mode 100644 index 0000000000..8676d15e45 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/resume-source.ndjson @@ -0,0 +1,26 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee48-370c-77f6-a1d7-ea885b8777bf","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105319,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:48:25.238493Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:48:25.238497Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:48:25.238493Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:48:25.238497Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105325,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee48-370c-77f6-a1d7-ea885b8777bf","mode":"onRequest","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","source":"approvalReconfigure","sourceRange":{"first":{"id":"1114a956-7136-4272-8928-65125b088788","sequence":5},"last":{"id":"1114a956-7136-4272-8928-65125b088788","sequence":5},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","input":[{"type":"text","text":"Reply exactly RESUME_MARKER_OK without tools."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105327,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"186af8df-b20d-481a-bdf5-592206b9239f","sequence":15},"last":{"id":"186af8df-b20d-481a-bdf5-592206b9239f","sequence":15},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105335,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"running","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105336,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"3e854976-f69f-406b-8f8d-783610940ff2","sequence":17},"last":{"id":"3e854976-f69f-406b-8f8d-783610940ff2","sequence":17},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105336,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","itemId":"21b34e05-d5c5-492b-b166-b261039b69b1","kind":"userMessage","recordedAt":"2026-09-29T17:48:25.328624Z","revision":1,"status":"completed","text":"Reply exactly RESUME_MARKER_OK without tools.","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"3e854976-f69f-406b-8f8d-783610940ff2","sequence":17},"last":{"id":"3e854976-f69f-406b-8f8d-783610940ff2","sequence":17},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105336,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"76293abd-9c8a-4a09-8edf-377e9e17bf81","fallbackText":"Reminder child session","generationId":1,"itemId":"1275560b-0426-4de0-91c2-e76c1698e73b","kind":"reminderChild","recordedAt":"2026-09-29T17:48:25.335588Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-3776-7a82-b1bc-b843d01dbbf3","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"1275560b-0426-4de0-91c2-e76c1698e73b","sequence":35},"last":{"id":"1275560b-0426-4de0-91c2-e76c1698e73b","sequence":35},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704105340,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","createdAt":"2026-09-29T17:48:25.238493Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:48:25.335835Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704108467,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"141a95ec-0b8f-47fe-9e95-c3cfcc50b8a5","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:5.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704108467,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"RESUME_MARKER_OK","field":"text","itemId":"141a95ec-0b8f-47fe-9e95-c3cfcc50b8a5","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:5.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704108508,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"141a95ec-0b8f-47fe-9e95-c3cfcc50b8a5","kind":"agentMessage","recordedAt":"2026-09-29T17:48:28.508252Z","revision":2,"status":"completed","text":"RESUME_MARKER_OK","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"4dd2a6ba-ca4e-43f0-a652-abe5fa688f28","sequence":48},"last":{"id":"4dd2a6ba-ca4e-43f0-a652-abe5fa688f28","sequence":48},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704108518,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":27,"promptTokens":38130,"totalTokens":38157},"durationMs":3178,"modelId":"meta/muse-spark-1.3","promptTokens":38130,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"95501ca7-8eb6-4e73-9b15-33a440a26899","sequence":51},"last":{"id":"95501ca7-8eb6-4e73-9b15-33a440a26899","sequence":51},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"totalTokens":38157,"turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","usage":{"cacheReadTokens":8433,"cacheWriteTokens":0,"cachedTokens":8433,"inputTokens":38130,"outputTokens":27,"reasoningTokens":12},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704108520,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"e9f3e28f-f760-4a06-8127-543e89e5ca72","childSessionLogPath":"subagent/e9f3e28f-f760-4a06-8127-543e89e5ca72/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"bebe2029-2f83-4cbb-9ac5-6da291835a0c","kind":"reminderChild","recordedAt":"2026-09-29T17:48:28.520288Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-43e7-7921-8a10-bbfc1f118cdc","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"bebe2029-2f83-4cbb-9ac5-6da291835a0c","sequence":58},"last":{"id":"bebe2029-2f83-4cbb-9ac5-6da291835a0c","sequence":58},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704110815,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"e9f3e28f-f760-4a06-8127-543e89e5ca72","childSessionLogPath":"subagent/e9f3e28f-f760-4a06-8127-543e89e5ca72/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"bebe2029-2f83-4cbb-9ac5-6da291835a0c","kind":"reminderChild","recordedAt":"2026-09-29T17:48:30.814728Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee48-43e7-7921-8a10-bbfc1f118cdc","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"bebe2029-2f83-4cbb-9ac5-6da291835a0c","sequence":58},"last":{"id":"89cebb28-940c-4f03-975b-08a31fb6130b","sequence":60},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704110818,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"76293abd-9c8a-4a09-8edf-377e9e17bf81","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"1275560b-0426-4de0-91c2-e76c1698e73b","kind":"reminderChild","recordedAt":"2026-09-29T17:48:30.818129Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0ee48-3776-7a82-b1bc-b843d01dbbf3","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"1275560b-0426-4de0-91c2-e76c1698e73b","sequence":35},"last":{"id":"d87d7ad7-417f-4517-bcd2-c9df575e485d","sequence":64},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704110818,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704110819,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":5489,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"a16b76fe-60d7-4208-9c2c-d74d1f03e264","sequence":66},"last":{"id":"a16b76fe-60d7-4208-9c2c-d74d1f03e264","sequence":66},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":3139,"turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704110819,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"d1b814a6-7e5a-4dab-8018-97c1116890e6","sequence":67},"last":{"id":"d1b814a6-7e5a-4dab-8018-97c1116890e6","sequence":67},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:12","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704110819,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":1,"updatedAt":"2026-09-29T17:48:30.819204Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/resume-with-cursor.ndjson b/plugins/muse-provider/test/fixtures/resume-with-cursor.ndjson new file mode 100644 index 0000000000..a11c4d0aba --- /dev/null +++ b/plugins/muse-provider/test/fixtures/resume-with-cursor.ndjson @@ -0,0 +1,40 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/resume","params":{"commandId":"01a0ee48-763e-7f15-afc7-4727ca9099e9","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","cursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"64388c89-c4e0-409e-8a86-3cdecafea128","sequence":69},"last":{"id":"64388c89-c4e0-409e-8a86-3cdecafea128","sequence":69},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:13","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"8d5ce3e0-18d8-4a82-9374-08d6d6ca7b8f","sequence":75},"last":{"id":"8d5ce3e0-18d8-4a82-9374-08d6d6ca7b8f","sequence":75},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:14","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"last":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","itemId":"a54df7ca-e35f-42f5-884f-2ced92241bc2","kind":"userMessage","recordedAt":"2026-09-29T17:48:31.26526Z","revision":1,"status":"completed","text":"What marker did you just reply? Reply only that marker, without tools.","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"last":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"ba7d5afb-1ee2-445f-a7bc-acdaa35e2149","fallbackText":"Reminder child session","generationId":1,"itemId":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","kind":"reminderChild","recordedAt":"2026-09-29T17:48:31.269224Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-4ea4-7fb0-8d4e-b9f2584e3354","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","sequence":92},"last":{"id":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","sequence":92},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"d8ae849a-116e-4574-8f0b-54d5679e2f49","kind":"agentMessage","recordedAt":"2026-09-29T17:48:34.030457Z","revision":2,"status":"completed","text":"RESUME_MARKER_OK","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"9e2ea853-13bd-487e-ae14-9d525846a585","sequence":105},"last":{"id":"9e2ea853-13bd-487e-ae14-9d525846a585","sequence":105},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":80,"promptTokens":73806,"totalTokens":73886},"durationMs":2763,"modelId":"meta/muse-spark-1.3","promptTokens":35676,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"083d7c06-b769-4c3d-8dbe-4b024476e0ef","sequence":108},"last":{"id":"083d7c06-b769-4c3d-8dbe-4b024476e0ef","sequence":108},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"totalTokens":35729,"turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","usage":{"cacheReadTokens":18033,"cacheWriteTokens":0,"cachedTokens":18033,"inputTokens":35676,"outputTokens":53,"reasoningTokens":38},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"3944baa3-651a-4816-9825-fcb67f059596","fallbackText":"Reminder child session","generationId":1,"itemId":"2651312c-6d68-406c-8fc7-18b2dc964083","kind":"reminderChild","recordedAt":"2026-09-29T17:48:34.034676Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-5972-77e2-8d85-c6afaf347ed8","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"2651312c-6d68-406c-8fc7-18b2dc964083","sequence":115},"last":{"id":"2651312c-6d68-406c-8fc7-18b2dc964083","sequence":115},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"ba7d5afb-1ee2-445f-a7bc-acdaa35e2149","fallbackText":"Reminder child session","generationId":1,"itemId":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","kind":"reminderChild","recordedAt":"2026-09-29T17:48:41.074443Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee48-4ea4-7fb0-8d4e-b9f2584e3354","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","sequence":92},"last":{"id":"cf508ab3-de8d-44ba-a0e6-84b54d031627","sequence":117},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"3944baa3-651a-4816-9825-fcb67f059596","fallbackText":"Reminder child session","generationId":1,"itemId":"2651312c-6d68-406c-8fc7-18b2dc964083","kind":"reminderChild","recordedAt":"2026-09-29T17:48:41.074657Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee48-5972-77e2-8d85-c6afaf347ed8","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"2651312c-6d68-406c-8fc7-18b2dc964083","sequence":115},"last":{"id":"bf9401ff-ae66-47cb-a7e4-0305000df728","sequence":118},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":9809,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"08714520-df9a-42d2-8919-baf78f39b8aa","sequence":124},"last":{"id":"08714520-df9a-42d2-8919-baf78f39b8aa","sequence":124},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":2697,"turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"dd04e5a6-68ca-457b-9ef1-c169cfbb84f5","sequence":125},"last":{"id":"dd04e5a6-68ca-457b-9ef1-c169cfbb84f5","sequence":125},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:24","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121503,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"cfa5b0f8-0cd4-4849-9496-58a47d39e026","sequence":128},"last":{"id":"cfa5b0f8-0cd4-4849-9496-58a47d39e026","sequence":128},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:25","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":null,"mode":"none","noneReason":"cursorSuffix","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"replay"},"branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"lastActivityAt":"2026-09-29T17:48:41.075126Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":2,"updatedAt":"2026-09-29T17:48:41.422766Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:25"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121509,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"cfa5b0f8-0cd4-4849-9496-58a47d39e026","sequence":128},"last":{"id":"cfa5b0f8-0cd4-4849-9496-58a47d39e026","sequence":128},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:25","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","input":[{"type":"text","text":"What marker did you just reply? Reply only that marker, without tools."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121510,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"2ee1047a-6a1f-4b43-898b-6e5834143d11","sequence":134},"last":{"id":"2ee1047a-6a1f-4b43-898b-6e5834143d11","sequence":134},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:26","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121518,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"running","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:27"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121519,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"0dc78b21-3a29-43ff-ad87-74d725e5253b","sequence":136},"last":{"id":"0dc78b21-3a29-43ff-ad87-74d725e5253b","sequence":136},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:27"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121519,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","itemId":"64f515a8-60db-47a1-b9f8-84cc1e226145","kind":"userMessage","recordedAt":"2026-09-29T17:48:41.511669Z","revision":1,"status":"completed","text":"What marker did you just reply? Reply only that marker, without tools.","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"0dc78b21-3a29-43ff-ad87-74d725e5253b","sequence":136},"last":{"id":"0dc78b21-3a29-43ff-ad87-74d725e5253b","sequence":136},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:28"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121519,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"461905f8-cc17-4cbe-a1c1-050cf0836e6b","fallbackText":"Reminder child session","generationId":1,"itemId":"29bb3839-3044-488c-8553-9f9e4b238249","kind":"reminderChild","recordedAt":"2026-09-29T17:48:41.514846Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-76aa-76b0-b00a-1e778326da40","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"29bb3839-3044-488c-8553-9f9e4b238249","sequence":151},"last":{"id":"29bb3839-3044-488c-8553-9f9e4b238249","sequence":151},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:29"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121519,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"running","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":2,"updatedAt":"2026-09-29T17:48:41.516193Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704125163,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"0db738b7-658c-476c-8835-c84c6ddecd54","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:29.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704125163,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"RESUME_MARKER_OK","field":"text","itemId":"0db738b7-658c-476c-8835-c84c6ddecd54","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:29.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704125256,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"0db738b7-658c-476c-8835-c84c6ddecd54","kind":"agentMessage","recordedAt":"2026-09-29T17:48:45.256357Z","revision":2,"status":"completed","text":"RESUME_MARKER_OK","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"d973348a-bea5-4a57-8214-ec2bba989f5d","sequence":164},"last":{"id":"d973348a-bea5-4a57-8214-ec2bba989f5d","sequence":164},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:30"}}} +{"dir":"in","msg":{"emittedAtMs":1790704125260,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":123,"promptTokens":109558,"totalTokens":109681},"durationMs":3744,"modelId":"meta/muse-spark-1.3","promptTokens":35752,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"2fcc5b33-1c74-455c-a4cf-c45c83514ce2","sequence":167},"last":{"id":"2fcc5b33-1c74-455c-a4cf-c45c83514ce2","sequence":167},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"totalTokens":35795,"turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","usage":{"cacheReadTokens":35185,"cacheWriteTokens":0,"cachedTokens":35185,"inputTokens":35752,"outputTokens":43,"reasoningTokens":28},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:31"}}} +{"dir":"in","msg":{"emittedAtMs":1790704125260,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"cd242dac-6012-404d-b95a-4de310c201f7","fallbackText":"Reminder child session","generationId":1,"itemId":"8a3e4e65-1300-41a0-8b12-e22be2b81b83","kind":"reminderChild","recordedAt":"2026-09-29T17:48:45.260754Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-854c-7311-8e8d-e215dad84b7a","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"8a3e4e65-1300-41a0-8b12-e22be2b81b83","sequence":174},"last":{"id":"8a3e4e65-1300-41a0-8b12-e22be2b81b83","sequence":174},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:32"}}} +{"dir":"in","msg":{"emittedAtMs":1790704128411,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"cd242dac-6012-404d-b95a-4de310c201f7","fallbackText":"Reminder child session","generationId":1,"itemId":"8a3e4e65-1300-41a0-8b12-e22be2b81b83","kind":"reminderChild","recordedAt":"2026-09-29T17:48:48.411846Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee48-854c-7311-8e8d-e215dad84b7a","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"8a3e4e65-1300-41a0-8b12-e22be2b81b83","sequence":174},"last":{"id":"f97a5fcb-0c3c-475f-99b0-e2f024fb5bc1","sequence":176},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:33"}}} +{"dir":"in","msg":{"emittedAtMs":1790704128414,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"461905f8-cc17-4cbe-a1c1-050cf0836e6b","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"29bb3839-3044-488c-8553-9f9e4b238249","kind":"reminderChild","recordedAt":"2026-09-29T17:48:48.41459Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0ee48-76aa-76b0-b00a-1e778326da40","turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"29bb3839-3044-488c-8553-9f9e4b238249","sequence":151},"last":{"id":"d5d80db2-a75e-42f6-9e02-af7eee6c0b03","sequence":180},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:34"}}} +{"dir":"in","msg":{"emittedAtMs":1790704128414,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:35"}}} +{"dir":"in","msg":{"emittedAtMs":1790704128415,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":6903,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"c9ab8973-00a7-4cdc-9779-bde0590469b0","sequence":182},"last":{"id":"c9ab8973-00a7-4cdc-9779-bde0590469b0","sequence":182},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":3651,"turnId":"01a0ee48-76a5-7393-a8c3-e14e089b52f0","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:35"}}} +{"dir":"in","msg":{"emittedAtMs":1790704128416,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":3,"updatedAt":"2026-09-29T17:48:48.414748Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704128629,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:36"}}} +{"dir":"in","msg":{"emittedAtMs":1790704128629,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"notLoaded","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:36"}}} +{"dir":"in","msg":{"emittedAtMs":1790704128629,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"notLoaded","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":3,"updatedAt":"2026-09-29T17:48:48.41637Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/resume-without-cursor.ndjson b/plugins/muse-provider/test/fixtures/resume-without-cursor.ndjson new file mode 100644 index 0000000000..3a1c0184db --- /dev/null +++ b/plugins/muse-provider/test/fixtures/resume-without-cursor.ndjson @@ -0,0 +1,28 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/resume","params":{"commandId":"01a0ee48-4e3d-7dab-ac35-df9392bc6f4d","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111255,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"64388c89-c4e0-409e-8a86-3cdecafea128","sequence":69},"last":{"id":"64388c89-c4e0-409e-8a86-3cdecafea128","sequence":69},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:13","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"history":{"items":[{"commandId":"01a0ee48-376d-7cff-a66c-5e1ac7035295","itemId":"21b34e05-d5c5-492b-b166-b261039b69b1","kind":"userMessage","recordedAt":"2026-09-29T17:48:25.328624Z","revision":1,"status":"completed","text":"Reply exactly RESUME_MARKER_OK without tools.","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},{"childSessionId":"76293abd-9c8a-4a09-8edf-377e9e17bf81","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"1275560b-0426-4de0-91c2-e76c1698e73b","kind":"reminderChild","recordedAt":"2026-09-29T17:48:30.818129Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0ee48-3776-7a82-b1bc-b843d01dbbf3","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},{"itemId":"141a95ec-0b8f-47fe-9e95-c3cfcc50b8a5","kind":"agentMessage","recordedAt":"2026-09-29T17:48:28.508252Z","revision":2,"status":"completed","text":"RESUME_MARKER_OK","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"},{"childSessionId":"e9f3e28f-f760-4a06-8127-543e89e5ca72","childSessionLogPath":"subagent/e9f3e28f-f760-4a06-8127-543e89e5ca72/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"bebe2029-2f83-4cbb-9ac5-6da291835a0c","kind":"reminderChild","recordedAt":"2026-09-29T17:48:30.814728Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee48-43e7-7921-8a10-bbfc1f118cdc","turnId":"01a0ee48-376d-7cff-a66c-5e1ac7035295"}],"mode":"inline","snapshot":null},"pendingRequests":[],"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"replay"},"branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"lastActivityAt":"2026-09-29T17:48:30.818304Z","modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":1,"updatedAt":"2026-09-29T17:48:31.178029Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:13"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","input":[{"type":"text","text":"What marker did you just reply? Reply only that marker, without tools."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111264,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"8d5ce3e0-18d8-4a82-9374-08d6d6ca7b8f","sequence":75},"last":{"id":"8d5ce3e0-18d8-4a82-9374-08d6d6ca7b8f","sequence":75},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:14","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111274,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"running","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111275,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"last":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111275,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","itemId":"a54df7ca-e35f-42f5-884f-2ced92241bc2","kind":"userMessage","recordedAt":"2026-09-29T17:48:31.26526Z","revision":1,"status":"completed","text":"What marker did you just reply? Reply only that marker, without tools.","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"last":{"id":"263cb24d-ea39-436e-a27d-933e5c8c63b9","sequence":77},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111275,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"ba7d5afb-1ee2-445f-a7bc-acdaa35e2149","fallbackText":"Reminder child session","generationId":1,"itemId":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","kind":"reminderChild","recordedAt":"2026-09-29T17:48:31.269224Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-4ea4-7fb0-8d4e-b9f2584e3354","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","sequence":92},"last":{"id":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","sequence":92},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704111275,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"running","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":1,"updatedAt":"2026-09-29T17:48:31.270933Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704113963,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"d8ae849a-116e-4574-8f0b-54d5679e2f49","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:17.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704113963,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"RESUME_MARKER_OK","field":"text","itemId":"d8ae849a-116e-4574-8f0b-54d5679e2f49","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:17.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704114030,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"d8ae849a-116e-4574-8f0b-54d5679e2f49","kind":"agentMessage","recordedAt":"2026-09-29T17:48:34.030457Z","revision":2,"status":"completed","text":"RESUME_MARKER_OK","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"9e2ea853-13bd-487e-ae14-9d525846a585","sequence":105},"last":{"id":"9e2ea853-13bd-487e-ae14-9d525846a585","sequence":105},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704114034,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":80,"promptTokens":73806,"totalTokens":73886},"durationMs":2763,"modelId":"meta/muse-spark-1.3","promptTokens":35676,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"083d7c06-b769-4c3d-8dbe-4b024476e0ef","sequence":108},"last":{"id":"083d7c06-b769-4c3d-8dbe-4b024476e0ef","sequence":108},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"totalTokens":35729,"turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","usage":{"cacheReadTokens":18033,"cacheWriteTokens":0,"cachedTokens":18033,"inputTokens":35676,"outputTokens":53,"reasoningTokens":38},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704114034,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"3944baa3-651a-4816-9825-fcb67f059596","fallbackText":"Reminder child session","generationId":1,"itemId":"2651312c-6d68-406c-8fc7-18b2dc964083","kind":"reminderChild","recordedAt":"2026-09-29T17:48:34.034676Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee48-5972-77e2-8d85-c6afaf347ed8","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"2651312c-6d68-406c-8fc7-18b2dc964083","sequence":115},"last":{"id":"2651312c-6d68-406c-8fc7-18b2dc964083","sequence":115},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121074,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"ba7d5afb-1ee2-445f-a7bc-acdaa35e2149","fallbackText":"Reminder child session","generationId":1,"itemId":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","kind":"reminderChild","recordedAt":"2026-09-29T17:48:41.074443Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee48-4ea4-7fb0-8d4e-b9f2584e3354","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"a16c82ca-103a-48ee-97e5-04bf9f49da6b","sequence":92},"last":{"id":"cf508ab3-de8d-44ba-a0e6-84b54d031627","sequence":117},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121074,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"3944baa3-651a-4816-9825-fcb67f059596","fallbackText":"Reminder child session","generationId":1,"itemId":"2651312c-6d68-406c-8fc7-18b2dc964083","kind":"reminderChild","recordedAt":"2026-09-29T17:48:41.074657Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee48-5972-77e2-8d85-c6afaf347ed8","turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d"},"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"2651312c-6d68-406c-8fc7-18b2dc964083","sequence":115},"last":{"id":"bf9401ff-ae66-47cb-a7e4-0305000df728","sequence":118},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121075,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121076,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":9809,"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"08714520-df9a-42d2-8919-baf78f39b8aa","sequence":124},"last":{"id":"08714520-df9a-42d2-8919-baf78f39b8aa","sequence":124},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":2697,"turnId":"01a0ee48-4e9f-7119-afdc-f5793f43307d","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121076,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","sourceRange":{"first":{"id":"dd04e5a6-68ca-457b-9ef1-c169cfbb84f5","sequence":125},"last":{"id":"dd04e5a6-68ca-457b-9ef1-c169cfbb84f5","sequence":125},"stream":{"id":"01a0ee48-3713-70a0-bab7-ab463b7bc580","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:24","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121076,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"idle","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":2,"updatedAt":"2026-09-29T17:48:41.076013Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704121279,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:24"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121279,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"notLoaded","viewCursor":"v:01a0ee48-3713-70a0-bab7-ab463b7bc580:24"}}} +{"dir":"in","msg":{"emittedAtMs":1790704121279,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:48:25.236035Z","firstUserPrompt":"Reply exactly RESUME_MARKER_OK without tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee48-3713-70a0-bab7-ab463b7bc580/session.jsonl","providerId":"meta","sessionId":"01a0ee48-3713-70a0-bab7-ab463b7bc580","status":"notLoaded","title":"Reply exactly RESUME_MARKER_OK without tools.","turnCount":2,"updatedAt":"2026-09-29T17:48:41.076013Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/skill.ndjson b/plugins/muse-provider/test/fixtures/skill.ndjson new file mode 100644 index 0000000000..147579d231 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/skill.ndjson @@ -0,0 +1,31 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee45-d4b5-7b36-adce-a396e7f9286f","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949070,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:45:48.992273Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-d4bd-77d2-98a0-79c6a1333e80/session.jsonl","providerId":"meta","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:45:48.992277Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:45:48.992273Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-d4bd-77d2-98a0-79c6a1333e80/session.jsonl","providerId":"meta","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:45:48.992277Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949078,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee45-d4b5-7b36-adce-a396e7f9286f","mode":"onRequest","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","source":"approvalReconfigure","sourceRange":{"first":{"id":"7ac702ca-483a-4aed-821f-2262a0f48943","sequence":5},"last":{"id":"7ac702ca-483a-4aed-821f-2262a0f48943","sequence":5},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"skill/list","params":{"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"skills":[{"description":"Reply with the Phase 0 skill marker.","displayName":"phase0","selector":"phase0","source":"project"}]}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"turn/start","params":{"commandId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","input":[{"type":"skill","selector":"phase0"}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949087,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"5ec98360-5a49-4413-bbdc-e423513d09ec","sequence":14},"last":{"id":"5ec98360-5a49-4413-bbdc-e423513d09ec","sequence":14},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949095,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"running","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949096,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"f8fbf545-2d43-4311-bf8c-dc367f670464","sequence":15},"last":{"id":"f8fbf545-2d43-4311-bf8c-dc367f670464","sequence":15},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949096,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","itemId":"5dbcaf15-bef5-49bf-8569-5242008ac198","kind":"userMessage","recordedAt":"2026-09-29T17:45:49.087991Z","revision":1,"status":"completed","text":"/phase0","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"},"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"f8fbf545-2d43-4311-bf8c-dc367f670464","sequence":15},"last":{"id":"f8fbf545-2d43-4311-bf8c-dc367f670464","sequence":15},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949096,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"24712ab9-77e4-450a-98b1-cfb455e64a99","fallbackText":"Reminder child session","generationId":1,"itemId":"3e9a8a07-f7ed-400f-aecd-45413565ff84","kind":"reminderChild","recordedAt":"2026-09-29T17:45:49.096505Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee45-d527-7133-8954-a78cbe078b40","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"},"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"3e9a8a07-f7ed-400f-aecd-45413565ff84","sequence":34},"last":{"id":"3e9a8a07-f7ed-400f-aecd-45413565ff84","sequence":34},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790703949101,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","createdAt":"2026-09-29T17:45:48.992273Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-d4bd-77d2-98a0-79c6a1333e80/session.jsonl","providerId":"meta","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:45:49.096262Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703952151,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"59a7cac6-9558-4ff9-a029-6871aa0f250f","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"},"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:5.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703952151,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"SKILL_PHASE0","field":"text","itemId":"59a7cac6-9558-4ff9-a029-6871aa0f250f","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:5.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790703952151,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"_OK","field":"text","itemId":"59a7cac6-9558-4ff9-a029-6871aa0f250f","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:5.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703952208,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"59a7cac6-9558-4ff9-a029-6871aa0f250f","kind":"agentMessage","recordedAt":"2026-09-29T17:45:52.208437Z","revision":2,"status":"completed","text":"SKILL_PHASE0_OK","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"},"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"f6ce5178-aab1-4205-a5cf-07a01992991d","sequence":47},"last":{"id":"f6ce5178-aab1-4205-a5cf-07a01992991d","sequence":47},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790703952212,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":28,"promptTokens":38273,"totalTokens":38301},"durationMs":3111,"modelId":"meta/muse-spark-1.3","promptTokens":38273,"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"38e7ce9f-4de8-4e5b-9051-e4f3cbabeb07","sequence":50},"last":{"id":"38e7ce9f-4de8-4e5b-9051-e4f3cbabeb07","sequence":50},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"totalTokens":38301,"turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38273,"outputTokens":28,"reasoningTokens":13},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790703952214,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"e36de071-1e04-472d-aa8a-8ceddb5de660","childSessionLogPath":"subagent/e36de071-1e04-472d-aa8a-8ceddb5de660/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"c787e6af-1d6d-44b6-892e-2e8bc714b3b3","kind":"reminderChild","recordedAt":"2026-09-29T17:45:52.214263Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee45-e154-7511-a5d1-c318a04ffaca","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"},"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"c787e6af-1d6d-44b6-892e-2e8bc714b3b3","sequence":57},"last":{"id":"c787e6af-1d6d-44b6-892e-2e8bc714b3b3","sequence":57},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790703958991,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"24712ab9-77e4-450a-98b1-cfb455e64a99","fallbackText":"Reminder child session","generationId":1,"itemId":"3e9a8a07-f7ed-400f-aecd-45413565ff84","kind":"reminderChild","recordedAt":"2026-09-29T17:45:58.991191Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee45-d527-7133-8954-a78cbe078b40","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"},"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"3e9a8a07-f7ed-400f-aecd-45413565ff84","sequence":34},"last":{"id":"f5852563-4e6c-497f-a014-b9f510fd8a08","sequence":59},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790703958991,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"e36de071-1e04-472d-aa8a-8ceddb5de660","childSessionLogPath":"subagent/e36de071-1e04-472d-aa8a-8ceddb5de660/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"c787e6af-1d6d-44b6-892e-2e8bc714b3b3","kind":"reminderChild","recordedAt":"2026-09-29T17:45:58.991586Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee45-e154-7511-a5d1-c318a04ffaca","turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e"},"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"c787e6af-1d6d-44b6-892e-2e8bc714b3b3","sequence":57},"last":{"id":"49c39143-103a-4ff6-9da9-5f460199aad5","sequence":60},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790703958993,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"idle","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790703958994,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":9905,"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","sourceRange":{"first":{"id":"0085e82d-1273-4721-a949-b0616fc6e059","sequence":66},"last":{"id":"0085e82d-1273-4721-a949-b0616fc6e059","sequence":66},"stream":{"id":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":3063,"turnId":"01a0ee45-d51c-7adf-a4fc-c0c3e6b0a03e","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790703958994,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:45:48.989825Z","firstUserPrompt":"/phase0","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-d4bd-77d2-98a0-79c6a1333e80/session.jsonl","providerId":"meta","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"idle","title":"/phase0","turnCount":1,"updatedAt":"2026-09-29T17:45:58.993139Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703959207,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790703959207,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"notLoaded","viewCursor":"v:01a0ee45-d4bd-77d2-98a0-79c6a1333e80:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790703959207,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:45:48.989825Z","firstUserPrompt":"/phase0","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-d4bd-77d2-98a0-79c6a1333e80/session.jsonl","providerId":"meta","sessionId":"01a0ee45-d4bd-77d2-98a0-79c6a1333e80","status":"notLoaded","title":"/phase0","turnCount":1,"updatedAt":"2026-09-29T17:45:58.994348Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/staged-approval.ndjson b/plugins/muse-provider/test/fixtures/staged-approval.ndjson new file mode 100644 index 0000000000..6c64f9be72 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/staged-approval.ndjson @@ -0,0 +1,51 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee45-3a70-7681-ab97-ddf447f594a0","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909575,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:45:09.4981Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-3a77-7df1-84fe-f1348f74bb7b/session.jsonl","providerId":"meta","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:45:09.498104Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:45:09.4981Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-3a77-7df1-84fe-f1348f74bb7b/session.jsonl","providerId":"meta","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:45:09.498104Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909580,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee45-3a70-7681-ab97-ddf447f594a0","mode":"onRequest","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","source":"approvalReconfigure","sourceRange":{"first":{"id":"63699ada-6377-4996-8f16-591c59e31615","sequence":5},"last":{"id":"63699ada-6377-4996-8f16-591c59e31615","sequence":5},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","input":[{"type":"text","text":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909582,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"f5b00d5c-101c-4114-b6d4-6fd185b3a9e7","sequence":15},"last":{"id":"f5b00d5c-101c-4114-b6d4-6fd185b3a9e7","sequence":15},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909590,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"running","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909591,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"8d53885c-d5ed-4da6-826f-c2718d3107ba","sequence":17},"last":{"id":"8d53885c-d5ed-4da6-826f-c2718d3107ba","sequence":17},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909591,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","itemId":"c1c58c19-3efe-486b-83b4-7059c81e4abc","kind":"userMessage","recordedAt":"2026-09-29T17:45:09.583635Z","revision":1,"status":"completed","text":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"8d53885c-d5ed-4da6-826f-c2718d3107ba","sequence":17},"last":{"id":"8d53885c-d5ed-4da6-826f-c2718d3107ba","sequence":17},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909591,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"8d237cca-8a96-414d-b5a0-b922372b1111","fallbackText":"Reminder child session","generationId":1,"itemId":"604107b6-dcf2-4ac8-9c20-85adace9a056","kind":"reminderChild","recordedAt":"2026-09-29T17:45:09.590882Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee45-3ad5-7ae3-b92b-6080ffbaed08","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"604107b6-dcf2-4ac8-9c20-85adace9a056","sequence":35},"last":{"id":"604107b6-dcf2-4ac8-9c20-85adace9a056","sequence":35},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909595,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","createdAt":"2026-09-29T17:45:09.4981Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-3a77-7df1-84fe-f1348f74bb7b/session.jsonl","providerId":"meta","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:45:09.591134Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703915208,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":301,"promptTokens":38156,"totalTokens":38457},"durationMs":5613,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38156,"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"adcc2a9f-a1ab-428f-b213-1c3dc1d19282","sequence":51},"last":{"id":"adcc2a9f-a1ab-428f-b213-1c3dc1d19282","sequence":51},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"totalTokens":38457,"turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38156,"outputTokens":301,"reasoningTokens":201},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915210,"jsonrpc":"2.0","method":"session/statusChanged","params":{"attention":["approvalPending"],"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"running","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:7"}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","method":"approval/request","params":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","availableChoices":[{"choiceId":"allow_once","decision":"approved","label":"Allow once","scope":"once"},{"choiceId":"allow_local_prefix","decision":"approvedPolicyAmendment","label":"Always allow in this workspace: rm ...","rulePreview":"Always allow in this workspace: rm ...","scope":"localPersistent"},{"acceptsFeedback":true,"choiceId":"abort","decision":"abort","label":"Reject","scope":"once"}],"currentRequirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"itemId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","judgeEscalated":false,"protectedWrite":false,"rawArgs":"{\"command\":\"wc -l f && rm -rf f\",\"description\":\"Count lines then remove file\"}","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"5e822176-0464-43c4-9419-4355b481f8a2","sequence":56},"last":{"id":"5e822176-0464-43c4-9419-4355b481f8a2","sequence":56},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"subject":{"command":"wc -l f && rm -rf f","kind":"shell","stages":[{"argv":["wc","-l","f"],"argvComplete":true,"position":1,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":0},"resolution":{"kind":"knownSafe"},"suggestedPrefix":{"argvPrefix":["wc"],"label":"Always allow in this workspace: wc ..."},"totalStages":2},{"argv":["rm","-rf","f"],"argvComplete":true,"position":2,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"resolution":{"kind":"unresolved"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":2}],"workspaceRoot":"/tmp/muse-phase0/repo"},"taskId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","toolCallId":"call_01a0ee454ed276abb13fb5bc95951f53","toolName":"bash","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915211,"jsonrpc":"2.0","method":"approval/requested","params":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","availableChoices":[{"choiceId":"allow_once","decision":"approved","label":"Allow once","scope":"once"},{"choiceId":"allow_local_prefix","decision":"approvedPolicyAmendment","label":"Always allow in this workspace: rm ...","rulePreview":"Always allow in this workspace: rm ...","scope":"localPersistent"},{"acceptsFeedback":true,"choiceId":"abort","decision":"abort","label":"Reject","scope":"once"}],"currentRequirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"itemId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","judgeEscalated":false,"protectedWrite":false,"rawArgs":"{\"command\":\"wc -l f && rm -rf f\",\"description\":\"Count lines then remove file\"}","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"5e822176-0464-43c4-9419-4355b481f8a2","sequence":56},"last":{"id":"5e822176-0464-43c4-9419-4355b481f8a2","sequence":56},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"subject":{"command":"wc -l f && rm -rf f","kind":"shell","stages":[{"argv":["wc","-l","f"],"argvComplete":true,"position":1,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":0},"resolution":{"kind":"knownSafe"},"suggestedPrefix":{"argvPrefix":["wc"],"label":"Always allow in this workspace: wc ..."},"totalStages":2},{"argv":["rm","-rf","f"],"argvComplete":true,"position":2,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"resolution":{"kind":"unresolved"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":2}],"workspaceRoot":"/tmp/muse-phase0/repo"},"taskId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","toolCallId":"call_01a0ee454ed276abb13fb5bc95951f53","toolName":"bash","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915211,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","attention":["approvalPending"],"branch":"main","createdAt":"2026-09-29T17:45:09.495708Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-3a77-7df1-84fe-f1348f74bb7b/session.jsonl","providerId":"meta","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"running","title":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","turnCount":0,"updatedAt":"2026-09-29T17:45:15.210247Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"result":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"approval/decide","params":{"commandId":"01a0ee45-50cb-7347-a392-c2c3f12add59","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"choiceId":"allow_once"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","commandId":"01a0ee45-50cb-7347-a392-c2c3f12add59","status":"accepted","terminal":true}}} +{"dir":"in","msg":{"emittedAtMs":1790703915221,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"running","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915221,"jsonrpc":"2.0","method":"approval/updated","params":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","availableChoices":[{"choiceId":"allow_once","decision":"approved","label":"Allow once","scope":"once"},{"choiceId":"allow_local_prefix","decision":"approvedPolicyAmendment","label":"Always allow in this workspace: rm ...","rulePreview":"Always allow in this workspace: rm ...","scope":"localPersistent"},{"acceptsFeedback":true,"choiceId":"abort","decision":"abort","label":"Reject","scope":"once"}],"change":{"choiceId":"allow_once","decision":"approved","kind":"stageResolved","requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1}},"currentRequirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"8fb0dc1b-0325-49f0-90c7-127e642863ba","sequence":59},"last":{"id":"8fb0dc1b-0325-49f0-90c7-127e642863ba","sequence":59},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"subject":{"command":"wc -l f && rm -rf f","kind":"shell","stages":[{"argv":["wc","-l","f"],"argvComplete":true,"position":1,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":0},"resolution":{"kind":"knownSafe"},"suggestedPrefix":{"argvPrefix":["wc"],"label":"Always allow in this workspace: wc ..."},"totalStages":2},{"argv":["rm","-rf","f"],"argvComplete":true,"position":2,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"resolution":{"kind":"allowOnce"},"suggestedPrefix":{"argvPrefix":["rm"],"label":"Always allow in this workspace: rm ..."},"totalStages":2}],"workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915221,"jsonrpc":"2.0","method":"approval/resolved","params":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","decidedByCommandId":"01a0ee45-50cb-7347-a392-c2c3f12add59","decision":"approved","itemId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","policyResult":"allow","resolvedBy":"user","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"6b80bd39-abfc-45fb-9c9b-4dd995ede7af","sequence":60},"last":{"id":"6b80bd39-abfc-45fb-9c9b-4dd995ede7af","sequence":60},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"stageEvidence":[{"argv":["wc","-l","f"],"position":1,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":0},"resolution":{"kind":"knownSafe"},"totalStages":2},{"argv":["rm","-rf","f"],"position":2,"requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"resolution":{"kind":"allowOnce"},"totalStages":2}],"turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915221,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"command\":\"wc -l f && rm -rf f\",\"description\":\"Count lines then remove file\"}","callId":"call_01a0ee454ed276abb13fb5bc95951f53","itemId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","kind":"toolCall","recordedAt":"2026-09-29T17:45:15.217346Z","revision":1,"status":"inProgress","tool":"bash","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"a1c326a1-b2f7-460d-9bf0-42fbc0e7b995","sequence":53},"last":{"id":"47723f89-a36b-4c4d-8011-63ae936b976a","sequence":66},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915221,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","branch":"main","createdAt":"2026-09-29T17:45:09.495708Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-3a77-7df1-84fe-f1348f74bb7b/session.jsonl","providerId":"meta","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"running","title":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","turnCount":0,"updatedAt":"2026-09-29T17:45:15.21762Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":5,"method":"approval/decide","params":{"commandId":"01a0ee45-50d5-73ff-a6a1-b8db5e9cdf2f","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","requirementId":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sourceIndex":1},"choiceId":"allow_once"}}} +{"dir":"in","msg":{"error":{"code":-32051,"data":{"approvalId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","kind":"approvalAlreadyResolved","resolution":{"decision":"approved","resolvedBy":"user","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:9"},"retryable":false},"message":"approval 01a0ee45-50c8-7b92-a88f-04a4dfa119a5 is already resolved"},"id":5,"jsonrpc":"2.0"}} +{"dir":"in","msg":{"emittedAtMs":1790703915429,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"2 f\n","field":"output","itemId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:10.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915442,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"command\":\"wc -l f && rm -rf f\",\"description\":\"Count lines then remove file\"}","callId":"call_01a0ee454ed276abb13fb5bc95951f53","itemId":"01a0ee45-50c8-7b92-a88f-04a4dfa119a5","kind":"toolCall","recordedAt":"2026-09-29T17:45:15.442455Z","revision":2,"status":"completed","tool":"bash","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","visibleOutput":"2 f\n"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"a1c326a1-b2f7-460d-9bf0-42fbc0e7b995","sequence":53},"last":{"id":"d11e7d23-dde1-48ac-8775-6afbc5b1eaa4","sequence":74},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915444,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"8d237cca-8a96-414d-b5a0-b922372b1111","fallbackText":"Reminder child session","generationId":1,"itemId":"604107b6-dcf2-4ac8-9c20-85adace9a056","kind":"reminderChild","recordedAt":"2026-09-29T17:45:15.444591Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee45-3ad5-7ae3-b92b-6080ffbaed08","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"604107b6-dcf2-4ac8-9c20-85adace9a056","sequence":35},"last":{"id":"8db47bbe-b881-4efb-8e30-4838586ce540","sequence":77},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790703915447,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"d461ee5e-a0e2-482d-a91c-604217650af2","fallbackText":"Reminder child session","generationId":2,"itemId":"553828b6-6f65-405e-b5d9-06e5a9ad24e9","kind":"reminderChild","recordedAt":"2026-09-29T17:45:15.447283Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee45-51b5-78a1-bd60-165e8384cd55","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"553828b6-6f65-405e-b5d9-06e5a9ad24e9","sequence":86},"last":{"id":"553828b6-6f65-405e-b5d9-06e5a9ad24e9","sequence":86},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918084,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"619a0511-ea64-4544-93c9-897f38af1eff","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:13.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918084,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Ran `wc -l f &&","field":"text","itemId":"619a0511-ea64-4544-93c9-897f38af1eff","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:13.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918084,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" rm -rf f` in one call.","field":"text","itemId":"619a0511-ea64-4544-93c9-897f38af1eff","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:13.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918084,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" Output:","field":"text","itemId":"619a0511-ea64-4544-93c9-897f38af1eff","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:13.4"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918084,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" `2 f`, file removed","field":"text","itemId":"619a0511-ea64-4544-93c9-897f38af1eff","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:13.5"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918087,"jsonrpc":"2.0","method":"item/delta","params":{"delta":".","field":"text","itemId":"619a0511-ea64-4544-93c9-897f38af1eff","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:13.6"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918160,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"619a0511-ea64-4544-93c9-897f38af1eff","kind":"agentMessage","recordedAt":"2026-09-29T17:45:18.159688Z","revision":2,"status":"completed","text":"Ran `wc -l f && rm -rf f` in one call. Output: `2 f`, file removed.","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"faf6c080-8731-4b2c-a2ff-f058cad984a1","sequence":99},"last":{"id":"faf6c080-8731-4b2c-a2ff-f058cad984a1","sequence":99},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:14"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918163,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":343,"promptTokens":76718,"totalTokens":77061},"durationMs":2710,"modelId":"meta/muse-spark-1.3","promptTokens":38562,"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"3450d708-ea81-4155-b2fb-9dbb5333a0b4","sequence":102},"last":{"id":"3450d708-ea81-4155-b2fb-9dbb5333a0b4","sequence":102},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"totalTokens":38604,"turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","usage":{"cacheReadTokens":38129,"cacheWriteTokens":0,"cachedTokens":38129,"inputTokens":38562,"outputTokens":42,"reasoningTokens":7},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790703918166,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"b4b12de3-0d11-44c5-9302-d74629e69534","childSessionLogPath":"subagent/b4b12de3-0d11-44c5-9302-d74629e69534/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"fe97c426-62a1-4a4d-bacb-da431469b75a","kind":"reminderChild","recordedAt":"2026-09-29T17:45:18.165735Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee45-5c54-7e70-bf0e-8fa21d3c8752","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"fe97c426-62a1-4a4d-bacb-da431469b75a","sequence":109},"last":{"id":"fe97c426-62a1-4a4d-bacb-da431469b75a","sequence":109},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790703925286,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"d461ee5e-a0e2-482d-a91c-604217650af2","fallbackText":"Reminder child session","generationId":2,"itemId":"553828b6-6f65-405e-b5d9-06e5a9ad24e9","kind":"reminderChild","recordedAt":"2026-09-29T17:45:25.286272Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee45-51b5-78a1-bd60-165e8384cd55","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"553828b6-6f65-405e-b5d9-06e5a9ad24e9","sequence":86},"last":{"id":"763bb712-8197-4268-a6e7-1af1d539d9b8","sequence":111},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790703925287,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"b4b12de3-0d11-44c5-9302-d74629e69534","childSessionLogPath":"subagent/b4b12de3-0d11-44c5-9302-d74629e69534/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"fe97c426-62a1-4a4d-bacb-da431469b75a","kind":"reminderChild","recordedAt":"2026-09-29T17:45:25.286817Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee45-5c54-7e70-bf0e-8fa21d3c8752","turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29"},"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"fe97c426-62a1-4a4d-bacb-da431469b75a","sequence":109},"last":{"id":"ee0b2877-bfe6-4039-ae8a-482001756652","sequence":112},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790703925289,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"idle","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790703925290,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":15705,"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","sourceRange":{"first":{"id":"a099c7f2-2b2c-41d0-a222-25a4cca243e9","sequence":118},"last":{"id":"a099c7f2-2b2c-41d0-a222-25a4cca243e9","sequence":118},"stream":{"id":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":8501,"turnId":"01a0ee45-3acc-7f17-a996-8de3b5463c29","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790703925292,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:45:09.495708Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-3a77-7df1-84fe-f1348f74bb7b/session.jsonl","providerId":"meta","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"idle","title":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","turnCount":1,"updatedAt":"2026-09-29T17:45:25.28908Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703925526,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790703925526,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"notLoaded","viewCursor":"v:01a0ee45-3a77-7df1-84fe-f1348f74bb7b:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790703925526,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:45:09.495708Z","firstUserPrompt":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee45-3a77-7df1-84fe-f1348f74bb7b/session.jsonl","providerId":"meta","sessionId":"01a0ee45-3a77-7df1-84fe-f1348f74bb7b","status":"notLoaded","title":"Run exactly wc -l f && rm -rf f using the shell tool. f is disposable test data and I authorize deleting it. Do not split the command into separate calls.","turnCount":1,"updatedAt":"2026-09-29T17:45:25.292511Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/steer.ndjson b/plugins/muse-provider/test/fixtures/steer.ndjson new file mode 100644 index 0000000000..82ec68832c --- /dev/null +++ b/plugins/muse-provider/test/fixtures/steer.ndjson @@ -0,0 +1,48 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee46-e9cd-7cf5-a45a-e477a82cb206","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020005,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:46:59.927363Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:46:59.927367Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:46:59.927363Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:46:59.927367Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020011,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee46-e9cd-7cf5-a45a-e477a82cb206","mode":"onRequest","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","source":"approvalReconfigure","sourceRange":{"first":{"id":"cad43b46-1d52-43d2-9841-35b41ae09a9e","sequence":5},"last":{"id":"cad43b46-1d52-43d2-9841-35b41ae09a9e","sequence":5},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee46-ea2b-72e5-aada-1408802a3242","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","input":[{"type":"text","text":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020014,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"556e8486-0c1c-4b21-b2f1-07aaa518795b","sequence":15},"last":{"id":"556e8486-0c1c-4b21-b2f1-07aaa518795b","sequence":15},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee46-ea2b-72e5-aada-1408802a3242","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020022,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"running","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020023,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee46-ea2b-72e5-aada-1408802a3242","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"720ff452-b375-47ab-b2c5-5000bd6e271f","sequence":17},"last":{"id":"720ff452-b375-47ab-b2c5-5000bd6e271f","sequence":17},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020023,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee46-ea2b-72e5-aada-1408802a3242","itemId":"bee9b543-239a-4c82-96c7-c482cf3c23ff","kind":"userMessage","recordedAt":"2026-09-29T17:47:00.014911Z","revision":1,"status":"completed","text":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"720ff452-b375-47ab-b2c5-5000bd6e271f","sequence":17},"last":{"id":"720ff452-b375-47ab-b2c5-5000bd6e271f","sequence":17},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020023,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"dfb4300f-9488-4b4e-99a5-7b29d322952d","fallbackText":"Reminder child session","generationId":1,"itemId":"25799bf7-f24a-4eed-9953-f39079152e48","kind":"reminderChild","recordedAt":"2026-09-29T17:47:00.023027Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee46-ea35-7300-9f57-faffb63ca778","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"25799bf7-f24a-4eed-9953-f39079152e48","sequence":35},"last":{"id":"25799bf7-f24a-4eed-9953-f39079152e48","sequence":35},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704020029,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","createdAt":"2026-09-29T17:46:59.927363Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:47:00.023289Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704023752,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":173,"promptTokens":38144,"totalTokens":38317},"durationMs":3724,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38144,"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"f4bb27f0-964e-4bea-910e-1893ca61433f","sequence":50},"last":{"id":"f4bb27f0-964e-4bea-910e-1893ca61433f","sequence":50},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"totalTokens":38317,"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38144,"outputTokens":173,"reasoningTokens":82},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704023755,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"command\":\"sleep 12\",\"description\":\"Sleep for twelve seconds\",\"yield_time_ms\":15000}","callId":"call_01a0ee46f61c7482b289e8bb6aee0f02","itemId":"01a0ee46-f8c9-7db3-ac02-f2b78cfc7c56","kind":"toolCall","recordedAt":"2026-09-29T17:47:03.755423Z","revision":1,"status":"inProgress","tool":"bash","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"b11864b4-ec2c-46a8-a5b4-fd5594b69c40","sequence":52},"last":{"id":"c425da72-50aa-45ea-a37c-0f76f78dca96","sequence":58},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:7"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"turn/start","params":{"commandId":"01a0ee46-fcb3-78ab-a15d-29882a94f6d1","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","input":[{"type":"text","text":"Change the final reply to STEERED_PHASE0_OK and do not say ORIGINAL_DONE."}],"reasoningEffort":"low","ifBusy":"steer"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"commandId":"01a0ee46-fcb3-78ab-a15d-29882a94f6d1","disposition":"steered","startedNewTurn":false,"status":"accepted","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"}}} +{"dir":"in","msg":{"emittedAtMs":1790704033759,"jsonrpc":"2.0","method":"item/updated","params":{"item":{"args":"{\"command\":\"sleep 12\",\"description\":\"Sleep for twelve seconds\",\"yield_time_ms\":15000}","background":true,"backgroundInitiator":"timeout","callId":"call_01a0ee46f61c7482b289e8bb6aee0f02","itemId":"01a0ee46-f8c9-7db3-ac02-f2b78cfc7c56","kind":"toolCall","recordedAt":"2026-09-29T17:47:13.759048Z","revision":2,"status":"inProgress","tool":"bash","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"b11864b4-ec2c-46a8-a5b4-fd5594b69c40","sequence":52},"last":{"id":"5b5abfae-b315-4f40-8a8a-a0fffdf228ab","sequence":63},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704033762,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee46-fcb3-78ab-a15d-29882a94f6d1","itemId":"591cef15-1dd4-5a6d-ad43-d21def93699b","kind":"userMessage","recordedAt":"2026-09-29T17:47:13.762324Z","revision":1,"status":"completed","steered":true,"text":"Change the final reply to STEERED_PHASE0_OK and do not say ORIGINAL_DONE.","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"fa12e860-f32c-4e3e-906d-56085eeb1f35","sequence":69},"last":{"id":"fa12e860-f32c-4e3e-906d-56085eeb1f35","sequence":69},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704033765,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"dfb4300f-9488-4b4e-99a5-7b29d322952d","fallbackText":"Reminder child session","generationId":1,"itemId":"25799bf7-f24a-4eed-9953-f39079152e48","kind":"reminderChild","recordedAt":"2026-09-29T17:47:13.76483Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee46-ea35-7300-9f57-faffb63ca778","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"25799bf7-f24a-4eed-9953-f39079152e48","sequence":35},"last":{"id":"046a34dc-7454-4b2a-8493-e1bbfb3787b1","sequence":70},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704033767,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"4ba6a4a2-695b-4e19-b93f-399028c26c85","fallbackText":"Reminder child session","generationId":2,"itemId":"e2deeff1-ddc1-46c5-b053-fdc0c7a12ad2","kind":"reminderChild","recordedAt":"2026-09-29T17:47:13.767204Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee47-1fe5-72a0-84bd-4c9e9446ed0d","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"e2deeff1-ddc1-46c5-b053-fdc0c7a12ad2","sequence":79},"last":{"id":"e2deeff1-ddc1-46c5-b053-fdc0c7a12ad2","sequence":79},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704035962,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"command\":\"sleep 12\",\"description\":\"Sleep for twelve seconds\",\"yield_time_ms\":15000}","background":true,"backgroundInitiator":"timeout","callId":"call_01a0ee46f61c7482b289e8bb6aee0f02","itemId":"01a0ee46-f8c9-7db3-ac02-f2b78cfc7c56","kind":"toolCall","recordedAt":"2026-09-29T17:47:15.961748Z","revision":3,"status":"completed","tool":"bash","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","visibleOutput":"{\n \"chunk_id\": \"exec-1-1\",\n \"command\": \"sleep 12\",\n \"description\": \"Sleep for twelve seconds\",\n \"execution_state\": \"background_running\",\n \"session_id\": 1,\n \"work_id\": \"work.v1.managed_bash.sha256.10c46069f6af08edd1e9a61d87aea3c93ab0bf6df4d8fe5d5ab2efe16c2aa63e\",\n \"model_guidance\": \"The command is still running in the background and the UI already shows its status. Do not poll for completion: the final output is delivered to you automatically as runtime context and wakes you even after you end the turn. Exception: when a runtime overdue notice names a still-running session, you may inspect it or terminate it with bash_input now. Do not narrate that it started, is running, shows current output, will continue, or has an internal session_id unless the user explicitly asks or you have substantive next work. If there is nothing else to do, end the turn without extra status text. Managed sessions end when your agent session ends: a deliverable process that must keep running after your final answer needs a detached `setsid -f` start instead (where setsid exists \u2014 Linux).\",\n \"output\": \"\",\n \"original_output_bytes\": 0,\n \"original_output_tokens\": 0,\n \"truncated\": false\n}"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"b11864b4-ec2c-46a8-a5b4-fd5594b69c40","sequence":52},"last":{"id":"b38c5bba-fdd1-48dc-887b-aea06d3fd832","sequence":93},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704037136,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"f802477d-5ebb-4a3d-b573-1624f746f95d","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:12.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704037136,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Evaluating conflicting instructions and stop-signal guidance while waiting for the background command to finish.","field":"summary.0","itemId":"f802477d-5ebb-4a3d-b573-1624f746f95d","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:12.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704040852,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Resolving instruction precedence while deferring the reply until the background command completes.","field":"summary.0","itemId":"f802477d-5ebb-4a3d-b573-1624f746f95d","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:12.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704051512,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Deferring the final reply while waiting for the background command to complete.","field":"summary.0","itemId":"f802477d-5ebb-4a3d-b573-1624f746f95d","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:12.4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704060273,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"f802477d-5ebb-4a3d-b573-1624f746f95d","kind":"reasoning","providerItemId":"rs_6abbf9a31753fbc1f4c04388:rs_01a0ee47259e73e49456486349db6e0e","recordedAt":"2026-09-29T17:47:40.272906Z","revision":2,"status":"completed","summary":["Evaluating conflicting instructions and stop-signal guidance while waiting for the background command to finish.Resolving instruction precedence while deferring the reply until the background command completes.Deferring the final reply while waiting for the background command to complete."],"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"e32149f5-e659-45dd-8958-b4c6843dabdc","sequence":99},"last":{"id":"e32149f5-e659-45dd-8958-b4c6843dabdc","sequence":99},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704060510,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":1755,"promptTokens":76806,"totalTokens":78561},"durationMs":26738,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38662,"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"5cf0de05-1b2e-4bc2-ba58-4ffe9c82880e","sequence":104},"last":{"id":"5cf0de05-1b2e-4bc2-ba58-4ffe9c82880e","sequence":104},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"totalTokens":40244,"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","usage":{"cacheReadTokens":38129,"cacheWriteTokens":0,"cachedTokens":38129,"inputTokens":38662,"outputTokens":1582,"reasoningTokens":1460},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:14"}}} +{"dir":"in","msg":{"emittedAtMs":1790704060512,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{}","callId":"call_01a0ee4786c270bdb312bdd0ddf75a64","itemId":"01a0ee47-885e-7440-9a65-b3f7d88924a2","kind":"toolCall","recordedAt":"2026-09-29T17:47:40.51204Z","revision":1,"status":"inProgress","tool":"work_list","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"13fa7e2b-a127-4fde-a079-7b4d23b898ea","sequence":106},"last":{"id":"5eb996c4-c5d4-4d22-8ad4-42f8fd8dbb06","sequence":111},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704060513,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{}","callId":"call_01a0ee4786c270bdb312bdd0ddf75a64","itemId":"01a0ee47-885e-7440-9a65-b3f7d88924a2","kind":"toolCall","recordedAt":"2026-09-29T17:47:40.51315Z","revision":2,"status":"completed","tool":"work_list","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","visibleOutput":"{\"items\":[],\"next_after_work_id\":null}"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"13fa7e2b-a127-4fde-a079-7b4d23b898ea","sequence":106},"last":{"id":"3ab45430-c979-4535-abde-ce61ba59853e","sequence":115},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704060516,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"4ba6a4a2-695b-4e19-b93f-399028c26c85","fallbackText":"Reminder child session","generationId":2,"itemId":"e2deeff1-ddc1-46c5-b053-fdc0c7a12ad2","kind":"reminderChild","recordedAt":"2026-09-29T17:47:40.516146Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee47-1fe5-72a0-84bd-4c9e9446ed0d","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"e2deeff1-ddc1-46c5-b053-fdc0c7a12ad2","sequence":79},"last":{"id":"cb6695e4-cf54-43e4-ada1-14b9ef7c71ac","sequence":119},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704060518,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"c03ed820-1aea-441c-8b83-c56e0a21f749","fallbackText":"Reminder child session","generationId":3,"itemId":"6873949c-68f0-43f2-90d8-ffbe78d1d4e6","kind":"reminderChild","recordedAt":"2026-09-29T17:47:40.5186Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee47-8865-7b53-b394-8d0a49863634","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"6873949c-68f0-43f2-90d8-ffbe78d1d4e6","sequence":128},"last":{"id":"6873949c-68f0-43f2-90d8-ffbe78d1d4e6","sequence":128},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065046,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"b7f0225d-5758-4365-987d-4931bba57bb2","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:18.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065046,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"STE","field":"text","itemId":"b7f0225d-5758-4365-987d-4931bba57bb2","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:18.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065046,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"ERED_PHASE0_OK","field":"text","itemId":"b7f0225d-5758-4365-987d-4931bba57bb2","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:18.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065116,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"b7f0225d-5758-4365-987d-4931bba57bb2","kind":"agentMessage","recordedAt":"2026-09-29T17:47:45.116004Z","revision":2,"status":"completed","text":"STEERED_PHASE0_OK","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"e1501975-6d9d-4bcc-8a10-1eeab8c32515","sequence":141},"last":{"id":"e1501975-6d9d-4bcc-8a10-1eeab8c32515","sequence":141},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065120,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":1794,"promptTokens":117278,"totalTokens":119072},"durationMs":4597,"modelId":"meta/muse-spark-1.3","promptTokens":40472,"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"27e5e8e1-9717-4880-94dc-242e6b68066d","sequence":144},"last":{"id":"27e5e8e1-9717-4880-94dc-242e6b68066d","sequence":144},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"totalTokens":40511,"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","usage":{"cacheReadTokens":38641,"cacheWriteTokens":0,"cachedTokens":38641,"inputTokens":40472,"outputTokens":39,"reasoningTokens":23},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065124,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"61d34ee6-0447-4424-b6f6-6606ed0465c2","childSessionLogPath":"subagent/61d34ee6-0447-4424-b6f6-6606ed0465c2/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"411ee9ec-dfbd-4d09-ab8d-1b25ee41a63d","kind":"reminderChild","recordedAt":"2026-09-29T17:47:45.123439Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee47-9a61-72d2-887f-7286aa2c2eb5","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"411ee9ec-dfbd-4d09-ab8d-1b25ee41a63d","sequence":151},"last":{"id":"411ee9ec-dfbd-4d09-ab8d-1b25ee41a63d","sequence":151},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704070732,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"c03ed820-1aea-441c-8b83-c56e0a21f749","fallbackText":"Reminder child session","generationId":3,"itemId":"6873949c-68f0-43f2-90d8-ffbe78d1d4e6","kind":"reminderChild","recordedAt":"2026-09-29T17:47:50.732258Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee47-8865-7b53-b394-8d0a49863634","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"6873949c-68f0-43f2-90d8-ffbe78d1d4e6","sequence":128},"last":{"id":"45ba20b8-3c61-471b-839b-5e0cfef94794","sequence":153},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790704070733,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"61d34ee6-0447-4424-b6f6-6606ed0465c2","childSessionLogPath":"subagent/61d34ee6-0447-4424-b6f6-6606ed0465c2/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"411ee9ec-dfbd-4d09-ab8d-1b25ee41a63d","kind":"reminderChild","recordedAt":"2026-09-29T17:47:50.732876Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee47-9a61-72d2-887f-7286aa2c2eb5","turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242"},"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"411ee9ec-dfbd-4d09-ab8d-1b25ee41a63d","sequence":151},"last":{"id":"fa37cfae-9a82-4a2f-8122-0bb32bb8db89","sequence":154},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704070735,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"idle","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:24"}}} +{"dir":"in","msg":{"emittedAtMs":1790704070736,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":50720,"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","sourceRange":{"first":{"id":"76a1169b-330c-4651-982a-a04b2216a51a","sequence":162},"last":{"id":"76a1169b-330c-4651-982a-a04b2216a51a","sequence":162},"stream":{"id":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":17121,"turnId":"01a0ee46-ea2b-72e5-aada-1408802a3242","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:24"}}} +{"dir":"in","msg":{"emittedAtMs":1790704070737,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:46:59.924858Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"idle","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":1,"updatedAt":"2026-09-29T17:47:50.73531Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704070981,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:25"}}} +{"dir":"in","msg":{"emittedAtMs":1790704070981,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"notLoaded","viewCursor":"v:01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c:25"}}} +{"dir":"in","msg":{"emittedAtMs":1790704070981,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:46:59.924858Z","firstUserPrompt":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c/session.jsonl","providerId":"meta","sessionId":"01a0ee46-e9d4-7cd3-a63d-a4f14aa76b6c","status":"notLoaded","title":"Run bash command sleep 12; then respond ORIGINAL_DONE. Do not respond before the command finishes.","turnCount":1,"updatedAt":"2026-09-29T17:47:50.73673Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/subagent.ndjson b/plugins/muse-provider/test/fixtures/subagent.ndjson new file mode 100644 index 0000000000..492dcb65da --- /dev/null +++ b/plugins/muse-provider/test/fixtures/subagent.ndjson @@ -0,0 +1,39 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee47-6e08-74bb-ab1c-255f4a0b7265","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053858,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:47:33.779618Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/session.jsonl","providerId":"meta","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:47:33.779622Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:47:33.779618Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/session.jsonl","providerId":"meta","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:47:33.779622Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053864,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee47-6e08-74bb-ab1c-255f4a0b7265","mode":"onRequest","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","source":"approvalReconfigure","sourceRange":{"first":{"id":"d25de24f-0d5f-43c9-8d6a-e54e053d44d9","sequence":5},"last":{"id":"d25de24f-0d5f-43c9-8d6a-e54e053d44d9","sequence":5},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","input":[{"type":"text","text":"Spawn one native subagent in this same workspace, without a worktree. Ask it to reply SUBAGENT_PHASE0_OK without tools; wait for it and report its reply."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053866,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"2cc8f016-2f0a-4f3c-8881-2b4c06768dab","sequence":15},"last":{"id":"2cc8f016-2f0a-4f3c-8881-2b4c06768dab","sequence":15},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053874,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"running","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053875,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"6ab6a53a-2592-4f64-957f-d9818f839f83","sequence":17},"last":{"id":"6ab6a53a-2592-4f64-957f-d9818f839f83","sequence":17},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053875,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","itemId":"9beb70f4-128a-4cb2-a963-ed233310f65d","kind":"userMessage","recordedAt":"2026-09-29T17:47:33.867478Z","revision":1,"status":"completed","text":"Spawn one native subagent in this same workspace, without a worktree. Ask it to reply SUBAGENT_PHASE0_OK without tools; wait for it and report its reply.","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"6ab6a53a-2592-4f64-957f-d9818f839f83","sequence":17},"last":{"id":"6ab6a53a-2592-4f64-957f-d9818f839f83","sequence":17},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053875,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"c4256697-9620-414f-816a-dc40d7a841fd","fallbackText":"Reminder child session","generationId":1,"itemId":"b084f7ab-fbdf-4518-9977-31762244876b","kind":"reminderChild","recordedAt":"2026-09-29T17:47:33.874739Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee47-6e71-74c2-914d-8f271c569480","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"b084f7ab-fbdf-4518-9977-31762244876b","sequence":35},"last":{"id":"b084f7ab-fbdf-4518-9977-31762244876b","sequence":35},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704053879,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","createdAt":"2026-09-29T17:47:33.779618Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/session.jsonl","providerId":"meta","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:47:33.875003Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704057890,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":228,"promptTokens":38151,"totalTokens":38379},"durationMs":4011,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38151,"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"1cf8600c-b6bc-456e-bdf4-c3720e8dba73","sequence":51},"last":{"id":"1cf8600c-b6bc-456e-bdf4-c3720e8dba73","sequence":51},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"totalTokens":38379,"turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38151,"outputTokens":228,"reasoningTokens":93},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704057892,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"command_id\":\"phase0-spawn-001\",\"objective\":\"Reply with exactly SUBAGENT_PHASE0_OK. Do not use any tools. Just reply that string.\",\"role\":\"phase0-check\"}","callId":"call_01a0ee477a5c70d6bc8d03c09354a9f2","itemId":"01a0ee47-7e22-7180-a4d7-8b56df20594b","kind":"toolCall","recordedAt":"2026-09-29T17:47:37.892273Z","revision":1,"status":"inProgress","tool":"subagent_spawn","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"91df9584-990e-4c44-9f90-3356aa275cba","sequence":53},"last":{"id":"5e054b86-aced-4f10-b87e-e3510b88deff","sequence":58},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704057902,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"command_id\":\"phase0-spawn-001\",\"objective\":\"Reply with exactly SUBAGENT_PHASE0_OK. Do not use any tools. Just reply that string.\",\"role\":\"phase0-check\"}","callId":"call_01a0ee477a5c70d6bc8d03c09354a9f2","itemId":"01a0ee47-7e22-7180-a4d7-8b56df20594b","kind":"toolCall","recordedAt":"2026-09-29T17:47:37.901973Z","revision":2,"status":"completed","tool":"subagent_spawn","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","visibleOutput":"{\"status\":\"accepted\",\"subagent_id\":\"01a0ee47-7e25-79f1-b301-6130c0406a84\",\"work_id\":\"work.v2.native_subagent.sha256.03a275518974905bd23efc729849ff7f5da968b6c0005148f5e45bdfe2d1c0fe\",\"agent_path\":\"main/phase0-check/1\",\"task_ref\":\"task/01a0ee47-7e25-79f1-b301-611082261a4d#0\"}"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"91df9584-990e-4c44-9f90-3356aa275cba","sequence":53},"last":{"id":"f714d6f0-da93-41a7-b272-998f544b35ac","sequence":73},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704059703,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":386,"promptTokens":76683,"totalTokens":77069},"durationMs":1797,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38532,"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"8271b4b1-cc9b-483b-b9ff-fbc08cc309b9","sequence":93},"last":{"id":"8271b4b1-cc9b-483b-b9ff-fbc08cc309b9","sequence":93},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"totalTokens":38690,"turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","usage":{"cacheReadTokens":38129,"cacheWriteTokens":0,"cachedTokens":38129,"inputTokens":38532,"outputTokens":158,"reasoningTokens":6},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704059704,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"command_id\":\"phase0-wait-001\",\"subagent_id\":\"01a0ee47-7e25-79f1-b301-6130c0406a84\",\"timeout_ms\":60000,\"wait_for\":\"result_ready\"}","callId":"call_01a0ee4782007630be7ceef1865c1ec5","itemId":"01a0ee47-8538-7c40-9c16-ef12645a1e6b","kind":"toolCall","recordedAt":"2026-09-29T17:47:39.704685Z","revision":1,"status":"inProgress","tool":"subagent_wait","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"1fc77f96-4d8d-4707-bb35-4402df88d4d2","sequence":95},"last":{"id":"55633f00-93c6-49b4-a592-f9ef36aa3f77","sequence":100},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704060108,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"command_id\":\"phase0-wait-001\",\"subagent_id\":\"01a0ee47-7e25-79f1-b301-6130c0406a84\",\"timeout_ms\":60000,\"wait_for\":\"result_ready\"}","callId":"call_01a0ee4782007630be7ceef1865c1ec5","itemId":"01a0ee47-8538-7c40-9c16-ef12645a1e6b","kind":"toolCall","recordedAt":"2026-09-29T17:47:40.108735Z","revision":2,"status":"completed","tool":"subagent_wait","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","visibleOutput":"{\"status\":\"ready\",\"subagent_id\":\"01a0ee47-7e25-79f1-b301-6130c0406a84\",\"task_ref\":\"task/01a0ee47-7e25-79f1-b301-611082261a4d#5\",\"summary\":\"SUBAGENT_PHASE0_OK\",\"workspace\":{\"placement\":\"shared\",\"setup\":\"active\",\"parent_changes\":\"not_recorded\"},\"evidence_refs\":[\"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/subagent/01a0ee47-7e29-7103-97c7-cdde44e26fe8/session.jsonl\"]}"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"1fc77f96-4d8d-4707-bb35-4402df88d4d2","sequence":95},"last":{"id":"b9435d1c-259c-4332-845c-506b7826a5aa","sequence":110},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704063713,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":519,"promptTokens":115569,"totalTokens":116088},"durationMs":3600,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38886,"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"0d10d7f3-8f3f-4e4e-b3e9-b68fab3d5083","sequence":130},"last":{"id":"0d10d7f3-8f3f-4e4e-b3e9-b68fab3d5083","sequence":130},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"totalTokens":39019,"turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","usage":{"cacheReadTokens":38513,"cacheWriteTokens":0,"cachedTokens":38513,"inputTokens":38886,"outputTokens":133,"reasoningTokens":29},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704063714,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"subagent_id\":\"01a0ee47-7e25-79f1-b301-6130c0406a84\"}","callId":"call_01a0ee4792417281be28207c410311af","itemId":"01a0ee47-94e1-7ac0-a1b6-6bd1dc882dff","kind":"toolCall","recordedAt":"2026-09-29T17:47:43.713973Z","revision":1,"status":"inProgress","tool":"subagent_read_result","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"5e2881f2-1072-4ce0-995e-30afb15179f1","sequence":132},"last":{"id":"864e7062-a1b7-44a6-983c-21580d0978f8","sequence":137},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704063715,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"subagent_id\":\"01a0ee47-7e25-79f1-b301-6130c0406a84\"}","callId":"call_01a0ee4792417281be28207c410311af","itemId":"01a0ee47-94e1-7ac0-a1b6-6bd1dc882dff","kind":"toolCall","recordedAt":"2026-09-29T17:47:43.714985Z","revision":2,"status":"completed","tool":"subagent_read_result","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","visibleOutput":"{\"status\":\"ready\",\"subagent_id\":\"01a0ee47-7e25-79f1-b301-6130c0406a84\",\"task_ref\":\"task/01a0ee47-7e25-79f1-b301-611082261a4d#5\",\"summary\":\"SUBAGENT_PHASE0_OK\",\"workspace\":{\"placement\":\"shared\",\"setup\":\"active\",\"parent_changes\":\"not_recorded\"},\"evidence_refs\":[\"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/subagent/01a0ee47-7e29-7103-97c7-cdde44e26fe8/session.jsonl\"]}"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"5e2881f2-1072-4ce0-995e-30afb15179f1","sequence":132},"last":{"id":"4012cf01-f19e-4a6b-ad34-4e629c95b9cf","sequence":141},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:14"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065625,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"952ce848-7d20-4b67-b4fa-57d2c468a5a3","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:14.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065625,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Subagent replied","field":"text","itemId":"952ce848-7d20-4b67-b4fa-57d2c468a5a3","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:14.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065625,"jsonrpc":"2.0","method":"item/delta","params":{"delta":": SUBAGENT_PHASE0_OK.","field":"text","itemId":"952ce848-7d20-4b67-b4fa-57d2c468a5a3","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:14.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065675,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"952ce848-7d20-4b67-b4fa-57d2c468a5a3","kind":"agentMessage","recordedAt":"2026-09-29T17:47:45.674937Z","revision":2,"status":"completed","text":"Subagent replied: SUBAGENT_PHASE0_OK.","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"ec545d73-530a-443e-89eb-9ca0d190ef81","sequence":158},"last":{"id":"ec545d73-530a-443e-89eb-9ca0d190ef81","sequence":158},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065679,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":545,"promptTokens":154786,"totalTokens":155331},"durationMs":1961,"modelId":"meta/muse-spark-1.3","promptTokens":39217,"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"f284c974-86d8-4e39-ac2a-3c5ecd3b1a64","sequence":161},"last":{"id":"f284c974-86d8-4e39-ac2a-3c5ecd3b1a64","sequence":161},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"totalTokens":39243,"turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","usage":{"cacheReadTokens":38769,"cacheWriteTokens":0,"cachedTokens":38769,"inputTokens":39217,"outputTokens":26,"reasoningTokens":5},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704065680,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"5032f8b0-4581-45f5-839f-d90c0cb3124f","childSessionLogPath":"subagent/5032f8b0-4581-45f5-839f-d90c0cb3124f/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"9e970659-4d27-4fc2-9e4d-b1948d81024f","kind":"reminderChild","recordedAt":"2026-09-29T17:47:45.680658Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee47-9c90-7712-ba14-50c3bbf3b9b8","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"9e970659-4d27-4fc2-9e4d-b1948d81024f","sequence":168},"last":{"id":"9e970659-4d27-4fc2-9e4d-b1948d81024f","sequence":168},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704068834,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"5032f8b0-4581-45f5-839f-d90c0cb3124f","childSessionLogPath":"subagent/5032f8b0-4581-45f5-839f-d90c0cb3124f/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"9e970659-4d27-4fc2-9e4d-b1948d81024f","kind":"reminderChild","recordedAt":"2026-09-29T17:47:48.833854Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee47-9c90-7712-ba14-50c3bbf3b9b8","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"9e970659-4d27-4fc2-9e4d-b1948d81024f","sequence":168},"last":{"id":"75117c11-f653-4576-a9cf-cd0baf59f2b0","sequence":170},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704068836,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"c4256697-9620-414f-816a-dc40d7a841fd","failureReason":"main run completed","fallbackText":"Reminder child session","generationId":1,"itemId":"b084f7ab-fbdf-4518-9977-31762244876b","kind":"reminderChild","recordedAt":"2026-09-29T17:47:48.836755Z","reminderAgentId":"skill-reminder","revision":2,"status":"cancelled","taskId":"01a0ee47-6e71-74c2-914d-8f271c569480","turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082"},"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"b084f7ab-fbdf-4518-9977-31762244876b","sequence":35},"last":{"id":"f4fdf463-ff2e-4ed1-8729-11d708a15078","sequence":174},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704068837,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"idle","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704068838,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":14969,"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"1955daa1-9552-42d8-94a5-73cb1d5d4814","sequence":176},"last":{"id":"1955daa1-9552-42d8-94a5-73cb1d5d4814","sequence":176},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":11758,"turnId":"01a0ee47-6e68-7456-ad6f-dde465d1d082","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704068838,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","sourceRange":{"first":{"id":"f0a5ae9a-f3f7-4c2e-b48b-e339e54c4d3b","sequence":177},"last":{"id":"f0a5ae9a-f3f7-4c2e-b48b-e339e54c4d3b","sequence":177},"stream":{"id":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:21","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704068838,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:47:33.777159Z","firstUserPrompt":"Spawn one native subagent in this same workspace, without a worktree. Ask it to reply SUBAGENT_PHASE0_OK without tools; wait for it and report its reply.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/session.jsonl","providerId":"meta","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"idle","title":"Spawn one native subagent in this same workspace, without a worktree. Ask it to reply SUBAGENT_PHASE0_OK without tools; wait for it and report its reply.","turnCount":1,"updatedAt":"2026-09-29T17:47:48.838179Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704069093,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704069093,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"notLoaded","viewCursor":"v:01a0ee47-6e10-72d3-a976-b9df658f7c2f:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704069093,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:47:33.777159Z","firstUserPrompt":"Spawn one native subagent in this same workspace, without a worktree. Ask it to reply SUBAGENT_PHASE0_OK without tools; wait for it and report its reply.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee47-6e10-72d3-a976-b9df658f7c2f/session.jsonl","providerId":"meta","sessionId":"01a0ee47-6e10-72d3-a976-b9df658f7c2f","status":"notLoaded","title":"Spawn one native subagent in this same workspace, without a worktree. Ask it to reply SUBAGENT_PHASE0_OK without tools; wait for it and report its reply.","turnCount":1,"updatedAt":"2026-09-29T17:47:48.838179Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/text-reasoning.ndjson b/plugins/muse-provider/test/fixtures/text-reasoning.ndjson new file mode 100644 index 0000000000..e8a4ce16ea --- /dev/null +++ b/plugins/muse-provider/test/fixtures/text-reasoning.ndjson @@ -0,0 +1,53 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee4c-c4f9-74f4-a4d0-8ceb8ed7bd42","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403795,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:53:23.716151Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4c-c501-7d50-9020-effa9f9956e1/session.jsonl","providerId":"meta","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:53:23.716155Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:53:23.716151Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4c-c501-7d50-9020-effa9f9956e1/session.jsonl","providerId":"meta","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:53:23.716155Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403800,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee4c-c4f9-74f4-a4d0-8ceb8ed7bd42","mode":"onRequest","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","source":"approvalReconfigure","sourceRange":{"first":{"id":"f4333176-5846-4643-9db4-716ab148a77a","sequence":5},"last":{"id":"f4333176-5846-4643-9db4-716ab148a77a","sequence":5},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","input":[{"type":"text","text":"Think through the exact rational sum 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6. Explain how you reduce it to lowest terms. Do not use tools."}],"reasoningEffort":"high"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403803,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"e859ea8a-7b97-468e-af6c-789485c6fb0b","sequence":15},"last":{"id":"e859ea8a-7b97-468e-af6c-789485c6fb0b","sequence":15},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403812,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"running","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403813,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"3294e229-d417-4d6d-b543-31f3a7c72916","sequence":17},"last":{"id":"3294e229-d417-4d6d-b543-31f3a7c72916","sequence":17},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403813,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","itemId":"bf516640-ee66-4e83-b101-dc3bae7fd763","kind":"userMessage","recordedAt":"2026-09-29T17:53:23.804051Z","revision":1,"status":"completed","text":"Think through the exact rational sum 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6. Explain how you reduce it to lowest terms. Do not use tools.","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"3294e229-d417-4d6d-b543-31f3a7c72916","sequence":17},"last":{"id":"3294e229-d417-4d6d-b543-31f3a7c72916","sequence":17},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403813,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"a9db8dd6-6066-4a8b-a41f-04fdfdefdb1a","fallbackText":"Reminder child session","generationId":1,"itemId":"278bcded-5c29-40a1-b034-152609dd21f2","kind":"reminderChild","recordedAt":"2026-09-29T17:53:23.812033Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4c-c562-7052-9445-a86270ea242d","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"278bcded-5c29-40a1-b034-152609dd21f2","sequence":35},"last":{"id":"278bcded-5c29-40a1-b034-152609dd21f2","sequence":35},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704403817,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","createdAt":"2026-09-29T17:53:23.716151Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4c-c501-7d50-9020-effa9f9956e1/session.jsonl","providerId":"meta","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:53:23.812401Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704409177,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"f3c7d3fc-1644-46c3-b63c-74e0c7dee6c3","kind":"reasoning","revision":1,"status":"inProgress","summary":[""],"turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:5.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704409177,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Computing the rational sum by finding a common denominator and reducing the fraction to lowest terms via gcd.","field":"summary.0","itemId":"f3c7d3fc-1644-46c3-b63c-74e0c7dee6c3","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:5.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410350,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"f3c7d3fc-1644-46c3-b63c-74e0c7dee6c3","kind":"reasoning","providerItemId":"rs_6abbfb16a0d4c4cc026a42b8:rs_01a0ee4ccf75761a913c4cb237470fa4","recordedAt":"2026-09-29T17:53:30.349608Z","revision":2,"status":"completed","summary":["Computing the rational sum by finding a common denominator and reducing the fraction to lowest terms via gcd."],"turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"b1446d39-8f36-461d-9c53-d8aac56413c2","sequence":48},"last":{"id":"b1446d39-8f36-461d-9c53-d8aac56413c2","sequence":48},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410350,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410350,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Sum with","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410350,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" common","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410350,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" denominator 60,","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.4"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410350,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" the LCM of 1 through","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.5"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410804,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" 6:\n\n* 1 = 60/60\n* 1/","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.6"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410804,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"2 = 30/60\n* 1/3 = 20/","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410804,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"60\n* 1/4 = 15/60\n* 1","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410804,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"/5 = 12/60\n* 1/6 = 10","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410804,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"/60\n\nSum:\n\n","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410888,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"`(","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410888,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"60+30+20+15+12+10)/60 = 147","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410888,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"/60`\n\nReduce:","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410888,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" `147 = 3 \u00d7 7 \u00d7 7`,","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.14"}}} +{"dir":"in","msg":{"emittedAtMs":1790704410888,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" `60 = 2\u00b2 \u00d7 3 \u00d7 5`, so `","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.15"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411146,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"gcd(147,60)","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.16"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411146,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" = 3`.\n\nDivide numerator and denominator by 3:\n\n`147/60","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.17"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411146,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" = 49/20`\n\n`49 = ","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.18"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411146,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"7\u00b2` shares","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.19"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411146,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" no prime","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.20"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411347,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" factor with `20 = 2\u00b2 \u00d7 5`, so `gcd =","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.21"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411347,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" 1`. It","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.22"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411347,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" is in lowest terms.","field":"text","itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:6.23"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411393,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"4fdf781c-c6d0-415a-82ba-dc0ad189d8f6","kind":"agentMessage","recordedAt":"2026-09-29T17:53:31.392919Z","revision":2,"status":"completed","text":"Sum with common denominator 60, the LCM of 1 through 6:\n\n* 1 = 60/60\n* 1/2 = 30/60\n* 1/3 = 20/60\n* 1/4 = 15/60\n* 1/5 = 12/60\n* 1/6 = 10/60\n\nSum:\n\n`(60+30+20+15+12+10)/60 = 147/60`\n\nReduce: `147 = 3 \u00d7 7 \u00d7 7`, `60 = 2\u00b2 \u00d7 3 \u00d7 5`, so `gcd(147,60) = 3`.\n\nDivide numerator and denominator by 3:\n\n`147/60 = 49/20`\n\n`49 = 7\u00b2` shares no prime factor with `20 = 2\u00b2 \u00d7 5`, so `gcd = 1`. It is in lowest terms.","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"8e63bac4-b43a-435e-82e1-a0b124c9e62e","sequence":50},"last":{"id":"8e63bac4-b43a-435e-82e1-a0b124c9e62e","sequence":50},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411420,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":663,"promptTokens":38169,"totalTokens":38832},"durationMs":7603,"modelId":"meta/muse-spark-1.3","promptTokens":38169,"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"8533c05b-113f-4e1d-bd04-da179512d45c","sequence":53},"last":{"id":"8533c05b-113f-4e1d-bd04-da179512d45c","sequence":53},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"totalTokens":38832,"turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38169,"outputTokens":663,"reasoningTokens":436},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790704411422,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"75c1e857-db03-45ea-bc69-9c66f590634a","childSessionLogPath":"subagent/75c1e857-db03-45ea-bc69-9c66f590634a/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"0cfc2b21-d637-420a-8a3b-f32640a7a031","kind":"reminderChild","recordedAt":"2026-09-29T17:53:31.422285Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee4c-e31d-75d3-8673-7cb9024888ba","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"0cfc2b21-d637-420a-8a3b-f32640a7a031","sequence":60},"last":{"id":"0cfc2b21-d637-420a-8a3b-f32640a7a031","sequence":60},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417085,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"a9db8dd6-6066-4a8b-a41f-04fdfdefdb1a","fallbackText":"Reminder child session","generationId":1,"itemId":"278bcded-5c29-40a1-b034-152609dd21f2","kind":"reminderChild","recordedAt":"2026-09-29T17:53:37.085045Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee4c-c562-7052-9445-a86270ea242d","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"278bcded-5c29-40a1-b034-152609dd21f2","sequence":35},"last":{"id":"82867c05-0d13-41a5-a5f6-5c907e85d4a6","sequence":62},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417085,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"75c1e857-db03-45ea-bc69-9c66f590634a","childSessionLogPath":"subagent/75c1e857-db03-45ea-bc69-9c66f590634a/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"0cfc2b21-d637-420a-8a3b-f32640a7a031","kind":"reminderChild","recordedAt":"2026-09-29T17:53:37.085573Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee4c-e31d-75d3-8673-7cb9024888ba","turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e"},"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"0cfc2b21-d637-420a-8a3b-f32640a7a031","sequence":60},"last":{"id":"41276a5f-1e51-4b0e-8ff5-cd305e2d3a8b","sequence":63},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417087,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"idle","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417088,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":13283,"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"6b97d3d3-e4e3-4c05-a150-58f4bfcfd494","sequence":69},"last":{"id":"6b97d3d3-e4e3-4c05-a150-58f4bfcfd494","sequence":69},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":5373,"turnId":"01a0ee4c-c559-75de-a972-7a91dbe59a8e","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417088,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","sourceRange":{"first":{"id":"63b58fad-d6e6-4872-8899-802fef5da84a","sequence":70},"last":{"id":"63b58fad-d6e6-4872-8899-802fef5da84a","sequence":70},"stream":{"id":"01a0ee4c-c501-7d50-9020-effa9f9956e1","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:13","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417088,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:53:23.713788Z","firstUserPrompt":"Think through the exact rational sum 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6. Explain how you reduce it to lowest terms. Do not use tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4c-c501-7d50-9020-effa9f9956e1/session.jsonl","providerId":"meta","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"idle","title":"Think through the exact rational sum 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6. Explain how you reduce it to lowest terms. Do not use tools.","turnCount":1,"updatedAt":"2026-09-29T17:53:37.088503Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790704417302,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417302,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"notLoaded","viewCursor":"v:01a0ee4c-c501-7d50-9020-effa9f9956e1:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790704417302,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:53:23.713788Z","firstUserPrompt":"Think through the exact rational sum 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6. Explain how you reduce it to lowest terms. Do not use tools.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee4c-c501-7d50-9020-effa9f9956e1/session.jsonl","providerId":"meta","sessionId":"01a0ee4c-c501-7d50-9020-effa9f9956e1","status":"notLoaded","title":"Think through the exact rational sum 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6. Explain how you reduce it to lowest terms. Do not use tools.","turnCount":1,"updatedAt":"2026-09-29T17:53:37.088503Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/tools-edit.ndjson b/plugins/muse-provider/test/fixtures/tools-edit.ndjson new file mode 100644 index 0000000000..ffbf1a0474 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/tools-edit.ndjson @@ -0,0 +1,48 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee44-d5f5-7f3c-af67-65a9dd4daa28","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","providerId":"meta","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883853,"jsonrpc":"2.0","method":"session/started","params":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:44:43.775629Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7/session.jsonl","providerId":"meta","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:44:43.775633Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"id":2,"jsonrpc":"2.0","result":{"session":{"activeTurnId":null,"approvalMode":{"lastCommandId":null,"mode":"onRequest","source":"startup"},"createdAt":"2026-09-29T17:44:43.775629Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7/session.jsonl","providerId":"meta","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"idle","turnCount":0,"updatedAt":"2026-09-29T17:44:43.775633Z","workspaceRoot":"/tmp/muse-phase0/repo"},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883859,"jsonrpc":"2.0","method":"session/approvalModeChanged","params":{"clientName":"paseo_phase0","commandId":"01a0ee44-d5f5-7f3c-af67-65a9dd4daa28","mode":"onRequest","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","source":"approvalReconfigure","sourceRange":{"first":{"id":"683cb0f0-a3c9-4d42-b63c-3578223e7bc8","sequence":5},"last":{"id":"683cb0f0-a3c9-4d42-b63c-3578223e7bc8","sequence":5},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:1"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"commandId":"01a0ee44-d653-785e-adc8-47d6ec011d01","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","input":[{"type":"text","text":"Use read_file to read f. Then use bash to run wc -l f. Then use edit_file or apply_patch to change beta to gamma in f. Report the result. Use the requested tools rather than explaining how."}],"reasoningEffort":"low"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883862,"jsonrpc":"2.0","method":"session/branchChanged","params":{"branch":"main","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"4bdcc395-645e-46b7-be84-51368193c171","sequence":15},"last":{"id":"4bdcc395-645e-46b7-be84-51368193c171","sequence":15},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"vcs":"git","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:2","workspaceRoot":"/tmp/muse-phase0/repo"}}} +{"dir":"in","msg":{"id":3,"jsonrpc":"2.0","result":{"commandId":"01a0ee44-d653-785e-adc8-47d6ec011d01","disposition":"started","startedNewTurn":true,"status":"accepted","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883870,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"running","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883871,"jsonrpc":"2.0","method":"turn/started","params":{"commandId":"01a0ee44-d653-785e-adc8-47d6ec011d01","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"abb7e5c5-d1ca-4e11-bd29-3c6ff5d8dbed","sequence":17},"last":{"id":"abb7e5c5-d1ca-4e11-bd29-3c6ff5d8dbed","sequence":17},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883871,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"commandId":"01a0ee44-d653-785e-adc8-47d6ec011d01","itemId":"ff708436-2703-4465-aa17-9124f646bf18","kind":"userMessage","recordedAt":"2026-09-29T17:44:43.862842Z","revision":1,"status":"completed","text":"Use read_file to read f. Then use bash to run wc -l f. Then use edit_file or apply_patch to change beta to gamma in f. Report the result. Use the requested tools rather than explaining how.","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"abb7e5c5-d1ca-4e11-bd29-3c6ff5d8dbed","sequence":17},"last":{"id":"abb7e5c5-d1ca-4e11-bd29-3c6ff5d8dbed","sequence":17},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:4"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883871,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"5030ca0e-e58a-4637-9362-565d8540a2f1","fallbackText":"Reminder child session","generationId":1,"itemId":"985bd509-b773-4afa-ba0b-b64c712d0faf","kind":"reminderChild","recordedAt":"2026-09-29T17:44:43.870303Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee44-d65c-7732-9968-9dad2d9d011b","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"985bd509-b773-4afa-ba0b-b64c712d0faf","sequence":35},"last":{"id":"985bd509-b773-4afa-ba0b-b64c712d0faf","sequence":35},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:5"}}} +{"dir":"in","msg":{"emittedAtMs":1790703883874,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","createdAt":"2026-09-29T17:44:43.775629Z","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7/session.jsonl","providerId":"meta","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"running","turnCount":0,"updatedAt":"2026-09-29T17:44:43.870564Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703888257,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":195,"promptTokens":38167,"totalTokens":38362},"durationMs":4383,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38167,"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"a7bcb728-487d-449b-a74d-65ae91e96cc0","sequence":51},"last":{"id":"a7bcb728-487d-449b-a74d-65ae91e96cc0","sequence":51},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"totalTokens":38362,"turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","usage":{"cacheReadTokens":0,"cacheWriteTokens":0,"cachedTokens":0,"inputTokens":38167,"outputTokens":195,"reasoningTokens":118},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:6"}}} +{"dir":"in","msg":{"emittedAtMs":1790703888260,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"path\":\"f\"}","callId":"call_01a0ee44e5c972c4884239d3e1bcbd3a","itemId":"01a0ee44-e782-7200-948a-362a4b67f285","kind":"toolCall","recordedAt":"2026-09-29T17:44:48.260042Z","revision":1,"status":"inProgress","tool":"read_file","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"87892a5b-2955-49e4-8309-390eab4b22bb","sequence":53},"last":{"id":"23208824-203c-4333-8f37-845803185f53","sequence":59},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:7"}}} +{"dir":"in","msg":{"emittedAtMs":1790703888261,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"path\":\"f\"}","callId":"call_01a0ee44e5c972c4884239d3e1bcbd3a","itemId":"01a0ee44-e782-7200-948a-362a4b67f285","kind":"toolCall","recordedAt":"2026-09-29T17:44:48.26126Z","revision":2,"status":"completed","tool":"read_file","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","visibleOutput":"Read text file `f`.\n1|alpha\n2|beta"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"87892a5b-2955-49e4-8309-390eab4b22bb","sequence":53},"last":{"id":"d156c74d-f444-4d33-964e-0a20747b6269","sequence":63},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:8"}}} +{"dir":"in","msg":{"emittedAtMs":1790703891355,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":280,"promptTokens":76571,"totalTokens":76851},"durationMs":3087,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38404,"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"347b7cd4-0568-4fd3-9b66-94fe93d55b97","sequence":82},"last":{"id":"347b7cd4-0568-4fd3-9b66-94fe93d55b97","sequence":82},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"totalTokens":38489,"turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","usage":{"cacheReadTokens":38129,"cacheWriteTokens":0,"cachedTokens":38129,"inputTokens":38404,"outputTokens":85,"reasoningTokens":10},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:9"}}} +{"dir":"in","msg":{"emittedAtMs":1790703891384,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"command\":\"wc -l f\",\"description\":\"Count lines in f\"}","callId":"call_01a0ee44ec9671c6a49f55dfb23d281c","itemId":"01a0ee44-f3b6-73b0-8b51-208d485e3bb1","kind":"toolCall","recordedAt":"2026-09-29T17:44:51.384253Z","revision":1,"status":"inProgress","tool":"bash","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"9217711f-2891-44a6-aa59-672b82cc28dd","sequence":84},"last":{"id":"a88ea66b-2b42-4699-a692-c76225a52c71","sequence":90},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:10"}}} +{"dir":"in","msg":{"emittedAtMs":1790703891596,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"2 f\n","field":"output","itemId":"01a0ee44-f3b6-73b0-8b51-208d485e3bb1","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:10.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703891609,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"command\":\"wc -l f\",\"description\":\"Count lines in f\"}","callId":"call_01a0ee44ec9671c6a49f55dfb23d281c","itemId":"01a0ee44-f3b6-73b0-8b51-208d485e3bb1","kind":"toolCall","recordedAt":"2026-09-29T17:44:51.609218Z","revision":2,"status":"completed","tool":"bash","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","visibleOutput":"2 f\n"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"9217711f-2891-44a6-aa59-672b82cc28dd","sequence":84},"last":{"id":"0750216b-86d9-44cc-80d0-2d625f89607c","sequence":96},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:11"}}} +{"dir":"in","msg":{"emittedAtMs":1790703895007,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":376,"promptTokens":115160,"totalTokens":115536},"durationMs":3390,"finishReason":"tool_calls","modelId":"meta/muse-spark-1.3","promptTokens":38589,"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"dc40a59d-2cb8-4f6c-9205-f94f5932849a","sequence":115},"last":{"id":"dc40a59d-2cb8-4f6c-9205-f94f5932849a","sequence":115},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"totalTokens":38685,"turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","usage":{"cacheReadTokens":38385,"cacheWriteTokens":0,"cachedTokens":38385,"inputTokens":38589,"outputTokens":96,"reasoningTokens":11},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:12"}}} +{"dir":"in","msg":{"emittedAtMs":1790703895010,"jsonrpc":"2.0","method":"item/started","params":{"item":{"args":"{\"find\":\"beta\",\"path\":\"f\",\"replace\":\"gamma\"}","callId":"call_01a0ee44fb02709dab9e9c41d70ac7ed","itemId":"01a0ee45-01e0-7bf1-bd88-cc71f76d61df","kind":"toolCall","recordedAt":"2026-09-29T17:44:55.010008Z","revision":1,"status":"inProgress","tool":"edit_file","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"ee0c7dc8-42e6-44e9-8278-9b39521f1d69","sequence":117},"last":{"id":"8f6f6999-597e-4d8d-9be4-fe3c8dddf814","sequence":123},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:13"}}} +{"dir":"in","msg":{"emittedAtMs":1790703895014,"jsonrpc":"2.0","method":"item/updated","params":{"item":{"args":"{\"find\":\"beta\",\"path\":\"f\",\"replace\":\"gamma\"}","callId":"call_01a0ee44fb02709dab9e9c41d70ac7ed","itemId":"01a0ee45-01e0-7bf1-bd88-cc71f76d61df","kind":"toolCall","patchRef":{"availability":"available","byteLen":146,"id":"tool_patch-01a0ee45-01e0-7bf1-bd88-cc71f76d61df-call_01a0ee44fb02709dab9e9c41d70ac7ed","kind":"tool_patch","mediaType":"application/json","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7/tool-outputs/01a0ee45-01e0-7bf1-bd88-cc71f76d61df/call_01a0ee44fb02709dab9e9c41d70ac7ed-tool_patch.json","uri":"tool-output://local/01a0ee45-01e0-7bf1-bd88-cc71f76d61df/call_01a0ee44fb02709dab9e9c41d70ac7ed-tool_patch.json"},"patchSummary":{"added":1,"files":1,"removed":1},"recordedAt":"2026-09-29T17:44:55.013611Z","revision":2,"status":"inProgress","tool":"edit_file","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"ee0c7dc8-42e6-44e9-8278-9b39521f1d69","sequence":117},"last":{"id":"d1f092a9-296c-4fa0-b2bd-f30acb4be9a4","sequence":126},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:14"}}} +{"dir":"in","msg":{"emittedAtMs":1790703895014,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"args":"{\"find\":\"beta\",\"path\":\"f\",\"replace\":\"gamma\"}","callId":"call_01a0ee44fb02709dab9e9c41d70ac7ed","itemId":"01a0ee45-01e0-7bf1-bd88-cc71f76d61df","kind":"toolCall","patchRef":{"availability":"available","byteLen":146,"id":"tool_patch-01a0ee45-01e0-7bf1-bd88-cc71f76d61df-call_01a0ee44fb02709dab9e9c41d70ac7ed","kind":"tool_patch","mediaType":"application/json","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7/tool-outputs/01a0ee45-01e0-7bf1-bd88-cc71f76d61df/call_01a0ee44fb02709dab9e9c41d70ac7ed-tool_patch.json","uri":"tool-output://local/01a0ee45-01e0-7bf1-bd88-cc71f76d61df/call_01a0ee44fb02709dab9e9c41d70ac7ed-tool_patch.json"},"patchSummary":{"added":1,"files":1,"removed":1},"recordedAt":"2026-09-29T17:44:55.014313Z","revision":3,"status":"completed","tool":"edit_file","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","visibleOutput":"edited\nchanged lines: line 2\n--- original\n+++ updated\n@@\n-beta\n+gamma\n"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"ee0c7dc8-42e6-44e9-8278-9b39521f1d69","sequence":117},"last":{"id":"7137aaae-6f00-4dd7-9e2a-9acc258065c0","sequence":128},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:15"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":4,"method":"item/readOutput","params":{"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","itemId":"01a0ee45-01e0-7bf1-bd88-cc71f76d61df","outputRef":"tool_patch-01a0ee45-01e0-7bf1-bd88-cc71f76d61df-call_01a0ee44fb02709dab9e9c41d70ac7ed"}}} +{"dir":"in","msg":{"id":4,"jsonrpc":"2.0","result":{"byteLen":146,"content":"{\"files\":[{\"hunks\":[{\"lines\":[\" alpha\",\"-beta\",\"+gamma\"],\"newLines\":2,\"newStart\":1,\"oldLines\":2,\"oldStart\":1}],\"path\":\"/tmp/muse-phase0/repo/f\"}]}","encoding":"utf8","eof":true,"mediaType":"application/json","offsetBytes":0}}} +{"dir":"in","msg":{"emittedAtMs":1790703895021,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"5030ca0e-e58a-4637-9362-565d8540a2f1","fallbackText":"Reminder child session","generationId":1,"itemId":"985bd509-b773-4afa-ba0b-b64c712d0faf","kind":"reminderChild","recordedAt":"2026-09-29T17:44:55.016202Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee44-d65c-7732-9968-9dad2d9d011b","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"985bd509-b773-4afa-ba0b-b64c712d0faf","sequence":35},"last":{"id":"e0f8e9f0-ba40-4d69-bbc7-4988a886ba7e","sequence":131},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:16"}}} +{"dir":"in","msg":{"emittedAtMs":1790703895021,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"b36c1604-2739-4a03-a07d-82b4fb168b7d","fallbackText":"Reminder child session","generationId":2,"itemId":"7ef38f5d-2cd7-4687-89e9-feea7e217953","kind":"reminderChild","recordedAt":"2026-09-29T17:44:55.018596Z","reminderAgentId":"skill-reminder","revision":1,"status":"inProgress","taskId":"01a0ee45-01e9-7e92-8620-cdf44b6991f9","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"7ef38f5d-2cd7-4687-89e9-feea7e217953","sequence":140},"last":{"id":"7ef38f5d-2cd7-4687-89e9-feea7e217953","sequence":140},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17"}}} +{"dir":"in","msg":{"emittedAtMs":1790703898911,"jsonrpc":"2.0","method":"item/started","params":{"item":{"itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","kind":"agentMessage","revision":1,"status":"inProgress","text":"","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17.1"}}} +{"dir":"in","msg":{"emittedAtMs":1790703898911,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"Done.","field":"text","itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17.2"}}} +{"dir":"in","msg":{"emittedAtMs":1790703898912,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" `f","field":"text","itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17.3"}}} +{"dir":"in","msg":{"emittedAtMs":1790703898914,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"` had","field":"text","itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17.4"}}} +{"dir":"in","msg":{"emittedAtMs":1790703898915,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" 2 lines;","field":"text","itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17.5"}}} +{"dir":"in","msg":{"emittedAtMs":1790703898915,"jsonrpc":"2.0","method":"item/delta","params":{"delta":" changed line ","field":"text","itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17.6"}}} +{"dir":"in","msg":{"emittedAtMs":1790703898915,"jsonrpc":"2.0","method":"item/delta","params":{"delta":"2 from `beta` to `gamma`.\n","field":"text","itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:17.7"}}} +{"dir":"in","msg":{"emittedAtMs":1790703899040,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"itemId":"26e5b2e9-c43a-405e-95ef-8257bde46f50","kind":"agentMessage","recordedAt":"2026-09-29T17:44:59.040413Z","revision":2,"status":"completed","text":"Done. `f` had 2 lines; changed line 2 from `beta` to `gamma`.\n","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"2b1e63fb-20a2-418f-8c98-1daa937716ff","sequence":153},"last":{"id":"2b1e63fb-20a2-418f-8c98-1daa937716ff","sequence":153},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:18"}}} +{"dir":"in","msg":{"emittedAtMs":1790703899043,"jsonrpc":"2.0","method":"session/tokenUsage","params":{"cumulative":{"outputTokens":411,"promptTokens":153895,"totalTokens":154306},"durationMs":4020,"modelId":"meta/muse-spark-1.3","promptTokens":38735,"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"2ccdeaa2-2479-4caf-a4ef-2fe922495ce7","sequence":156},"last":{"id":"2ccdeaa2-2479-4caf-a4ef-2fe922495ce7","sequence":156},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"totalTokens":38770,"turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","usage":{"cacheReadTokens":38513,"cacheWriteTokens":0,"cachedTokens":38513,"inputTokens":38735,"outputTokens":35,"reasoningTokens":3},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:19"}}} +{"dir":"in","msg":{"emittedAtMs":1790703899045,"jsonrpc":"2.0","method":"item/started","params":{"item":{"childSessionId":"b201e8a1-b697-4956-b1a7-9310a260252f","childSessionLogPath":"subagent/b201e8a1-b697-4956-b1a7-9310a260252f/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"dd0891c7-01b5-452a-bac2-6f85575fee74","kind":"reminderChild","recordedAt":"2026-09-29T17:44:59.045654Z","reminderAgentId":"verify-reminder","revision":1,"status":"inProgress","taskId":"01a0ee45-11a4-7f53-8ade-12c0fc9f640e","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"dd0891c7-01b5-452a-bac2-6f85575fee74","sequence":163},"last":{"id":"dd0891c7-01b5-452a-bac2-6f85575fee74","sequence":163},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:20"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909058,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"b36c1604-2739-4a03-a07d-82b4fb168b7d","fallbackText":"Reminder child session","generationId":2,"itemId":"7ef38f5d-2cd7-4687-89e9-feea7e217953","kind":"reminderChild","recordedAt":"2026-09-29T17:45:09.058336Z","reminderAgentId":"skill-reminder","revision":2,"status":"completed","taskId":"01a0ee45-01e9-7e92-8620-cdf44b6991f9","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"7ef38f5d-2cd7-4687-89e9-feea7e217953","sequence":140},"last":{"id":"553a6f63-835e-4e0b-b9ec-a1c72ec585ae","sequence":165},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:21"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909058,"jsonrpc":"2.0","method":"item/completed","params":{"item":{"childSessionId":"b201e8a1-b697-4956-b1a7-9310a260252f","childSessionLogPath":"subagent/b201e8a1-b697-4956-b1a7-9310a260252f/session.jsonl","fallbackText":"Reminder child session","generationId":1,"itemId":"dd0891c7-01b5-452a-bac2-6f85575fee74","kind":"reminderChild","recordedAt":"2026-09-29T17:45:09.058728Z","reminderAgentId":"verify-reminder","revision":2,"status":"completed","taskId":"01a0ee45-11a4-7f53-8ade-12c0fc9f640e","turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01"},"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"dd0891c7-01b5-452a-bac2-6f85575fee74","sequence":163},"last":{"id":"10879eda-a61a-464c-a90a-63739193e835","sequence":166},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:22"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909060,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"idle","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909061,"jsonrpc":"2.0","method":"turn/completed","params":{"durationMs":25197,"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","sourceRange":{"first":{"id":"ab6af672-ea4d-4220-b826-7fcbacdaca74","sequence":172},"last":{"id":"ab6af672-ea4d-4220-b826-7fcbacdaca74","sequence":172},"stream":{"id":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","kind":"session"}},"terminal":"completed","timeToFirstTokenMs":15049,"turnId":"01a0ee44-d653-785e-adc8-47d6ec011d01","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:23"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909062,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:44:43.773195Z","firstUserPrompt":"Use read_file to read f. Then use bash to run wc -l f. Then use edit_file or apply_patch to change beta to gamma in f. Report the result. Use the requested tools rather than explaining how.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7/session.jsonl","providerId":"meta","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"idle","title":"Use read_file to read f. Then use bash to run wc -l f. Then use edit_file or apply_patch to change beta to gamma in f. Report the result. Use the requested tools rather than explaining how.","turnCount":1,"updatedAt":"2026-09-29T17:45:09.060175Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} +{"dir":"in","msg":{"emittedAtMs":1790703909275,"jsonrpc":"2.0","method":"session/closed","params":{"reason":"hostShutdown","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:24"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909275,"jsonrpc":"2.0","method":"session/statusChanged","params":{"sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"notLoaded","viewCursor":"v:01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7:24"}}} +{"dir":"in","msg":{"emittedAtMs":1790703909275,"jsonrpc":"2.0","method":"session/listChanged","params":{"session":{"activeTurnId":null,"branch":"main","createdAt":"2026-09-29T17:44:43.773195Z","firstUserPrompt":"Use read_file to read f. Then use bash to run wc -l f. Then use edit_file or apply_patch to change beta to gamma in f. Report the result. Use the requested tools rather than explaining how.","forkedFrom":null,"modelId":"meta/muse-spark-1.3","path":"/tmp/muse-phase0/data/muse/sessions/2026/09/29/01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7/session.jsonl","providerId":"meta","sessionId":"01a0ee44-d5fc-73a0-8cf8-14a3faa5b4d7","status":"notLoaded","title":"Use read_file to read f. Then use bash to run wc -l f. Then use edit_file or apply_patch to change beta to gamma in f. Report the result. Use the requested tools rather than explaining how.","turnCount":1,"updatedAt":"2026-09-29T17:45:09.061536Z","workspaceRoot":"/tmp/muse-phase0/repo"}}}} diff --git a/plugins/muse-provider/test/fixtures/unsafe-path.ndjson b/plugins/muse-provider/test/fixtures/unsafe-path.ndjson new file mode 100644 index 0000000000..39cf6d7470 --- /dev/null +++ b/plugins/muse-provider/test/fixtures/unsafe-path.ndjson @@ -0,0 +1,5 @@ +{"dir":"out","msg":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"paseo_phase0","version":"0.0.0"},"capabilities":{"experimentalApi":true,"requestedCapabilities":["sessionMcp","sessionListStream"]}}}} +{"dir":"in","msg":{"id":1,"jsonrpc":"2.0","result":{"experimentalApi":true,"grantedCapabilities":["sessionMcp","sessionListStream"],"museHome":"/tmp/muse-phase0/unsafe-data/muse","platformFamily":"unix","platformOs":"linux","schema":{"fingerprint":"sha256:e0e163db6ccf00dbe68402ce55d6319b3edc33c421f31e9583b587b2de8a118f","version":1},"serverInfo":{"name":"muse","version":"1.4.1"},"sessionDurability":"durable","userAgent":"muse-build/1.4.1 (non-interactive; linux-x86_64; build 35815c253477406321e3f5595195becc25e3907a)"}}} +{"dir":"out","msg":{"jsonrpc":"2.0","method":"initialized","params":{}}} +{"dir":"out","msg":{"jsonrpc":"2.0","id":2,"method":"session/start","params":{"commandId":"01a0ee48-f86c-7ea7-ac90-917475456565","workspaceRoot":"/tmp/muse-phase0/repo","modelId":"meta/muse-spark-1.3","approvalMode":"onRequest"}}} +{"dir":"in","msg":{"error":{"code":-32603,"data":{"commandId":"01a0ee48-f86c-7ea7-ac90-917475456565","kind":"internal"},"message":"session/start: read surviving deletion authority: deletion registry authority is unavailable: UnsafePath"},"id":2,"jsonrpc":"2.0"}} diff --git a/plugins/muse-provider/test/provider.test.ts b/plugins/muse-provider/test/provider.test.ts new file mode 100644 index 0000000000..6c060fbfdb --- /dev/null +++ b/plugins/muse-provider/test/provider.test.ts @@ -0,0 +1,1268 @@ +import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { setTimeout as delay } from "node:timers/promises"; +import os from "node:os"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { afterEach, expect, test, vi } from "vitest"; +import { + PROVIDER_CAPABILITIES, + ProviderEventSchema, + type ProviderConnection, + type ProviderEvent, + type ProviderRegistration, + type ProviderLaunch, + type ProviderInput, +} from "@getpaseo/plugin/server/provider"; +import { settingsSchema } from "../shared/settings.js"; +import type { UsageSourceRegistration } from "@getpaseo/plugin/server"; +import contribute from "../index.server.js"; + +const connections: ProviderConnection[] = []; +const roots: string[] = []; +afterEach(async () => { + vi.useRealTimers(); + await Promise.all(connections.splice(0).map((connection) => connection.close())); + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); +}); +function registration( + readSettings = () => settingsSchema.parse({}), + registerUsageSource = (_source: UsageSourceRegistration) => {}, +): ProviderRegistration { + let provider: ProviderRegistration | undefined; + const server = { + registerSettings() { + return { + read: async () => ({ + status: "ready" as const, + revision: "1", + values: readSettings(), + }), + subscribe: () => () => {}, + }; + }, + registerUsageSource, + registerProvider(value: ProviderRegistration) { + provider = value; + }, + }; + contribute(server); + if (!provider) throw new Error("Provider was not registered"); + return provider; +} +async function harness(scenario = "text-reasoning", env: Record = {}) { + const root = await mkdtemp(path.join(os.tmpdir(), "muse-provider-test-")); + roots.push(root); + const requests = path.join(root, "requests.ndjson"); + const launch: ProviderLaunch = { + command: process.execPath, + args: [fileURLToPath(new URL("./fake-muse.mjs", import.meta.url))], + env: { MUSE_TEST_SCENARIO: scenario, MUSE_TEST_REQUESTS: requests, ...env }, + }; + await writeFile(requests, ""); + let settings = settingsSchema.parse({}); + let usageSource!: UsageSourceRegistration; + const provider = registration( + () => settings, + (source) => { + usageSource = source; + }, + ); + const connection = await provider.connect({ + launch, + versions: [1], + capabilities: PROVIDER_CAPABILITIES, + }); + connections.push(connection); + const events: ProviderEvent[] = []; + connection.onEvent((event) => { + events.push(ProviderEventSchema.parse(event)); + }); + async function wait( + predicate: (event: ProviderEvent) => boolean, + from = 0, + ): Promise { + for (let count = 0; count < 200; count++) { + const event = events.slice(from).find(predicate); + if (event) return event; + await delay(10); + } + throw new Error(`Missing event; received ${JSON.stringify(events)}`); + } + async function send(input: ProviderInput) { + const from = events.length; + await connection.send(input); + return from; + } + async function open( + persistence?: Extract["persistence"], + mode = "onRequest", + ) { + await send({ + type: "session.open", + requestId: "open", + sessionId: "paseo-session", + config: { + cwd: root, + env: {}, + settings: {}, + mcpServers: {}, + persist: true, + mode, + model: "meta/muse-spark-1.3", + thinkingOption: "high", + systemPrompt: "Test instructions", + }, + persistence, + history: "replay", + }); + return wait((event) => event.type === "session.ready" || event.type === "request.failed"); + } + async function prompt(delivery: "auto" | "steer" = "auto", image = false) { + return send({ + type: "session.prompt", + sessionId: "paseo-session", + prompt: { + clientMessageId: `client-${events.length}`, + delivery, + input: { + type: "message", + content: image + ? [ + { type: "text", text: "hello" }, + { type: "image", mimeType: "image/png", data: "image-bytes" }, + ] + : [{ type: "text", text: "hello" }], + }, + }, + }); + } + async function recorded() { + return (await readFile(requests, "utf8")) + .trim() + .split("\n") + .filter(Boolean) + .map((line) => JSON.parse(line)); + } + return { + provider, + launch, + connection, + events, + wait, + send, + open, + prompt, + recorded, + root, + usageSource, + setSettings: (values: unknown) => { + settings = settingsSchema.parse(values); + }, + }; +} + +test("registration exposes Muse with a daemon-resolved command", () => { + expect(registration()).toMatchObject({ + id: "muse", + label: "Muse Code", + command: ["muse"], + icon: "icon.svg", + }); +}); +test("catalog uses model effort variants, modes, and bounded cached discovery", async () => { + const h = await harness("catalog-controls"); + await h.send({ type: "catalog", requestId: "catalog-1" }); + const catalogEvent = await h.wait((candidate) => candidate.type === "catalog"); + expect(catalogEvent).toMatchObject({ + catalog: { + models: [ + { + id: "meta/muse-spark-1.3", + label: "meta/muse-spark-1.3", + defaultThinkingOptionId: "high", + thinkingOptions: [ + { id: "minimal" }, + { id: "low" }, + { id: "medium" }, + { id: "high" }, + { id: "xhigh" }, + ], + }, + ], + defaultMode: "onRequest", + modes: [ + { id: "onRequest" }, + { id: "promptUnmatched" }, + { id: "denyUnmatched" }, + { id: "allowAll", isUnattended: true }, + ], + }, + }); + await h.send({ type: "catalog", requestId: "catalog-2" }); + await h.wait((event) => event.type === "catalog" && event.requestId === "catalog-2"); + expect((await h.recorded()).filter((frame) => frame.method === "model/list")).toHaveLength(1); +}); +test("text and reasoning stream, completion overwrites deltas, user echo retains client identity", async () => { + const h = await harness(); + expect(await h.open()).toMatchObject({ type: "session.ready" }); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect(h.events).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ type: "reasoning" }), + }), + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + type: "user_message", + clientMessageId: expect.stringMatching(/^client-/), + }), + }), + ]), + ); + const frames = await h.recorded(); + expect(frames.find((frame) => frame.method === "turn/start").params).toMatchObject({ + ifBusy: "queue", + reasoningEffort: "high", + displayText: "hello", + input: [ + { type: "text", text: "\nTest instructions\n" }, + { type: "text", text: "hello" }, + ], + }); + expect(h.events.filter((event) => event.type === "session.persistence").length).toBeGreaterThan( + 1, + ); +}); +test("tool calls classify read, shell, and edit with fetched JSON patch converted to unified diff", async () => { + const h = await harness("tools-edit"); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect(h.events).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + detail: expect.objectContaining({ type: "read", filePath: "f" }), + }), + }), + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + detail: expect.objectContaining({ type: "shell", command: "wc -l f", output: "2 f\n" }), + }), + }), + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + detail: expect.objectContaining({ + type: "edit", + unifiedDiff: expect.stringContaining("@@ -1,2 +1,2 @@\n alpha\n-beta\n+gamma\n"), + }), + }), + }), + ]), + ); +}); + +test("multi-stage approvals surface Stage 2 then Stage 3 and send the current requirement guard", async () => { + const h = await harness("multi-stage-approval"); + await h.open(); + await h.prompt(); + const first = await h.wait((event) => event.type === "session.permission"); + expect(first).toMatchObject({ + request: { + title: "Stage 2 of 3", + detail: { type: "shell", command: "rm -rf f" }, + actions: [ + { id: "allow_once", behavior: "allow" }, + { id: "allow_local_prefix", behavior: "allow" }, + { id: "abort", behavior: "deny" }, + ], + }, + }); + if (first.type !== "session.permission") throw new Error("Expected approval"); + const from = await h.send({ + type: "session.permission", + sessionId: "paseo-session", + permissionId: first.request.id, + response: { behavior: "allow", selectedActionId: first.request.actions![0]!.id }, + }); + const second = await h.wait((event) => event.type === "session.permission", from); + expect(second).toMatchObject({ + request: { title: "Stage 3 of 3", detail: { command: "rm -rf g" } }, + }); + await h.send({ + type: "session.permission", + sessionId: "paseo-session", + permissionId: first.request.id, + response: { behavior: "allow", selectedActionId: first.request.actions![0]!.id }, + }); + await h.wait((event) => event.type === "session.permission_resolved"); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect( + (await h.recorded()) + .filter((frame) => frame.method === "approval/decide") + .map((frame) => frame.params.requirementId.sourceIndex), + ).toEqual([1, 2]); +}); +test("Full access automatically answers every escalated stage with the published allow-once choice", async () => { + const h = await harness("multi-stage-approval"); + await h.open(undefined, "allowAll"); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect(h.events.filter((event) => event.type === "session.permission")).toEqual([]); + expect( + (await h.recorded()) + .filter((frame) => frame.method === "approval/decide") + .map((frame) => frame.params.choiceId), + ).toEqual(["allow_once", "allow_once"]); +}); +test("interrupt awaits cancelled terminal and reconciles the tool", async () => { + const h = await harness("interrupt"); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.prompt_result"); + await h.send({ type: "session.interrupt", sessionId: "paseo-session", requestId: "interrupt" }); + await h.wait((event) => event.type === "request.completed" && event.requestId === "interrupt"); + const terminalIndex = h.events.findIndex( + (event) => event.type === "session.turn" && event.state === "canceled", + ); + expect(terminalIndex).toBeGreaterThan(-1); + expect( + h.events.findIndex( + (event) => event.type === "request.completed" && event.requestId === "interrupt", + ), + ).toBeGreaterThan(terminalIndex); +}); +for (const cursor of [undefined, "v:old:7"]) { + test(`resume ${cursor ? "with cursor emits suffix and ignores old terminal" : "without cursor replays inline history"}`, async () => { + const h = await harness(cursor ? "resume-with-cursor" : "resume-without-cursor"); + await h.open({ + version: 1, + data: { sessionId: "saved-session", ...(cursor ? { cursor } : {}) }, + }); + expect(h.events.filter((event) => event.type === "session.turn")).toEqual([]); + const history = h.events.filter((event) => event.type === "timeline.item"); + if (!cursor) + expect(history).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + item: expect.objectContaining({ type: "assistant_message", text: "RESUME_MARKER_OK" }), + }), + ]), + ); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect( + h.events.filter((event) => event.type === "session.turn" && event.state === "completed"), + ).toHaveLength(1); + expect( + (await h.recorded()).find((frame) => frame.method === "session/resume").params, + ).toMatchObject({ sessionId: "saved-session", ...(cursor ? { cursor } : {}) }); + }); +} +test("steer sends ifBusy steer and joins the running turn", async () => { + const h = await harness("steer"); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.prompt_result"); + const from = await h.prompt("steer"); + expect(await h.wait((event) => event.type === "session.prompt_result", from)).toMatchObject({ + result: { type: "steer" }, + }); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect( + (await h.recorded()).filter((frame) => frame.method === "turn/start")[1].params.ifBusy, + ).toBe("steer"); +}); +test("image turn sends a native image and the subsequent text turn succeeds", async () => { + const h = await harness("image-followup"); + await h.open(); + await h.prompt("auto", true); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + const from = await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed", from); + const turns = (await h.recorded()).filter((frame) => frame.method === "turn/start"); + expect(turns[0].params.input).toContainEqual({ + type: "image", + mediaType: "image/png", + base64Data: "image-bytes", + }); + expect(turns[1].params.input).toEqual([{ type: "text", text: "hello" }]); +}); +for (const source of ["live", "history", "backfill"]) { + test(`reminder housekeeping emits no timeline items or child sessions from ${source}`, async () => { + const scenario = source === "history" ? "resume-without-cursor" : "text-reasoning"; + const frames = ( + await readFile(new URL(`./fixtures/${scenario}.ndjson`, import.meta.url), "utf8") + ) + .trim() + .split("\n") + .map((line) => JSON.parse(line)); + const reminderIds = new Set( + frames + .flatMap(({ msg }) => + msg.params?.item ? [msg.params.item] : (msg.result?.history?.items ?? []), + ) + .filter((item) => item?.kind === "reminderChild") + .map((item) => item.itemId), + ); + expect(reminderIds.size).toBeGreaterThan(0); + const h = await harness(scenario, source === "backfill" ? { MUSE_TEST_GAP: "1" } : {}); + await h.open( + source === "history" ? { version: 1, data: { sessionId: "saved-session" } } : undefined, + ); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect( + h.events.filter((event) => event.type === "timeline.item" && reminderIds.has(event.item.id)), + ).toEqual([]); + expect( + h.events.filter((event) => event.type === "session.opened").map((event) => event.sessionId), + ).toEqual(["paseo-session"]); + expect((await h.recorded()).filter((frame) => frame.method === "session/read")).toEqual([]); + }); +} +for (const [scenario, code, guidance] of [ + ["auto-review-unavailable", "defaultProfileUnavailable", "permissions.default_profile"], + ["unsafe-path", "unsafePath", path.join("/test-data", "muse")], +]) { + test(`${scenario} is a typed actionable construction error`, async () => { + const h = await harness(scenario, { XDG_DATA_HOME: "/test-data" }); + expect(await h.open()).toMatchObject({ + type: "request.failed", + error: { code, message: expect.stringContaining(guidance!) }, + }); + }); +} +for (const [code, kind] of [ + [0, "cleanExit"], + [2, "usage"], + [3, "credentials"], + [4, "leaseHeld"], + [5, "surfaceOff"], + [17, "crash"], +]) { + test(`exit ${code} is classified ${kind} with stderr diagnostics`, async () => { + const h = await harness("text-reasoning", { MUSE_TEST_EXIT: String(code) }); + expect(await h.open()).toMatchObject({ + type: "request.failed", + error: { code: kind, message: expect.stringContaining("diagnostic tail, not protocol") }, + }); + }); +} +for (const [env, expected] of [ + [ + { MUSE_TEST_VERSION: "1.2.9" }, + { available: false, diagnostic: "Update Muse Code: found 1.2.9, need ≥1.3.0" }, + ], + [ + { MUSE_TEST_ACCOUNT: "loggedOut" }, + { available: false, diagnostic: "Run `muse login` or set META_API_KEY" }, + ], + [{ MUSE_TEST_ACCOUNT: "envKey" }, { available: true }], + [{ MUSE_TEST_ACCOUNT: "apiKey" }, { available: true }], + [{ MUSE_TEST_ACCOUNT: "accountLogin" }, { available: true }], +] as const) { + test(`status checks version and credential state ${JSON.stringify(env)}`, async () => { + const h = await harness("catalog-controls", env); + expect(await h.provider.status!({ launch: h.launch })).toEqual(expected); + }); +} +test("status reports a missing executable", async () => { + const h = await harness(); + expect( + await h.provider.status!({ launch: { ...h.launch, command: "/missing/muse" } }), + ).toMatchObject({ available: false, diagnostic: expect.stringContaining("ENOENT") }); +}); +test("overloaded retry reuses UUIDv7 commandId", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_RETRY: "turn/start" }); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + const turns = (await h.recorded()).filter((frame) => frame.method === "turn/start"); + expect(turns).toHaveLength(2); + expect(turns[0].params.commandId).toBe(turns[1].params.commandId); +}); +test("missing saved session refuses to start fresh", async () => { + const h = await harness("resume-without-cursor", { MUSE_TEST_GONE: "1" }); + expect(await h.open({ version: 1, data: { sessionId: "gone" } })).toMatchObject({ + type: "request.failed", + error: { + code: "sessionNotFound", + message: "This Muse session no longer exists. Create a new agent.", + }, + }); + expect((await h.recorded()).filter((frame) => frame.method === "session/start")).toEqual([]); +}); +test("empty resume viewCursor is a typed error", async () => { + const h = await harness("resume-without-cursor", { MUSE_TEST_EMPTY_CURSOR: "1" }); + expect(await h.open({ version: 1, data: { sessionId: "saved" } })).toMatchObject({ + type: "request.failed", + error: { code: "emptyViewCursor" }, + }); +}); +test("catalogue identity includes command and routing credentials without exposing them", async () => { + const h = await harness(); + const first = await h.provider.getCatalogCacheKey!({ scope: "global", launch: h.launch }); + const second = await h.provider.getCatalogCacheKey!({ + scope: "global", + launch: { ...h.launch, env: { ...h.launch.env, META_API_KEY: "secret" } }, + }); + expect(first).not.toBe(second); + expect(second).not.toContain("secret"); +}); + +test("configure reports the effective model, approval mode, and per-turn effort", async () => { + const h = await harness("catalog-controls"); + await h.open(); + const from = await h.send({ + type: "session.configure", + requestId: "configure", + sessionId: "paseo-session", + changes: { model: "meta/muse-spark-1.3", mode: "promptUnmatched", thinkingOption: "low" }, + }); + await h.wait((event) => event.type === "request.completed" && event.requestId === "configure"); + expect(h.events.slice(from)).toContainEqual( + expect.objectContaining({ + type: "session.config", + config: expect.objectContaining({ + model: "meta/muse-spark-1.3", + mode: "promptUnmatched", + thinkingOption: "low", + models: [expect.objectContaining({ id: "meta/muse-spark-1.3" })], + }), + }), + ); +}); +test("CLI-style allow response selects a published allow action without a supplied id", async () => { + const h = await harness("staged-approval"); + await h.open(); + await h.prompt(); + const permissionEvent = await h.wait((candidate) => candidate.type === "session.permission"); + if (permissionEvent.type !== "session.permission") throw new Error("Expected approval"); + await h.send({ + type: "session.permission", + sessionId: "paseo-session", + permissionId: permissionEvent.request.id, + response: { behavior: "allow" }, + }); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect( + (await h.recorded()).find((frame) => frame.method === "approval/decide").params.choiceId, + ).toBe("allow_once"); +}); +test("closing cancels a catalogue host instead of waiting for a stalled request", async () => { + const h = await harness("catalog-controls", { MUSE_TEST_HANG: "model/list" }); + await h.send({ type: "catalog", requestId: "catalog" }); + await expect + .poll(async () => (await h.recorded()).some((frame) => frame.method === "model/list")) + .toBe(true); + await h.connection.close(); + expect(h.events.filter((event) => event.type === "catalog")).toEqual([]); + expect(await h.recorded()).toContainEqual({ event: "hostClosed" }); +}); + +for (const retryKind of ["overloaded", "backpressured"]) { + test(`${retryKind} session construction retries with the same UUIDv7`, async () => { + const h = await harness("text-reasoning", { + MUSE_TEST_RETRY: "session/start", + MUSE_TEST_RETRY_KIND: retryKind, + }); + expect(await h.open()).toMatchObject({ type: "session.ready" }); + const attempts = (await h.recorded()).filter((frame) => frame.method === "session/start"); + expect(attempts).toHaveLength(2); + expect(attempts[0].params.commandId).toBe(attempts[1].params.commandId); + }); +} +test("higher-revision item completion replaces streamed text and ignores stale snapshots", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_STALE: "1" }); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + const assistant = h.events.filter( + (event) => event.type === "timeline.item" && event.item.type === "assistant_message", + ); + expect(assistant.length).toBeGreaterThan(2); + expect(assistant.at(-1)).toMatchObject({ + item: { text: expect.stringContaining("`147/60 = 49/20`") }, + }); + expect(assistant).not.toContainEqual( + expect.objectContaining({ item: expect.objectContaining({ text: "STALE_REVISION" }) }), + ); + expect(h.events).toContainEqual( + expect.objectContaining({ + type: "timeline.item", + item: { + type: "reasoning", + id: "f3c7d3fc-1644-46c3-b63c-74e0c7dee6c3", + text: "Computing the rational sum by finding a common denominator and reducing the fraction to lowest terms via gcd.", + }, + }), + ); +}); +test("ordinary subagent tool calls render sub_agent details without inventing child identity", async () => { + const h = await harness("subagent"); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect(h.events).toContainEqual( + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + name: "subagent_read_result", + status: "completed", + detail: expect.objectContaining({ + type: "sub_agent", + log: expect.stringContaining("SUBAGENT_PHASE0_OK"), + }), + }), + }), + ); +}); +for (const [variants, reasoningEffortVariants, expected] of [ + [["low", "high"], ["medium"], ["medium"]], + [["low", "high"], "unknown", ["low", "high"]], + [[], [], ["minimal", "low", "medium", "high", "xhigh", "max", "ultra"]], +] as const) { + test(`catalogue effort discovery ${JSON.stringify(reasoningEffortVariants)} with variants ${JSON.stringify(variants)}`, async () => { + const model = { + modelId: "test-model", + providerId: "meta", + displayLabel: "Test model", + contextLimit: 123456, + isDefault: true, + variants, + reasoningEffortVariants, + defaultReasoningEffort: "high", + }; + const h = await harness("catalog-controls", { MUSE_TEST_MODELS: JSON.stringify([model]) }); + await h.send({ type: "catalog", requestId: "models" }); + const result = await h.wait((event) => event.type === "catalog"); + expect(result).toMatchObject({ + catalog: { + defaultModel: "test-model", + models: [ + { contextWindowMaxTokens: 123456, thinkingOptions: expected.map((id) => ({ id })) }, + ], + }, + }); + }); +} +test("status accepts future credential states and drains its maintenance host", async () => { + const h = await harness("catalog-controls", { MUSE_TEST_ACCOUNT: "futureCredential" }); + expect(await h.provider.status!({ launch: h.launch })).toEqual({ available: true }); + expect(await h.recorded()).toContainEqual({ event: "hostClosed" }); +}); + +for (const [tool, detail] of [ + ["grep", "search"], + ["glob", "search"], + ["ls", "search"], + ["web_search", "search"], + ["web_fetch", "fetch"], + ["custom_tool", "unknown"], +]) { + test(`${tool} tool calls use ${detail} detail`, async () => { + const h = await harness("tools-edit", { MUSE_TEST_TOOL: tool! }); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect(h.events).toContainEqual( + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + name: tool, + status: "completed", + detail: expect.objectContaining({ type: detail }), + }), + }), + ); + }); +} +test("a future item kind uses fallbackText without breaking turn completion", async () => { + const h = await harness("tools-edit", { MUSE_TEST_UNKNOWN_KIND: "1" }); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.turn" && event.state === "completed"); + expect(h.events).toContainEqual( + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + name: "futureItem", + detail: { type: "plain_text", label: "futureItem", text: "New MSP item" }, + }), + }), + ); +}); +test("fingerprint mismatch is logged but does not prevent opening", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_FINGERPRINT: "sha256:unverified" }); + expect(await h.open()).toMatchObject({ type: "session.ready" }); +}); +for (const restoring of [false, true]) { + test(`MCP servers map to MSP stdio and streamableHttp on ${restoring ? "resume" : "start"}`, async () => { + const h = await harness(restoring ? "resume-with-cursor" : "text-reasoning"); + await h.send({ + type: "session.open", + sessionId: "paseo-session", + requestId: "mcp", + persistence: restoring + ? { version: 1, data: { sessionId: "saved-session", cursor: "v:old:7" } } + : undefined, + history: "replay", + config: { + cwd: h.root, + env: {}, + persist: true, + settings: {}, + mcpServers: { + stdio: { + type: "stdio", + command: "test-server", + args: ["--serve"], + env: { TEST_ENV: "yes" }, + }, + paseo: { + type: "http", + url: "http://localhost/mcp/agents", + headers: { Authorization: "Bearer test-token" }, + }, + }, + }, + }); + await h.wait((event) => event.type === "session.ready"); + expect( + (await h.recorded()).find( + (frame) => frame.method === (restoring ? "session/resume" : "session/start"), + ).params.config.mcpServers, + ).toEqual({ + stdio: { + transport: "stdio", + command: "test-server", + args: ["--serve"], + env: { TEST_ENV: "yes" }, + framing: "lineDelimitedJson", + }, + paseo: { + transport: "streamableHttp", + url: "http://localhost/mcp/agents", + headers: { Authorization: "Bearer test-token" }, + }, + }); + }); +} + +test("authRequired turn errors retain their kind and explain login recovery", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_AUTH_REQUIRED: "1" }); + await h.open(); + await h.prompt(); + expect( + await h.wait((event) => event.type === "session.turn" && event.state === "failed"), + ).toMatchObject({ + error: { code: "authRequired", message: "Run `muse login` or set META_API_KEY." }, + }); +}); +test("status bounds a stalled account read and closes the host", async () => { + const h = await harness("catalog-controls", { MUSE_TEST_HANG: "account/read" }); + expect(await h.provider.status!({ launch: h.launch })).toEqual({ + available: false, + diagnostic: "Muse account/read timed out", + }); + expect(await h.recorded()).toContainEqual({ event: "hostClosed" }); +}); + +test("interrupt targets the running turn when another prompt is queued", async () => { + const h = await harness("interrupt", { MUSE_TEST_QUEUE: "1" }); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.prompt_result"); + const from = await h.prompt(); + await h.wait((event) => event.type === "session.prompt_result", from); + await h.send({ + type: "session.interrupt", + sessionId: "paseo-session", + requestId: "interrupt-queued", + }); + await h.wait( + (event) => event.type === "request.completed" && event.requestId === "interrupt-queued", + ); + const requests = await h.recorded(); + const active = requests.find((frame) => frame.method === "turn/start"); + expect(requests.find((frame) => frame.method === "turn/interrupt").params.turnId).toBe( + active.params.commandId, + ); +}); + +for (const terminal of ["completed", "failed"]) { + test(`interrupt resolves when its targeted turn independently ends ${terminal}`, async () => { + const h = await harness("interrupt", { MUSE_TEST_INTERRUPT_TERMINAL: terminal }); + await h.open(); + await h.prompt(); + await h.wait((event) => event.type === "session.prompt_result"); + await h.send({ + type: "session.interrupt", + sessionId: "paseo-session", + requestId: "racing-interrupt", + }); + await h.wait((event) => event.type === "session.turn" && event.state === terminal); + await h.wait( + (event) => event.type === "request.completed" && event.requestId === "racing-interrupt", + ); + expect(h.events.filter((event) => event.type === "request.failed")).toEqual([]); + }); +} +for (const [behavior, choiceId] of [ + ["allow", "allow_once"], + ["deny", "abort"], +] as const) { + test(`CLI ${behavior} prefers the plain once choice over a broader fixture grant`, async () => { + const h = await harness("staged-approval", { MUSE_TEST_CHOICES: "reverse" }); + await h.open(); + await h.prompt(); + const permission = await h.wait((event) => event.type === "session.permission"); + if (permission.type !== "session.permission") throw new Error("Expected permission"); + await h.send({ + type: "session.permission", + sessionId: "paseo-session", + permissionId: permission.request.id, + response: { behavior }, + }); + await expect + .poll( + async () => + (await h.recorded()).find((frame) => frame.method === "approval/decide")?.params.choiceId, + ) + .toBe(choiceId); + }); +} + +test("CLI deny rejects a tool without aborting when denied/once is offered", async () => { + const h = await harness("staged-approval", { MUSE_TEST_DENIED: "1" }); + await h.open(); + await h.prompt(); + const permission = await h.wait((event) => event.type === "session.permission"); + if (permission.type !== "session.permission") throw new Error("Expected permission"); + await h.send({ + type: "session.permission", + sessionId: "paseo-session", + permissionId: permission.request.id, + response: { behavior: "deny" }, + }); + await expect + .poll( + async () => + (await h.recorded()).find((frame) => frame.method === "approval/decide")?.params.choiceId, + ) + .toBe("reject_once"); +}); + +test("skills publish commands and command prompts submit structured skill parts", async () => { + const h = await harness("skill"); + await h.open(); + expect(await h.wait((e) => e.type === "session.commands")).toMatchObject({ + commands: expect.arrayContaining([ + expect.objectContaining({ name: "phase0", description: expect.any(String) }), + expect.objectContaining({ name: "compact", description: expect.any(String) }), + ]), + }); + await h.send({ + type: "session.prompt", + sessionId: "paseo-session", + prompt: { + clientMessageId: "skill-client", + delivery: "auto", + input: { type: "command", name: "phase0", arguments: "argument text" }, + }, + }); + await h.wait((e) => e.type === "session.turn" && e.state === "completed"); + expect((await h.recorded()).find((f) => f.method === "turn/start").params).toMatchObject({ + input: expect.arrayContaining([ + { type: "skill", selector: "phase0", arguments: "argument text" }, + ]), + displayText: "/phase0 argument text", + }); +}); + +test("skill changes refresh the session command catalog", async () => { + const h = await harness("skill", { MUSE_TEST_SKILLS_CHANGED: "1" }); + await h.open(); + const from = await h.prompt(); + expect(await h.wait((e) => e.type === "session.commands", from)).toMatchObject({ + commands: [{ name: "compact", description: "Compact conversation context" }], + }); + expect((await h.recorded()).filter((f) => f.method === "skill/list")).toHaveLength(2); +}); +for (const mode of ["answer", "cancel"] as const) { + test(`todo and question ${mode} replay through the provider interface`, async () => { + const h = await harness(mode === "answer" ? "phase3-controls" : "phase3-cancel"); + await h.open(); + await h.prompt(); + if (mode === "answer") + expect( + await h.wait((e) => e.type === "timeline.item" && e.item.type === "todo"), + ).toMatchObject({ + item: { + items: [ + { text: "inspect f", completed: false, status: "in_progress" }, + { text: "report", completed: false, status: "pending" }, + ], + }, + }); + const permission = await h.wait( + (e) => e.type === "session.permission" && e.request.kind === "question", + ); + if (permission.type !== "session.permission") throw new Error("Expected question"); + expect(permission.request.input).toMatchObject({ + questions: [ + { header: "Color", options: [{ label: "Blue" }, { label: "Green" }], multiSelect: false }, + ], + }); + await h.send({ + type: "session.permission", + sessionId: "paseo-session", + permissionId: permission.request.id, + response: + mode === "answer" + ? { behavior: "allow", updatedInput: { answers: { Color: "Blue" } } } + : { behavior: "deny", message: "QA cancellation" }, + }); + await h.wait( + (e) => e.type === "session.permission_resolved" && e.permissionId === permission.request.id, + ); + const frame = (await h.recorded()).find( + (f) => f.method === (mode === "answer" ? "userInput/answer" : "userInput/cancel"), + ); + expect(frame.params.userInputId).toBe(permission.request.id); + if (mode === "answer") + expect(frame.params.answers).toEqual([{ questionId: "color_choice", selectedLabel: "Blue" }]); + expect((await h.recorded()).some((f) => f.result && Object.keys(f.result).length === 0)).toBe( + true, + ); + }); +} +for (const variant of ["tool", "dedicated", "workflow"]) { + test(`${variant} subagent opens only the supplied child and pages its real transcript`, async () => { + const h = await harness("subagent", { MUSE_TEST_CHILD: variant }); + await h.open(); + await h.prompt(); + expect( + await h.wait((e) => e.type === "session.opened" && e.sessionId === "fixture-child"), + ).toMatchObject({ + parentSessionId: "paseo-session", + restoration: "parent", + toolCallId: expect.any(String), + }); + expect( + await h.wait( + (e) => + e.type === "timeline.item" && + e.sessionId === "fixture-child" && + e.item.type === "assistant_message", + ), + ).toMatchObject({ item: { text: "SUBAGENT_PHASE0_OK" } }); + await h.wait((e) => e.type === "session.turn" && e.state === "completed"); + expect( + h.events.filter((e) => e.type === "session.opened" && e.sessionId === "fixture-child"), + ).toHaveLength(1); + expect( + (await h.recorded()) + .filter((f) => f.method === "session/read") + .map((f) => f.params.sessionId), + ).toEqual(["fixture-child"]); + expect( + h.events.filter( + (e) => + e.type === "timeline.item" && + e.sessionId === "fixture-child" && + e.item.type === "assistant_message", + ), + ).toHaveLength(1); + }); +} +test("gap backfill repairs a missing completion without duplicating item revisions", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_GAP: "1" }); + await h.open(); + await h.prompt(); + await h.wait((e) => e.type === "session.turn" && e.state === "completed"); + const frames = (await h.recorded()).filter((f) => f.method === "view/page"); + expect(frames.map((f) => f.params.cursor)).toEqual(["fixture-last-cursor"]); + const messages = h.events.filter( + (e) => e.type === "timeline.item" && e.item.type === "assistant_message", + ); + expect(messages.at(-1)).toMatchObject({ item: { text: expect.stringContaining("49/20") } }); + expect(h.events.filter((e) => e.type === "session.turn" && e.state === "completed")).toHaveLength( + 1, + ); +}); +test("silent active turns page after two minutes and stop polling on recovered terminal", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_SILENT: "1" }); + await h.open(); + vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] }); + await h.prompt(); + await h.wait((e) => e.type === "session.prompt_result"); + await vi.advanceTimersByTimeAsync(119999); + expect((await h.recorded()).filter((f) => f.method === "view/page")).toEqual([]); + await vi.advanceTimersByTimeAsync(1); + await h.wait((e) => e.type === "session.turn" && e.state === "completed"); + await vi.advanceTimersByTimeAsync(240000); + expect((await h.recorded()).filter((f) => f.method === "view/page")).toHaveLength(1); +}); +test("sandbox, network and workspace trust settings apply only on the next open", async () => { + const h = await harness(); + await h.open(); + h.setSettings({ sandbox: false, network: "enabled", trustWorkspace: true }); + expect((await h.recorded()).filter((f) => f.event === "hostStarted").map((f) => f.args)).toEqual([ + ["serve", "--sandbox-network", "proxy-only"], + ]); + await h.send({ type: "session.close", sessionId: "paseo-session", requestId: "close-settings" }); + await h.wait((e) => e.type === "session.closed"); + const from = h.events.length; + await h.open(); + await h.wait((e) => e.type === "session.ready", from); + expect((await h.recorded()).filter((f) => f.event === "hostStarted").map((f) => f.args)).toEqual([ + ["serve", "--sandbox-network", "proxy-only"], + ["serve", "--sandbox-network", "enabled", "--disable-sandbox", "--trust-workspace"], + ]); +}); +test("sessions list filters workspace and imported persistence opens via resume", async () => { + const h = await harness("resume-without-cursor"); + await h.send({ + type: "sessions", + requestId: "import-list", + cwd: "/tmp/muse-phase0/repo", + limit: 2, + }); + const listed = await h.wait((e) => e.type === "sessions"); + if (listed.type !== "sessions") throw new Error("Expected sessions"); + expect(listed.sessions).toHaveLength(2); + expect((await h.recorded()).find((f) => f.method === "session/list").params.workspaceRoot).toBe( + "/tmp/muse-phase0/repo", + ); + await h.open(listed.sessions[0]!.persistence); + expect((await h.recorded()).filter((f) => f.method === "session/start")).toEqual([]); + expect((await h.recorded()).find((f) => f.method === "session/resume").params.sessionId).toBe( + listed.sessions[0]!.persistence.data.sessionId, + ); +}); +for (const fixture of ["phase3-compact", "phase3-compact-history", "phase3-compact-limit"]) { + test(`${fixture} routes compact and exposes the recorded outcome`, async () => { + const h = await harness(fixture); + const rows = ( + await readFile( + fileURLToPath(new URL(`./fixtures/${fixture}.ndjson`, import.meta.url)), + "utf8", + ) + ) + .trim() + .split("\n") + .map((line) => JSON.parse(line)); + const nativeId = rows.find((row) => row.msg.method === "session/resume").msg.params.sessionId; + await h.open({ version: 1, data: { sessionId: nativeId } }); + await h.send({ + type: "session.prompt", + sessionId: "paseo-session", + prompt: { + clientMessageId: "compact", + delivery: "auto", + input: { type: "command", name: "compact", arguments: "" }, + }, + }); + if (fixture === "phase3-compact-limit") { + expect(await h.wait((e) => e.type === "session.prompt_result")).toMatchObject({ + result: { type: "completed" }, + }); + expect( + await h.wait( + (e) => + e.type === "timeline.item" && + e.item.type === "compaction" && + e.item.status === "completed", + ), + ).toMatchObject({ item: { preTokens: 22192 } }); + } else + expect(await h.wait((e) => e.type === "session.prompt_result")).toMatchObject({ + result: { + type: "failed", + error: { + code: "commandRejected", + message: expect.stringContaining("context_compaction.provider_context_limit_tokens"), + }, + }, + }); + expect((await h.recorded()).filter((f) => f.method === "turn/start")).toEqual([]); + }); +} +for (const usage of [ + {}, + { + usage: { + observedAtMs: 1700000000000, + tier: "Pro", + window: { usedPercent: 75, resetsAtMs: 1700018000000, windowDurationMins: 300 }, + weekly: { usedPercent: 105, resetsAtMs: 1700604800000 }, + }, + }, +]) { + test(`usage source presents ${"usage" in usage ? "subscription windows" : "real route absence"} from discovered accounts`, async () => { + const h = await harness("catalog-controls", { MUSE_TEST_USAGE: JSON.stringify(usage) }); + await h.open(); + const inputs = await h.usageSource.discover(); + expect(inputs).toHaveLength(1); + const input = inputs[0]; + expect(await h.usageSource.identify(input)).toEqual({ + key: (input as { account: string }).account, + label: "Muse Code", + }); + const report = await h.usageSource.fetch(input); + if ("usage" in usage) + expect(report).toMatchObject({ + status: "available", + planLabel: "Pro", + windows: [ + { + id: "five_hour", + label: "5 hours", + usedPct: 75, + remainingPct: 25, + tone: "warning", + }, + { id: "weekly", usedPct: 105, remainingPct: 0, tone: "danger" }, + ], + }); + else expect(report).toEqual({ status: "unavailable", windows: [], balances: [], details: [] }); + expect((await h.recorded()).filter((f) => f.method === "usage/read")).toHaveLength(1); + }); +} + +test("a terminal before turn admission does not start an idle watchdog", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_ACK_LAST: "1" }); + await h.open(); + vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] }); + await h.prompt(); + await h.wait((e) => e.type === "session.prompt_result"); + await h.wait((e) => e.type === "session.turn" && e.state === "completed"); + await vi.advanceTimersByTimeAsync(120000); + await delay(30); + expect((await h.recorded()).filter((f) => f.method === "view/page")).toEqual([]); +}); +test("admitted compact publishes compaction progress and completes the command without a turn", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_COMPACT: "1" }); + await h.open(); + await h.send({ + type: "session.prompt", + sessionId: "paseo-session", + prompt: { + clientMessageId: "compact-admitted", + delivery: "auto", + input: { type: "command", name: "compact", arguments: "" }, + }, + }); + expect(await h.wait((e) => e.type === "session.prompt_result")).toMatchObject({ + result: { type: "completed" }, + }); + await h.wait( + (e) => + e.type === "timeline.item" && e.item.type === "compaction" && e.item.status === "completed", + ); + expect( + h.events + .filter((e) => e.type === "timeline.item" && e.item.type === "compaction") + .map((e) => e.type === "timeline.item" && e.item), + ).toEqual([ + { type: "compaction", id: "fixture-compaction", status: "loading" }, + { type: "compaction", id: "fixture-compaction", status: "completed" }, + ]); + expect((await h.recorded()).filter((f) => f.method === "turn/start")).toEqual([]); +}); + +test("default workflow children render structured tool details from the real no-flag run", async () => { + const h = await harness("text-reasoning", { MUSE_TEST_WORKFLOW: "1" }); + await h.open(); + await h.prompt(); + const event = await h.wait( + (e) => + e.type === "timeline.item" && + e.item.type === "tool_call" && + e.item.name === "workflow" && + e.item.detail.type === "sub_agent" && + e.item.detail.log?.includes("MUSE_PARITY_CHILD_OK") === true, + ); + expect(event).toMatchObject({ item: { status: "completed", detail: { type: "sub_agent" } } }); + expect(h.events.filter((e) => e.type === "session.opened")).toHaveLength(1); + const workflows = h.events.filter( + (e) => e.type === "timeline.item" && e.item.type === "tool_call" && e.item.name === "workflow", + ); + expect(workflows.length).toBeGreaterThan(1); + for (const workflow of workflows) + expect(workflow).toMatchObject({ item: { detail: { type: "sub_agent" } } }); +}); + +for (const source of ["user", "project"] as const) { + test(`real ${source} skill catalog and command replay with explicit workspace trust`, async () => { + const h = await harness(`phase3-${source}-skill`); + h.setSettings({ trustWorkspace: source === "project" }); + await h.open(); + expect(await h.wait((e) => e.type === "session.commands")).toMatchObject({ + commands: expect.arrayContaining([ + expect.objectContaining({ name: `muse-parity-${source}` }), + ]), + }); + await h.send({ + type: "session.prompt", + sessionId: "paseo-session", + prompt: { + clientMessageId: "real-skill", + delivery: "auto", + input: { type: "command", name: `muse-parity-${source}`, arguments: "QA" }, + }, + }); + await h.wait((e) => e.type === "session.turn" && e.state === "completed"); + expect(h.events).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + type: "timeline.item", + item: expect.objectContaining({ + type: "assistant_message", + text: `MUSE_PARITY_${source.toUpperCase()}_OK`, + }), + }), + ]), + ); + const recorded = await h.recorded(); + expect(recorded.find((f) => f.method === "turn/start").params.input).toContainEqual({ + type: "skill", + selector: `muse-parity-${source}`, + arguments: "QA", + }); + expect(recorded.find((f) => f.event === "hostStarted").args.includes("--trust-workspace")).toBe( + source === "project", + ); + }); +} + +test("usage identity follows the resolved config directory across credential and route changes", async () => { + const identities: string[] = []; + for (const [config, token, route] of [ + ["/usage/config", "token-a", "route-a"], + ["/usage/config", "token-b", "route-b"], + ["/usage/other", "token-b", "route-b"], + ]) { + const h = await harness("catalog-controls", { + XDG_CONFIG_HOME: config!, + META_API_KEY: token!, + META_BASE_URL: route!, + }); + await h.open(); + const inputs = await h.usageSource.discover(); + expect(inputs).toHaveLength(1); + const identity = await h.usageSource.identify(inputs[0]); + expect(identity).not.toBeNull(); + identities.push(identity!.key); + } + expect(identities[0]).toBe(identities[1]); + expect(identities[2]).not.toBe(identities[0]); +}); diff --git a/plugins/tsconfig.json b/plugins/tsconfig.json index 5066af976b..83e35ddb4b 100644 --- a/plugins/tsconfig.json +++ b/plugins/tsconfig.json @@ -7,7 +7,8 @@ "lib": ["ES2023", "DOM"], "types": ["node", "vitest/globals"], "incremental": false, - "noEmit": true + "noEmit": true, + "jsx": "react-jsx" }, "include": ["**/*.ts", "**/*.tsx"], "exclude": ["node_modules", "**/*.test.ts"] diff --git a/public-docs/custom-providers.md b/public-docs/custom-providers.md index 1c89d8d2a6..b325492768 100644 --- a/public-docs/custom-providers.md +++ b/public-docs/custom-providers.md @@ -18,7 +18,9 @@ Everything beyond the [supported providers](/docs/supported-providers) lives und Run `paseo reload` after editing the file. Provider changes apply to future launches without restarting the daemon. -Provider IDs must be lowercase alphanumeric with hyphens (`/^[a-z][a-z0-9-]*$/`). Every custom entry needs `extends` (a first-class provider ID or `"acp"`) and a `label`. +Provider IDs must be lowercase alphanumeric with hyphens (`/^[a-z][a-z0-9-]*$/`). A new custom provider needs `extends` (a first-class provider ID or `"acp"`) and a `label`. +To override a bundled provider plugin, use its provider ID and omit `extends`. For +[Muse Code](/docs/muse-code), set command or environment overrides under `agents.providers.muse`. The examples below are a quick tour. The full, up-to-date reference is on GitHub: [docs/custom-providers.md](https://github.com/getpaseo/paseo/blob/main/docs/custom-providers.md). diff --git a/public-docs/docker.md b/public-docs/docker.md index f6324a09f2..6f19da692a 100644 --- a/public-docs/docker.md +++ b/public-docs/docker.md @@ -39,7 +39,7 @@ The image: - stores daemon state under `/home/paseo/.paseo` - runs the daemon and launched agents as the non-root `paseo` user -The image does not bundle agent CLIs such as Claude Code, Codex, OpenCode, Copilot, or Pi. Add the agents you use with a small child image. +The image does not bundle agent CLIs such as Claude Code, Codex, OpenCode, Copilot, Pi, or Muse Code. Add the agents you use with a small child image. Host-side CLI commands select the container explicitly, for example `paseo project ls --host 127.0.0.1:6767`. Without an endpoint selector the CLI looks for a local home’s supervisor. Container environment settings are deployment overrides; worker restart preserves them. Your container manager owns full supervisor replacement. diff --git a/public-docs/muse-code.md b/public-docs/muse-code.md new file mode 100644 index 0000000000..99c3096755 --- /dev/null +++ b/public-docs/muse-code.md @@ -0,0 +1,58 @@ +--- +title: Muse Code +description: Install and configure Muse Code for Paseo. +nav: Muse Code +order: 25 +category: Providers +--- + +# Muse Code + +Run Meta's terminal coding agent in Paseo with your existing Muse installation and credentials. + +## Getting started + +Install Muse Code on the machine running the Paseo daemon: + +```bash +curl -fsSL https://dev.meta.ai/install.sh | sh +muse login +``` + +Use Muse 1.3.0 or newer. This integration was verified with 1.4.1. For API access, set +`META_API_KEY` in the daemon's environment instead of logging in. See +[provider environment overrides](/docs/custom-providers). + +In Paseo, select **Muse Code**, then choose a model, approval mode, and reasoning effort. +Paseo runs `muse serve` and communicates over the Muse Session Protocol (MSP). Your Muse +configuration determines the available models. + +## Plugin settings + +Open Command Center and select **Configure Muse Code**. Changes apply when an agent's +Muse host next opens, including a refresh of an existing agent. + +| Setting | Default | Effect | +| --------------- | ------------ | ----------------------------------------------------------------------------------------------- | +| Sandbox | On | Keeps Muse's filesystem and network sandbox enabled. Turning it off allows full network access. | +| Network | `proxy-only` | Muse's sandbox network policy: `proxy-only`, `restricted`, or `enabled`. | +| Trust workspace | Off | Lets Muse load project-scoped skills and configuration. | + +Approval modes control tool decisions separately: **Default**, **Ask**, **Strict**, and +**Full access**. Full access automatically allows escalated approval stages; it keeps the +sandbox setting you chose. Skills appear in the slash-command menu, alongside `/compact`. + +## Limitations in Muse 1.4.1 + +- **Paseo MCP tools are unavailable.** Muse drops the returned tool namespace before matching + an MCP call. This upstream issue must be fixed in Muse before its agents can use Paseo tools. +- **Compaction needs a model context limit.** If your endpoint does not report one, configure + `context_compaction.provider_context_limit_tokens` in Muse for the selected model. +- **Usage windows appear only when Muse reports them.** An empty `usage/read` response + leaves subscription usage unavailable. +- **Native subagents may need Muse's experimental SDK flag.** Set + `MUSE_EXPERIMENTAL_SDK_ENABLED=on` in the provider environment if native subagent tools + are missing. Linked child sessions appear only when Muse supplies `childSessionId`. + +See [custom providers](/docs/custom-providers) to override the binary or environment under +`agents.providers.muse`. diff --git a/public-docs/providers.md b/public-docs/providers.md index ea7f09e36e..6de304a019 100644 --- a/public-docs/providers.md +++ b/public-docs/providers.md @@ -8,7 +8,7 @@ category: Providers # Providers -Paseo doesn't ship its own coding agent. It launches and supervises **existing CLIs you've already installed and authenticated**, Claude Code, Codex, OpenCode, Cursor, Gemini, and the rest. Your subscriptions, your config, your skills, your MCP servers all stay intact. Paseo just gives you a UI, a CLI, a relay, and orchestration on top. +Paseo doesn't ship its own coding agent. It launches and supervises **existing CLIs you've already installed and authenticated**, Claude Code, Codex, OpenCode, Antigravity, Muse Code, Cursor, Gemini, and the rest. Your subscriptions, your config, your skills, your MCP servers all stay intact. Paseo just gives you a UI, a CLI, a relay, and orchestration on top. ## Mental model @@ -16,7 +16,7 @@ A provider is the contract between Paseo and one external agent CLI: how to laun ## Two tiers -- **Native support**, Paseo ships a bundled adapter for the major agents (Claude Code, Codex, OpenCode, pi). Auto-discovered when the underlying CLI is installed, with mode metadata and voice support where applicable. +- **Native support**, Paseo ships a bundled adapter for the major agents (Claude Code, Codex, OpenCode, Pi, [Antigravity](/docs/supported-providers#antigravity), [Muse Code](/docs/muse-code)). Auto-discovered when the underlying CLI is installed, with mode metadata and voice support where applicable. - **ACP catalog**, any agent speaking the [Agent Client Protocol](https://agentclientprotocol.com) is supported through a generic adapter. Paseo ships a curated catalog of one-click installs (Cursor, Gemini, GitHub Copilot, Hermes, Kimi, Qwen Code, and 25+ more), and you can add any other ACP agent yourself. Either way, **you install the underlying CLI**. Paseo runs it. diff --git a/public-docs/security.md b/public-docs/security.md index 982b956829..a935a75878 100644 --- a/public-docs/security.md +++ b/public-docs/security.md @@ -123,7 +123,7 @@ See [Docker](/docs/docker) for Compose and reverse proxy examples. ## Agent authentication -Paseo wraps agent CLIs (Claude Code, Codex, OpenCode) but does not manage their authentication. Each agent provider handles its own credentials: +Paseo wraps agent CLIs (Claude Code, Codex, OpenCode, Muse Code) but does not manage their authentication. Each agent provider handles its own credentials: - **Claude Code**, authenticates via Anthropic's OAuth flow, stored in `~/.claude/` - **Codex**, uses your OpenAI API key or OAuth session diff --git a/public-docs/supported-providers.md b/public-docs/supported-providers.md index 588fd96195..aaed86f5c4 100644 --- a/public-docs/supported-providers.md +++ b/public-docs/supported-providers.md @@ -19,6 +19,7 @@ Work out of the box once the underlying CLI is installed and authenticated. - [OpenCode](https://opencode.ai/). Open-source coding assistant with multi-provider model support. - [Pi](https://pi.dev). Minimal terminal-based coding agent with multi-provider LLM support. - [Antigravity](#antigravity). Uses your installed `agy` CLI through a built-in provider plugin. +- [Muse Code](/docs/muse-code). Meta's terminal coding agent, bundled as a provider plugin. ### Antigravity diff --git a/scripts/builtin-plugins-dist.test.mjs b/scripts/builtin-plugins-dist.test.mjs index 7ec6ba55ee..acaa684a44 100644 --- a/scripts/builtin-plugins-dist.test.mjs +++ b/scripts/builtin-plugins-dist.test.mjs @@ -1,6 +1,7 @@ import assert from "node:assert/strict"; -import { readFile, stat } from "node:fs/promises"; +import { mkdtemp, readFile, rm, stat } from "node:fs/promises"; import path from "node:path"; +import os from "node:os"; import test from "node:test"; import { fileURLToPath } from "node:url"; import pino from "pino"; @@ -28,7 +29,8 @@ test("built output compiles and starts every listed built-in", async () => { const { version } = JSON.parse( await readFile(path.join(repoRoot, "packages/server/package.json"), "utf8"), ); - const runtime = new PluginRuntime(pino({ level: "silent" }), version); + const settingsDirectory = await mkdtemp(path.join(os.tmpdir(), "builtin-dist-settings-")); + const runtime = new PluginRuntime(pino({ level: "silent" }), version, { settingsDirectory }); runtime.bindPaseoSessionHost({ async attachPluginSocket(_pluginId, socket) { const closed = new Promise((resolve) => socket.once("close", resolve)); @@ -76,5 +78,6 @@ test("built output compiles and starts every listed built-in", async () => { } } finally { await runtime.stopAll(); + await rm(settingsDirectory, { recursive: true, force: true }); } });