Routines API: partial update containing job_config replaces the whole job_config (drops events/prompt, model, sources)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 4, 2026

Environment

Claude Code routines (research preview), /v1/code/triggers API. Observed 2026-08-04.

Summary

POST /v1/code/triggers/{trigger_id} is documented/behaves as a partial update at the top level (e.g. sending only {"enabled": false} works as expected). But sending a body containing job_config — even one carrying only job_config.ccr.environment_id — replaces the ENTIRE stored job_config: the response comes back with events (the prompt), session_context.model, and session_context.sources gone. A routine silently loses its prompt this way; the next scheduled fire would run an empty/undefined task.

Reproduction

  1. Create a routine with a full job_config.ccr (environment_id, session_context{model, sources}, events[prompt]).
  2. POST /v1/code/triggers/{id} with body {"job_config": {"ccr": {"environment_id": "env_..."}}} intending to switch environments.
  3. Response job_config.ccr now contains only environment_id plus a server-filled session_context.allowed_toolsevents, model, and sources are gone. (Recovered by re-sending the complete job_config.)

Expected

Either deep-merge semantics for job_config consistent with the top-level partial-update behavior, or a validation error when a partial job_config would drop events — silently discarding the prompt is the worst outcome. A note in the API reference about replace-vs-merge semantics per field would also prevent this.

Related docs gap

The trigger objects returned by the API include a persist_session field that appears in no documentation (routines page, cloud-environments page, routines-fire API reference); documenting its semantics would help API consumers.

View original on GitHub ↗