From d2e741a4cd4e735a952f10d8debd9950067b87da Mon Sep 17 00:00:00 2001 From: vaakx-dev Date: Tue, 24 Nov 2026 20:39:57 +1100 Subject: [PATCH] feat(agy): answer guesses in a tool-less side agent Antigravity can't fork or sample a session over ACP, so an aside opens a short-lived agy process with a custom agent that has no tools or default prompt, gives it the recent chat and asks at low effort. The chat's own session is never touched. --- bun.lock | 1 + packages/app-plan/src/turns.ts | 4 +- plugins/core/accounts/src/apps/bridge.ts | 5 +- plugins/core/accounts/src/contract/plans.ts | 9 +- plugins/core/agy/package.json | 1 + plugins/core/agy/src/acp.ts | 5 +- plugins/core/agy/src/aside.ts | 40 +++++++++ plugins/core/agy/src/binary.ts | 4 +- plugins/core/agy/src/index.ts | 11 ++- plugins/core/agy/src/session.ts | 14 +++- plugins/core/agy/test/aside.test.ts | 49 +++++++++++ plugins/core/agy/test/chat.ts | 38 +++++++++ plugins/core/agy/test/fake-agy.ts | 84 +++++++++++++++++++ .../core/claude-code/src/session/session.ts | 4 +- plugins/core/codex/src/session/session.ts | 6 +- plugins/core/replay/src/app.ts | 4 +- 16 files changed, 257 insertions(+), 22 deletions(-) create mode 100644 plugins/core/agy/src/aside.ts create mode 100644 plugins/core/agy/test/aside.test.ts create mode 100644 plugins/core/agy/test/chat.ts create mode 100644 plugins/core/agy/test/fake-agy.ts diff --git a/bun.lock b/bun.lock index ba9636f60..a7538aaa7 100644 --- a/bun.lock +++ b/bun.lock @@ -1712,6 +1712,7 @@ "@sand/accounts": "workspace:*", "@sand/app-plan": "workspace:*", "@sand/chats": "workspace:*", + "@sand/config": "workspace:*", "@sand/media": "workspace:*", "@sand/util": "workspace:*", "drydock": "github:vaakx-dev/drydock#v0.2.0-alpha.1", diff --git a/packages/app-plan/src/turns.ts b/packages/app-plan/src/turns.ts index 837512bf7..ee1543f0a 100644 --- a/packages/app-plan/src/turns.ts +++ b/packages/app-plan/src/turns.ts @@ -1,4 +1,4 @@ -import type { AppAside, AppOutput, AppSession, Effort, HandoffBlock } from '@sand/accounts/contract' +import type { AppAside, AppAsk, AppOutput, AppSession, Effort, HandoffBlock } from '@sand/accounts/contract' import type { ModelContent, StopReason, ToolResultBlock } from '@sand/chats/contract' interface Wire { @@ -9,7 +9,7 @@ interface Wire { stop(): void close(): Promise inject?(handoff: HandoffBlock): Promise - aside?(prompt: string, signal?: AbortSignal): Promise + aside?(ask: AppAsk, signal?: AbortSignal): Promise } class Turns { diff --git a/plugins/core/accounts/src/apps/bridge.ts b/plugins/core/accounts/src/apps/bridge.ts index ca33dcdb2..94f11ac6e 100644 --- a/plugins/core/accounts/src/apps/bridge.ts +++ b/plugins/core/accounts/src/apps/bridge.ts @@ -1,4 +1,5 @@ import { + type AppAsk, type AppPlan, type AppSession, type AppSetup, @@ -64,7 +65,7 @@ const noUsage = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 } const keyOf = (caller: string, thread: ThreadRef) => `${caller}:${thread.id}:${thread.generation}` -const askedOf = (request: Request) => textOf(request.messages.at(-1)?.content ?? []) +const askOf = ({ messages }: Request): AppAsk => ({ question: textOf(messages.at(-1)?.content ?? []), messages: messages.slice(0, -1) }) const callsOf = (message: Message) => message.content.flatMap(block => (block.type === 'tool_call' ? [block.id] : [])) @@ -224,7 +225,7 @@ export const createBridge = (plan: AppPlan, home: string, track: Track) => { const entry = live.get(keyOf(caller, thread)) if (!entry?.done || !entry.session.aside) throw new Error(`${plan.app} can't answer beside this thread now`) yield { type: 'start', model: request.model } - const { text, usage } = await entry.session.aside(askedOf(request), signal) + const { text, usage } = await entry.session.aside(askOf(request), signal) yield { type: 'done', message: { role: 'assistant', content: text ? [{ type: 'text', text }] : [] }, stopReason: 'end_turn', usage: { ...noUsage, ...usage } } } diff --git a/plugins/core/accounts/src/contract/plans.ts b/plugins/core/accounts/src/contract/plans.ts index a8c4006a0..1084980ec 100644 --- a/plugins/core/accounts/src/contract/plans.ts +++ b/plugins/core/accounts/src/contract/plans.ts @@ -1,4 +1,4 @@ -import type { ModelContent, StopReason, ToolResultBlock } from '@sand/chats/contract' +import type { Message, ModelContent, StopReason, ToolResultBlock } from '@sand/chats/contract' import type { HandoffBlock, ProviderCapabilities, ToolSpec } from './llm' import type { Effort, LimitWindow, ModelPrice } from './models' import type { ContextReport, Usage } from './usage' @@ -100,6 +100,11 @@ export interface AppOutput { exit(error: Error): void } +export interface AppAsk { + question: string + messages: Message[] +} + export interface AppAside { text: string usage: Partial @@ -112,7 +117,7 @@ export interface AppSession { steer?(content: ModelContent[]): void answer(id: string, result: ToolResultBlock): void inject?(handoff: HandoffBlock): Promise - aside?(prompt: string, signal?: AbortSignal): Promise + aside?(ask: AppAsk, signal?: AbortSignal): Promise interrupt(): Promise close(): Promise } diff --git a/plugins/core/agy/package.json b/plugins/core/agy/package.json index 165266e7f..ab5eb3053 100644 --- a/plugins/core/agy/package.json +++ b/plugins/core/agy/package.json @@ -14,6 +14,7 @@ "@sand/accounts": "workspace:*", "@sand/app-plan": "workspace:*", "@sand/chats": "workspace:*", + "@sand/config": "workspace:*", "@sand/media": "workspace:*", "@sand/util": "workspace:*", "drydock": "github:vaakx-dev/drydock#v0.2.0-alpha.1" diff --git a/plugins/core/agy/src/acp.ts b/plugins/core/agy/src/acp.ts index 3d3b0e724..1533dd7b5 100644 --- a/plugins/core/agy/src/acp.ts +++ b/plugins/core/agy/src/acp.ts @@ -3,6 +3,7 @@ import { acpArgs, agy } from './binary' interface AcpOptions { folder?: string + agent?: string cwd?: string onNotify?(method: string, params: Json): void onRequest?(method: string, params: Json): Promise @@ -17,9 +18,9 @@ const refused = async (method: string) => { throw new Error(`sand doesn't handle ${method}`) } -async function startAcp({ folder, cwd, onNotify, onRequest, onExit }: AcpOptions) { +async function startAcp({ folder, agent, cwd, onNotify, onRequest, onExit }: AcpOptions) { const client = startRpc({ - command: [await agy.require(), ...acpArgs(folder)], + command: [await agy.require(), ...acpArgs({ folder, agent })], app: agy.app, cwd, onNotify: onNotify ?? (() => {}), diff --git a/plugins/core/agy/src/aside.ts b/plugins/core/agy/src/aside.ts new file mode 100644 index 000000000..6b7ee1388 --- /dev/null +++ b/plugins/core/agy/src/aside.ts @@ -0,0 +1,40 @@ +import type { AppAsk, AppSetup } from '@sand/accounts/contract' +import { textOf, type Message } from '@sand/chats/contract' +import { join } from 'node:path' + +const AGENT = 'sand-aside' + +const AGENT_FILE = `--- +name: ${AGENT} +description: Answers one question about the end of a chat in a single short reply +excludeDefaultComponents: true +tools: [] +--- +You see the end of a chat between a user and an AI assistant, then one question about it. Answer the question in one short reply, using only what the chat shows. +` + +const EFFORT = 'low' + +const RECENT_CHARS = 8_000 + +const SPEAKERS: Record = { user: 'User', assistant: 'Assistant' } + +function said(message: Message): string[] { + const text = textOf(message.content).trim() + return text ? [`${SPEAKERS[message.role]}: ${text}`] : [] +} + +function recentChat(messages: Message[]): string { + return messages.flatMap(said).join('\n\n').slice(-RECENT_CHARS) +} + +function asidePrompt({ question, messages }: AppAsk): string { + return `\n${recentChat(messages)}\n\n\n${question}` +} + +async function asideSetup({ model }: AppSetup, workspace: string): Promise { + await Bun.write(join(workspace, '.agents', 'agents', `${AGENT}.md`), AGENT_FILE) + return { model, effort: EFFORT, system: '', tools: [], cwd: workspace, persist: false } +} + +export { AGENT, asidePrompt, asideSetup } diff --git a/plugins/core/agy/src/binary.ts b/plugins/core/agy/src/binary.ts index fa9bdb1d3..e3d36acad 100644 --- a/plugins/core/agy/src/binary.ts +++ b/plugins/core/agy/src/binary.ts @@ -11,7 +11,9 @@ const folderArgs = (folder?: string) => (folder ? ['--gemini_dir', folder] : []) const agy = appBinary({ command: 'agy', app: 'Antigravity', install: 'https://antigravity.google/docs/getting-started', installed: [installed()] }) -const acpArgs = (folder?: string) => ['acp', '--disable-telemetry', '--include-default-customizations=false', ...folderArgs(folder)] +const agentArgs = (agent?: string) => (agent ? ['--agent', agent] : []) + +const acpArgs = ({ folder, agent }: { folder?: string; agent?: string }) => ['acp', '--disable-telemetry', '--include-default-customizations=false', ...folderArgs(folder), ...agentArgs(agent)] const loginArgs = (folder?: string) => ['acp', '--login', ...folderArgs(folder)] diff --git a/plugins/core/agy/src/index.ts b/plugins/core/agy/src/index.ts index 53ad17a5d..0c24d4b16 100644 --- a/plugins/core/agy/src/index.ts +++ b/plugins/core/agy/src/index.ts @@ -1,7 +1,9 @@ import { llmPlans, type ProviderCapabilities } from '@sand/accounts/contract' import { appPlan, type Provider } from '@sand/app-plan' +import { cli } from '@sand/config/contract' import { media, type Media } from '@sand/media/contract' import { definePlugin } from 'drydock' +import { join } from 'node:path' import { listModels, readStatus, signIn, signOut } from './account' import { agy } from './binary' import { agyHistory } from './history' @@ -18,7 +20,7 @@ const CAPS: ProviderCapabilities = { cacheTtlMs: 60 * 60_000, } -function antigravity(media: Media): Provider { +function antigravity(media: Media, asides: string): Provider { return { id: 'agy', label: 'Antigravity', @@ -35,7 +37,7 @@ function antigravity(media: Media): Provider { models: () => listModels(folder), usage: () => readLimits(folder), history: agyHistory(folder), - open: (setup, output, resume) => openSession(setup, output, { media, folder, report }, resume), + open: (setup, output, resume) => openSession(setup, output, { media, folder, asides, report }, resume), } }, } @@ -44,8 +46,9 @@ function antigravity(media: Media): Provider { export default definePlugin({ name: 'agy', description: 'Adds Antigravity (agy) to Settings → Accounts so sand can run Gemini models with sand’s own tools and prompt', - inject: { media }, + inject: { cli, media }, apply(ctx) { - ctx.watch(llmPlans, plans => plans?.register(appPlan(antigravity(ctx.media), plans))) + const asides = join(ctx.cli.home, 'apps', 'agy') + ctx.watch(llmPlans, plans => plans?.register(appPlan(antigravity(ctx.media, asides), plans))) }, }) diff --git a/plugins/core/agy/src/session.ts b/plugins/core/agy/src/session.ts index 534204a3b..60c10cbf3 100644 --- a/plugins/core/agy/src/session.ts +++ b/plugins/core/agy/src/session.ts @@ -1,15 +1,18 @@ -import { type AppOutput, type AppSession, type AppSetup, type Effort, type PlanLimits, UsageLimited } from '@sand/accounts/contract' -import { fieldsOf, type Json, mcpBlock, mcpBridge, parts, resetOf, SERVER_NAME, Turns } from '@sand/app-plan' +import { type AppAsk, type AppOutput, type AppSession, type AppSetup, type Effort, type PlanLimits, UsageLimited } from '@sand/accounts/contract' +import { fieldsOf, forkedAside, type Json, mcpBlock, mcpBridge, parts, resetOf, SERVER_NAME, Turns } from '@sand/app-plan' import type { ModelContent, StopReason } from '@sand/chats/contract' import type { Media } from '@sand/media/contract' import { errorMessage } from '@sand/util' import { configOptions, effortOption, modelOption } from './account' import { type AcpClient, startAcp } from './acp' +import { AGENT, asidePrompt, asideSetup } from './aside' import { readLimits } from './limits' interface SessionNeeds { media: Media folder?: string + asides: string + agent?: string report(limits: PlanLimits): void } @@ -123,6 +126,7 @@ async function openSession(setup: AppSetup, output: AppOutput, needs: SessionNee const client = await startAcp({ folder: needs.folder, + agent: needs.agent, cwd: setup.cwd, onNotify, onRequest, @@ -169,9 +173,15 @@ async function openSession(setup: AppSetup, output: AppOutput, needs: SessionNee } } + const aside = async (ask: AppAsk, signal?: AbortSignal) => { + const asking = await asideSetup(setup, needs.asides) + return forkedAside(output => openSession(asking, output, { ...needs, agent: AGENT }), asidePrompt(ask), signal) + } + return turns.session({ id: sessionId, pid: client.pid, + aside, prompt: (content, wanted) => void runTurn(content, wanted), stop: () => client.notify('session/cancel', { sessionId }), async close() { diff --git a/plugins/core/agy/test/aside.test.ts b/plugins/core/agy/test/aside.test.ts new file mode 100644 index 000000000..6e22ad3d8 --- /dev/null +++ b/plugins/core/agy/test/aside.test.ts @@ -0,0 +1,49 @@ +import type { AppAsk } from '@sand/accounts/contract' +import { afterEach, beforeEach, expect, test } from 'bun:test' +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { delimiter, join } from 'node:path' +import { ASIDE_REPLY, type Call, fakeAgy } from './fake-agy' + +let folder: string + +beforeEach(async () => { + folder = await mkdtemp(join(tmpdir(), 'sand-agy-')) +}) + +afterEach(() => rm(folder, { recursive: true, force: true })) + +const chatThenAside = async (said: string, ask: AppAsk) => { + const child = Bun.spawn([process.execPath, join(import.meta.dir, 'chat.ts'), folder, said, JSON.stringify(ask)], { + env: { ...process.env, PATH: `${folder}${delimiter}${process.env.PATH}` }, + stderr: 'inherit', + }) + const [printed, code] = await Promise.all([new Response(child.stdout).text(), child.exited]) + expect(code).toBe(0) + return JSON.parse(printed) +} + +const byProcess = (calls: Call[]) => [...Map.groupBy(calls, call => call.pid).values()] + +test('an aside asks a separate tool-less agy agent about the recent chat and leaves the chat’s own session alone', async () => { + const agy = await fakeAgy(folder) + const reply = await chatThenAside('Fix the login bug', { + question: 'What will the user most likely say next?', + messages: [ + { role: 'user', content: [{ type: 'text', text: 'Fix the login bug' }] }, + { role: 'assistant', content: [{ type: 'text', text: 'Fixed it, and the auth tests pass.' }] }, + ], + }) + expect(reply).toEqual({ text: ASIDE_REPLY, usage: { input: 600, output: 4, cacheRead: 0, cacheWrite: 0 } }) + + const [chat, aside] = byProcess(await agy.calls()) + expect(chat!.filter(call => call.method === 'session/prompt')).toHaveLength(1) + expect(chat!.filter(call => call.method === 'session/new')).toHaveLength(1) + + const prompt = JSON.stringify(aside!.find(call => call.method === 'session/prompt')!.params.prompt) + expect(prompt).toContain('Fixed it, and the auth tests pass.') + expect(prompt).toContain('What will the user most likely say next?') + expect(aside!.find(call => call.method === 'session/new')!.params.mcpServers).toEqual([]) + expect(aside!.filter(call => call.method === 'session/set_config_option').map(call => call.params.value)).toEqual(['gemini-test', 'low']) + expect(aside!.at(-1)!.method).toBe('session/close') +}) diff --git a/plugins/core/agy/test/chat.ts b/plugins/core/agy/test/chat.ts new file mode 100644 index 000000000..86732a022 --- /dev/null +++ b/plugins/core/agy/test/chat.ts @@ -0,0 +1,38 @@ +import type { AppAsk, AppOutput } from '@sand/accounts/contract' +import type { Media } from '@sand/media/contract' +import { join } from 'node:path' +import { openSession } from '../src/session' + +const media: Media = { put: () => ({ hash: '', size: 0, mediaType: '' }), path: () => '', data: () => undefined, exclude: () => {}, include: () => {}, inUse: () => () => {} } + +const turnOutput = () => { + const finished = Promise.withResolvers() + const output: AppOutput = { + text() {}, + thinking() {}, + call() {}, + usage() {}, + context() {}, + pause() {}, + finish: () => finished.resolve(), + fail: error => finished.reject(error), + exit() {}, + } + return { output, finished: finished.promise } +} + +const chatThenAside = async (folder: string, said: string, ask: AppAsk) => { + const { output, finished } = turnOutput() + const setup = { model: 'gemini-test', system: 'Be brief.', tools: [], cwd: folder, persist: true } + const session = await openSession(setup, output, { media, asides: join(folder, 'asides'), report() {} }) + session.send([{ type: 'text', text: said }]) + await finished + const reply = await session.aside!(ask) + await session.close() + return reply +} + +if (import.meta.main) { + const [folder, said, ask] = process.argv.slice(2) as [string, string, string] + console.log(JSON.stringify(await chatThenAside(folder, said, JSON.parse(ask)))) +} diff --git a/plugins/core/agy/test/fake-agy.ts b/plugins/core/agy/test/fake-agy.ts new file mode 100644 index 000000000..1a204cfcd --- /dev/null +++ b/plugins/core/agy/test/fake-agy.ts @@ -0,0 +1,84 @@ +import { appendFileSync, chmodSync, existsSync } from 'node:fs' +import { join } from 'node:path' + +interface Call { + pid: number + agent?: string + method: string + params: Record +} + +const DEFAULT_REPLY = 'Done.' +const ASIDE_REPLY = 'Run the tests' +const DEFAULT_AGENT_TOKENS = 10_000 +const ASIDE_AGENT_TOKENS = 600 + +const wrapper = async (folder: string, log: string) => { + const call = [process.execPath, import.meta.path, log].map(part => `"${part}"`).join(' ') + if (process.platform === 'win32') return Bun.write(join(folder, 'agy.cmd'), `@${call} %*\r\n`) + const path = join(folder, 'agy') + await Bun.write(path, `#!/bin/sh\nexec ${call} "$@"\n`) + chmodSync(path, 0o755) +} + +const fakeAgy = async (folder: string) => { + const log = join(folder, 'calls.jsonl') + await Bun.write(log, '') + await wrapper(folder, log) + const calls = async (): Promise => + (await Bun.file(log).text()) + .split('\n') + .filter(Boolean) + .map(line => JSON.parse(line)) + return { calls } +} + +const serve = async (log: string, agent: string | undefined) => { + const sessions = new Map() + const write = (message: unknown) => process.stdout.write(`${JSON.stringify(message)}\n`) + const update = (sessionId: string, sessionUpdate: string, text: string) => write({ jsonrpc: '2.0', method: 'session/update', params: { sessionId, update: { sessionUpdate, content: { type: 'text', text } } } }) + const loaded = (cwd: string) => !!agent && existsSync(join(cwd, '.agents', 'agents', `${agent}.md`)) + const configOptions = [ + { id: 'model', category: 'model', currentValue: 'gemini-test', options: [{ value: 'gemini-test', name: 'Gemini Test' }] }, + { id: 'thought_level', category: 'thought_level', currentValue: 'high', options: ['low', 'high'].map(value => ({ value, name: value })) }, + ] + + const answer = (method: string, params: Record) => { + if (method === 'initialize') return { protocolVersion: 1, agentCapabilities: { _meta: { antigravity: { systemPrompt: { append: true } } } } } + if (method === 'session/new') { + const sessionId = crypto.randomUUID() + sessions.set(sessionId, String(params.cwd)) + return { sessionId, configOptions } + } + if (method === 'session/set_config_option') return { configOptions } + if (method === 'session/prompt') { + const sessionId = String(params.sessionId) + const aside = loaded(sessions.get(sessionId) ?? '') + update(sessionId, 'agent_thought_chunk', 'Thinking it over') + update(sessionId, 'agent_message_chunk', aside ? ASIDE_REPLY : DEFAULT_REPLY) + return { stopReason: 'end_turn', usage: { inputTokens: aside ? ASIDE_AGENT_TOKENS : DEFAULT_AGENT_TOKENS, outputTokens: 4 } } + } + return {} + } + + let buffer = '' + for await (const chunk of Bun.stdin.stream()) { + buffer += new TextDecoder().decode(chunk) + const lines = buffer.split('\n') + buffer = lines.pop() ?? '' + for (const line of lines.filter(Boolean)) { + const { id, method, params } = JSON.parse(line) + if (!method) continue + appendFileSync(log, `${JSON.stringify({ pid: process.pid, agent, method, params })}\n`) + if (id !== undefined) write({ jsonrpc: '2.0', id, result: answer(method, params ?? {}) }) + } + } +} + +if (import.meta.main) { + const [log, ...args] = process.argv.slice(2) as [string, ...string[]] + const agentAt = args.indexOf('--agent') + await serve(log, agentAt < 0 ? undefined : args[agentAt + 1]) +} + +export { ASIDE_REPLY, fakeAgy, type Call } diff --git a/plugins/core/claude-code/src/session/session.ts b/plugins/core/claude-code/src/session/session.ts index d106e7a81..008ef61c0 100644 --- a/plugins/core/claude-code/src/session/session.ts +++ b/plugins/core/claude-code/src/session/session.ts @@ -1,4 +1,4 @@ -import type { AppOutput, AppSession, AppSetup, PlanLimits } from '@sand/accounts/contract' +import type { AppAsk, AppOutput, AppSession, AppSetup, PlanLimits } from '@sand/accounts/contract' import { fieldsOf, forkedAside, type Json, mcpServer, SERVER_NAME, Turns } from '@sand/app-plan' import type { ModelContent } from '@sand/chats/contract' import type { Media } from '@sand/media/contract' @@ -70,7 +70,7 @@ export const openSession = async (setup: AppSetup, output: AppOutput, needs: Ses return turns.session({ ...(resumed && { id: resumed.id, - aside: (question: string, signal?: AbortSignal) => forkedAside(fork => openSession(setup, fork, needs, { id: resumed.id, start: 'fork' }), question, signal), + aside: ({ question }: AppAsk, signal?: AbortSignal) => forkedAside(fork => openSession(setup, fork, needs, { id: resumed.id, start: 'fork' }), question, signal), }), pid: connection.pid, prompt, diff --git a/plugins/core/codex/src/session/session.ts b/plugins/core/codex/src/session/session.ts index 15989adec..fc98f0553 100644 --- a/plugins/core/codex/src/session/session.ts +++ b/plugins/core/codex/src/session/session.ts @@ -1,4 +1,4 @@ -import { type AppAside, type AppOutput, type AppSession, type AppSetup, type HandoffBlock, type PlanLimits, UsageLimited } from '@sand/accounts/contract' +import { type AppAside, type AppAsk, type AppOutput, type AppSession, type AppSetup, type HandoffBlock, type PlanLimits, UsageLimited } from '@sand/accounts/contract' import { fieldsOf, type Json, missing, resetOf, Turns } from '@sand/app-plan' import type { ModelContent } from '@sand/chats/contract' import type { Media } from '@sand/media/contract' @@ -141,9 +141,9 @@ export const openSession = async (needs: SessionNeeds, setup: AppSetup, output: } } - const aside = async (prompt: string, signal?: AbortSignal) => { + const aside = async ({ question }: AppAsk, signal?: AbortSignal) => { if (turnId || !lastTurn) return NO_ASIDE - const sampled = server.request('thread/sample', { threadId, expectedTurnId: lastTurn, prompt, effort: ASIDE_EFFORT }) + const sampled = server.request('thread/sample', { threadId, expectedTurnId: lastTurn, prompt: question, effort: ASIDE_EFFORT }) try { return asideOf(await (signal ? untilAborted(sampled, signal) : sampled)) } catch (error) { diff --git a/plugins/core/replay/src/app.ts b/plugins/core/replay/src/app.ts index b34401825..81036685f 100644 --- a/plugins/core/replay/src/app.ts +++ b/plugins/core/replay/src/app.ts @@ -117,8 +117,8 @@ export const replayApp = (script: Script, { folder, report, another }: AppOption if (!waiting.size) next() }, ...(caps.inject && { inject: injecting }), - async aside(prompt) { - calls.push({ type: 'aside', text: prompt }) + async aside({ question }) { + calls.push({ type: 'aside', text: question }) const reply = queue.shift() if (!reply) throw new Error(`${label} has no scripted reply left`) return { text: said(reply), usage: {} }