diff --git a/backend/__tests__/unit/config/nativeAgents.scoutKnowledge.test.js b/backend/__tests__/unit/config/nativeAgents.scoutKnowledge.test.js index ab38f08955..dc744441ac 100644 --- a/backend/__tests__/unit/config/nativeAgents.scoutKnowledge.test.js +++ b/backend/__tests__/unit/config/nativeAgents.scoutKnowledge.test.js @@ -141,6 +141,29 @@ describe('Scout onboarding knowledge', () => { expect(prompt).toMatch(/and the MCP line/); }); + // Stranger journey 2026-10-26: Scout wrote the Terminal steps and asked + // "Want me to open that page?" instead of proposing, and no card came. + test('proposes the connect card once it knows the tool and OS, without asking first', () => { + expect(prompt).toMatch( + /Propose the connect card in the same turn you learn both what they run and an OS where it can be connected/, + ); + expect(prompt).toMatch(/Do not ask whether to: the card is the question/); + expect(prompt).toMatch(/Do not write the Terminal steps in chat instead of the card/); + expect(prompt).toMatch( + /Where the connect card applies, the card is the Terminal half: propose it and give only the MCP line/, + ); + }); + + // A card gets only the MCP line in text, so Codex needs a line of its own: + // the Claude Code one does not configure Codex. + test('gives an MCP line for each tool the card connects', () => { + expect(prompt).toContain('`claude mcp add commonly -e COMMONLY_API_URL=... ' + + '-e COMMONLY_AGENT_TOKEN=... -- npx -y @commonlyai/mcp`'); + expect(prompt).toContain('`codex mcp add commonly --env COMMONLY_API_URL=... ' + + '--env COMMONLY_AGENT_TOKEN=... -- npx -y @commonlyai/mcp`'); + expect(prompt).toMatch(/Give the line for the tool they run/); + }); + test('cites developer docs that exist in the repository', () => { const repo = path.resolve(__dirname, '../../../..'); for (const doc of [ diff --git a/backend/config/native-agents/scout.ts b/backend/config/native-agents/scout.ts index 0c18feeae1..2f22c35e8b 100644 --- a/backend/config/native-agents/scout.ts +++ b/backend/config/native-agents/scout.ts @@ -104,10 +104,13 @@ export const scoutApp = { + 'tool gets a clear error instead of quietly starting the other one. That ' + 'last command is what makes their agent answer @mentions, and its Terminal ' + 'window must stay open. The page turns green when the agent first checks in.\n' - + ' * An MCP line for Claude Code (`claude mcp add commonly -e ' + + ' * An MCP line gives their agent Commonly tools inside their own ' + + 'sessions. For Claude Code: `claude mcp add commonly -e ' + 'COMMONLY_API_URL=... -e COMMONLY_AGENT_TOKEN=... -- npx -y ' - + '@commonlyai/mcp`) gives their agent Commonly tools inside their own ' - + 'sessions. MCP alone does NOT answer @mentions; only the listener does. ' + + '@commonlyai/mcp`. For Codex: `codex mcp add commonly --env ' + + 'COMMONLY_API_URL=... --env COMMONLY_AGENT_TOKEN=... -- npx -y ' + + '@commonlyai/mcp`. Give the line for the tool they run. ' + + 'MCP alone does NOT answer @mentions; only the listener does. ' + 'Say exactly this when someone set up MCP and asks why their agent is ' + 'silent.\n' // Walked 2026-10-19 (CLI 0.1.108, OpenCode 1.19.3, macOS, a non-admin @@ -203,6 +206,14 @@ export const scoutApp = { + 'to the page with the command and what it needs, so do not post the steps ' + 'again; at most one short line that the command is on the page that opened. ' + 'You never see their key and must never ask them to paste one into chat.\n' + // Stranger journey 2026-10-26 02:18Z: told "macOS" after "Claude Code", + // Scout pasted the listener steps and asked "Want me to open that page?", + // then waited. No card ever came, and a stranger who does not answer that + // question never gets one. The run 21 minutes earlier proposed on that turn. + + '- Propose the connect card in the same turn you learn both what they run ' + + 'and an OS where it can be connected. Do not ask whether to: the card ' + + 'is the question, and they answer it by approving. Do not write the ' + + 'Terminal steps in chat instead of the card.\n' + '- commonly_agent_status tells you every agent\'s live state. Use it ' + 'whenever the user asks whether an agent is connected or why it is ' + 'silent: never-connected means the connect-page step was never finished ' @@ -226,7 +237,9 @@ export const scoutApp = { + '- When their own tool can call agents or command-line tools, or they ' + 'ask about both directions, give both halves: the Terminal command (their agent ' + 'answers @mentions here) and the MCP line (their agent uses Commonly ' - + 'from its own sessions). Say that MCP alone does not answer @mentions.\n' + + 'from its own sessions). Say that MCP alone does not answer @mentions. ' + + 'Where the connect card applies, the card is the Terminal half: propose ' + + 'it and give only the MCP line in your text.\n' + '- End with one next step they can take right now.\n' + '- The facts above are verified: give them without hedging. For ' + 'anything they do not cover, say you are not sure, give the closest '