Skip to content

[SPEC] Unify per-turn sandbox execution (streamSandboxPrompt/driveSandboxTurn) onto shared seam #76

Description

@vutuanlinh2k2

Status

Under consideration — NOT approved for implementation. Decide whether to proceed only after #75 ships and is confirmed connected + working well across all apps (creative + gtm + legal + tax). This is the "validate the provisioning unification holds across all four apps first, then decide" gate.

Blocked by #75.

Summary

After provisioning is unified onto the shared SandboxRuntimeConfig seam (#75), the next-largest duplicated surface across the apps is per-turn execution: each app hand-rolls streamSandboxPrompt / driveSandboxTurn / runSandboxPrompt. agent-app already ships a shared per-turn path (streamSandboxPrompt(shell, box, …) with severed-stream + interactive-question detection), but it is not yet rich enough for creative-agent to drop its own version.

Why deferred / why bigger

  • 6 hot, user-facing call sites in creative alone (chat, design-canvas agent, sequences agent, mission dispatch, api-chat-action, designs/$documentId agent) — each must be re-verified.
  • creative's per-turn path assembles 8 MCP servers per turn (delegation / proposal / mission / task / event / asset / media / media-decisions) plus surface-overlay merge, spend-key guard, and thread-id logic.
  • creative's version also has model-call-failure detection that the shell's streamSandboxPrompt currently lacks.
  • The shell's per-turn path must therefore be extended additively (MCP assembly via seams + model-call-failure detection) before creative can drop its version — otherwise features are lost.

Definition of done (if approved later)

  • Shell per-turn path extended (additively) to cover creative's MCP assembly + model-call-failure detection — no behavior loss.
  • creative-agent's bespoke streamSandboxPrompt / driveSandboxTurn / runSandboxPrompt deleted; all 6 call sites delegate to the shell.
  • Provisioning unification ([TASK] Unify workspace sandbox provisioning onto shared SandboxRuntimeConfig seam #75) confirmed working across creative + gtm + legal + tax before this starts.

Context

Companion to #75 (provisioning unification). See the architecture analysis: the shell owns mechanism + control flow; per-app domain (which MCP servers, which model policy) is supplied through typed seams, never baked into the shell.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Not Started 🕧

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions