MCPcopy
hub / github.com/coder/mux / buildCompletedWorkspaceTurnPrompt

Function buildCompletedWorkspaceTurnPrompt

src/node/services/taskService.ts:355–364  ·  view source on GitHub ↗

* Workspace-turn terminal output is NOT injected into parent history (unlike sub-agent reports); * it lives in the task handle store. So the wake-up must tell the agent to retrieve it with a * one-shot task_await (terminal already, timeout_secs: 0), not to keep waiting.

(handleIds: string[])

Source from the content-addressed store, hash-verified

353 * one-shot task_await (terminal already, timeout_secs: 0), not to keep waiting.
354 */
355function buildCompletedWorkspaceTurnPrompt(handleIds: string[]): string {
356 assert(handleIds.length > 0, "buildCompletedWorkspaceTurnPrompt requires at least one handle id");
357 return (
358 "Background workspace turn(s) have reached a terminal state: " +
359 `${handleIds.join(", ")}. ` +
360 `Call task_await now with task_ids: ${JSON.stringify(handleIds)} and timeout_secs: 0 to ` +
361 "retrieve their terminal output, then integrate it into your work. These handles are already " +
362 "terminal — do not repeatedly wait if task_await returns a terminal status."
363 );
364}
365
366function workflowRunTerminalOutcome(status: WorkflowRunStatus): TerminalAttentionOutcome {
367 switch (status) {

Callers 1

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected