Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(orca): treat a steer fallback as queued, not prioritized
zyjisdog7e2a632feefe
diff --git a/packages/orca-workflow/src/__tests__/orca-bridge-prompt.test.ts b/packages/orca-workflow/src/__tests__/orca-bridge-prompt.test.tsindex 5a3fc0c647..8c7d36c9eb 100644--- a/packages/orca-workflow/src/__tests__/orca-bridge-prompt.test.ts+++ b/packages/orca-workflow/src/__tests__/orca-bridge-prompt.test.ts@@ -12,7 +12,7 @@ describe('renderOrcaLeadSystemPrompt', () => {const toolSurfaceRule ='Tools: get_workspace_info, create_worker, create_workers, send_to_worker, interrupt_worker, get_worker_queue_status, update_queued_message, cancel_queued_message, merge_queued_messages, steer_queued_message, move_queued_message, update_worker.';const queueOrderRule =- 'Queue order: the worker queue is FIFO, so a later order runs after the earlier ones. To run an order sooner: steer_queued_message inserts a queued message into the worker\'s current turn, move_queued_message moves it to position 0 (front), and a more urgent order you send while the worker is busy should go out with delivery=steer instead of queueing. merge_queued_messages combines related messages but keeps the earliest position and never reorders. QUEUE_CHANGED from merge_queued_messages means the queue moved under you: re-read get_worker_queue_status and retry.';+ 'Queue order: the worker queue is FIFO, so a later order runs after the earlier ones. To run an order sooner: steer_queued_message inserts a queued message into the worker\'s current turn, move_queued_message moves it to position 0 (front), and a more urgent order you send while the worker is busy should go out with delivery=steer instead of queueing. A send_to_worker reply carrying steer_fallback_reason was queued, not steered — it is not prioritized yet: promote it with move_queued_message to position 0 before you end the turn. merge_queued_messages combines related messages but keeps the earliest position and never reorders. QUEUE_CHANGED from merge_queued_messages means the queue moved under you: re-read get_worker_queue_status and retry.';const explicitCreationBoundary ='Use create_worker only when the user explicitly asks to open one new worker, and use create_workers only when the user explicitly asks to open multiple new workers.';const missingWorkerBoundary =@@ -92,6 +92,9 @@ describe('renderOrcaLeadSystemPrompt', () => {expect(prompt).toContain('For a single-role request, after create_worker, send_to_worker, or interrupt_worker returns with the concrete dispatch signals above, your turn is OVER. Produce ZERO output',);+ expect(prompt).toContain(+ 'The one exception: a send_to_worker reply with steer_fallback_reason still needs the queue promotion above before you end.',+ );expect(prompt).toContain('Produce the final summary only after every relevant task has a terminal result from its own execution channel (rule 8).',);diff --git a/packages/orca-workflow/src/orca-bridge-prompt.ts b/packages/orca-workflow/src/orca-bridge-prompt.tsindex d6c99fef07..9c5510e11e 100644--- a/packages/orca-workflow/src/orca-bridge-prompt.ts+++ b/packages/orca-workflow/src/orca-bridge-prompt.ts@@ -32,7 +32,7 @@ export function renderOrcaLeadSystemPrompt(initialWorker?: OrcaInitialWorkerRef'Tools: get_workspace_info, create_worker, create_workers, send_to_worker, interrupt_worker, get_worker_queue_status, update_queued_message, cancel_queued_message, merge_queued_messages, steer_queued_message, move_queued_message, update_worker.','(worker_status and read_worker also exist but are for emergency diagnostics only — do NOT use them for normal polling.)','',- 'Queue order: the worker queue is FIFO, so a later order runs after the earlier ones. To run an order sooner: steer_queued_message inserts a queued message into the worker\'s current turn, move_queued_message moves it to position 0 (front), and a more urgent order you send while the worker is busy should go out with delivery=steer instead of queueing. merge_queued_messages combines related messages but keeps the earliest position and never reorders. QUEUE_CHANGED from merge_queued_messages means the queue moved under you: re-read get_worker_queue_status and retry.',+ 'Queue order: the worker queue is FIFO, so a later order runs after the earlier ones. To run an order sooner: steer_queued_message inserts a queued message into the worker\'s current turn, move_queued_message moves it to position 0 (front), and a more urgent order you send while the worker is busy should go out with delivery=steer instead of queueing. A send_to_worker reply carrying steer_fallback_reason was queued, not steered — it is not prioritized yet: promote it with move_queued_message to position 0 before you end the turn. merge_queued_messages combines related messages but keeps the earliest position and never reorders. QUEUE_CHANGED from merge_queued_messages means the queue moved under you: re-read get_worker_queue_status and retry.','','Messages from workers arrive prefixed with [From Orca Worker <role> (worker_id: <id>)] (role omitted when unknown). Treat them as worker reports or questions, not user messages.','',@@ -47,7 +47,7 @@ export function renderOrcaLeadSystemPrompt(initialWorker?: OrcaInitialWorkerRef'','CRITICAL: How your turn ends after dispatch:','- For a fully resolved multi-role request, issue every required Orca dispatch in one parallel tool-call batch: send_to_worker for existing targets, create_worker for exactly one authorized new target, and one create_workers call for 2+ authorized new targets. Include initial_task for every created target. Do not wait for one tool result before issuing the remaining calls.',- '- For a single-role request, after create_worker, send_to_worker, or interrupt_worker returns with the concrete dispatch signals above, your turn is OVER. Produce ZERO output — no summary, no confirmation, no "I\'ve sent...", no "waiting...", nothing.',+ '- For a single-role request, after create_worker, send_to_worker, or interrupt_worker returns with the concrete dispatch signals above, your turn is OVER. Produce ZERO output — no summary, no confirmation, no "I\'ve sent...", no "waiting...", nothing. The one exception: a send_to_worker reply with steer_fallback_reason still needs the queue promotion above before you end.','- If create_worker, send_to_worker, or interrupt_worker fails or lacks those dispatch signals, report the result immediately instead of ending silently. Do not wait or poll for a worker response that was not scheduled.','- After a multi-role tool-call batch returns, always relay create_workers.user_report verbatim when present, summarize every create_workers per-item result or error, and report every other failed/no-dispatch tool result. If any task has the concrete dispatch signals above, end the turn immediately after that single combined result report. If every task dispatched and no create_workers report is required, produce ZERO output. If nothing dispatched, report the results. In all cases, call no more tools and do not wait or poll.','- The system will deliver the worker\'s response as a brand-new message. You will start a fresh turn to process it — exactly like when the user sends you a message.',