fix(copilot): declare a composer ready mark so codeman agent spawn waits for it

Copilot had no composerReadyMark, so `codeman agent spawn --mode copilot` returned as soon as
the session existed, before the composer could take a prompt (and before folder trust was
answered). The mark is the composer's footer hint, not the glyph: the trust dialog draws
`❯ 1. Yes`, so `❯` would call a worker ready while it still asks for trust. Measured on 1.0.95:
the dialog footer reads `↑/↓ to navigate`, the composer's reads `/ commands · ? help`.
This commit is contained in:
Devvyn committed 2026-10-18 00:47:47 +08:00
1 parent d732b46797
commit d7c7564415
2 files changed
+7

No files matched your search

+5
View File
@@ -1757,6 +1757,11 @@ const COPILOT: CliEntry = {
// `_shouldForwardWheelToApp` forwards it as SGR reports while the CLI is tracking. // `_shouldForwardWheelToApp` forwards it as SGR reports while the CLI is tracking.
altScreen: 'strip-mux-and-mouse', altScreen: 'strip-mux-and-mouse',
echo: { policy: 'buffer', anchor: { kind: 'cursor' } }, echo: { policy: 'buffer', anchor: { kind: 'cursor' } },
// What `codeman agent spawn` waits for. The composer's footer hint, NOT the `❯` glyph: the
// folder-trust dialog draws `❯ 1. Yes` for its selected row, so the glyph would call a worker
// ready while it is still asking for trust (measured on 1.0.95: the dialog's footer reads
// `↑/↓ to navigate`, the composer's `/ commands · ? help`).
composerReadyMark: '/ commands · ? help',
// The composer row is a `❯` between two rules, and the submitted prompt is echoed as // The composer row is a `❯` between two rules, and the submitted prompt is echoed as
// ` ❯ <text> <time>` above it. While a turn runs the footer's left end reads // ` ❯ <text> <time>` above it. While a turn runs the footer's left end reads
// `◉ Working esc edit prompt` (the dot alternates `◉` and `◎`); at rest it reads // `◉ Working esc edit prompt` (the dot alternates `◉` and `◎`); at rest it reads
+2
View File
@@ -506,6 +506,8 @@ describe('agent spawn', () => {
it('takes the readiness mark from the CLI registry, not from a mode list', () => { it('takes the readiness mark from the CLI registry, not from a mode list', () => {
expect(composerReadyMark('claude')).toBe('shift+tab'); expect(composerReadyMark('claude')).toBe('shift+tab');
expect(composerReadyMark('deepseek')).toBe('❯'); expect(composerReadyMark('deepseek')).toBe('❯');
// Copilot's trust dialog draws `❯ 1. Yes`, so its mark is the composer's footer hint instead.
expect(composerReadyMark('copilot')).toBe('/ commands · ? help');
expect(composerReadyMark('pi')).toBeUndefined(); expect(composerReadyMark('pi')).toBeUndefined();
expect(composerReadyMark('no-such-cli')).toBeUndefined(); expect(composerReadyMark('no-such-cli')).toBeUndefined();
}); });