Skip to content

feat(execution): propagate trigger context from CLI, HTTP, and MCP hosts#6

Draft
aryasaatvik wants to merge 1 commit intofeat/execution-engine-persistencefrom
feat/trigger-propagation-cli-mcp
Draft

feat(execution): propagate trigger context from CLI, HTTP, and MCP hosts#6
aryasaatvik wants to merge 1 commit intofeat/execution-engine-persistencefrom
feat/trigger-propagation-cli-mcp

Conversation

@aryasaatvik
Copy link
Copy Markdown
Owner

Stacked review copy of upstream RhysSullivan#399 · stacked on RhysSullivan#398.

Prev: feat/execution-engine-persistence
Next: feat/app-drizzle-schemas-executions


See upstream PR #399 for full description.

Flows the trigger: { kind, meta } option the engine added in the
previous PR end-to-end so the runs UI can facet by attribution
surface. Also promotes recording writes from Effect.ignore to a
defect-absorbing variant so a misconfigured storage backend can't
take down an execution.

Surfaces:
- HTTP API (packages/core/api): /executions POST now declares an
  x-executor-trigger optional header. Handler reads it (defaulting to
  "http") and passes it as the engine's trigger option.
- MCP host (packages/hosts/mcp): explicit trigger: { kind: "mcp" } on
  engine.execute (inline elicitation path) and engine.executeWithPause
  (paused flow).
- CLI: stamps every /executions call from executeCode with
  x-executor-trigger: cli. Covers call, search, describe, sources —
  every subcommand that runs code goes through this helper.

Engine robustness:
- Introduced silent helper (Effect.catchAllCause(() => Effect.void))
  and swapped every bookkeeping .pipe(Effect.ignore) over to it.
  Effect.ignore only catches typed failures; a synchronous throw
  inside an adapter (e.g. storage-drizzle when the schema is missing
  the execution model) becomes a defect and was bypassing ignore.
  With silent, misconfigured storage just means no row — the
  execution itself succeeds.

Verified by the MCP stdio integration test which previously leaked
the [storage-drizzle] unknown model error into the MCP tool result
text. Now returns the expected code result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant