feat(send_message,agents): live_fallback_mode + cueapi_create_agent w/ parent_agent_id — agent-id-split refactor port#37
Merged
Conversation
…/ parent_agent_id (agent-id-split refactor 2026-05-12) Additive port of the agent-id-split substrate refactor. `cueapi_send_message`: - New optional field `live_fallback_mode: 'live_only' | 'fallback_to_background'` - Default-omit on wire when value matches the substrate default (`fallback_to_background`); pre-refactor senders see unchanged wire format. Same default-omit shape as `mode: 'auto'`. `cueapi_create_agent` (NEW tool — additive write surface on agents): - display_name (required), slug, webhook_url, metadata, parent_agent_id - Mirrors cueapi-cli `agents create --parent-agent-id` (#56) and the substrate POST /v1/agents schema. - `parent_agent_id` is the new FK field for the agent-id-split refactor: pass the BG sibling's id when creating a Live sibling so substrate can fall back from Live to BG via this link when the Live session is silent. - Historical "agents are read-only via MCP" stance lifted only for create (the workflow that needs `parent_agent_id` exposed); update and delete remain dashboard-only for now. 9 new tests (158/158 total pass): - live_fallback_mode default-omitted, explicit-default-omitted, live_only pass-through, Zod-enum rejects unknown - cueapi_create_agent: minimal POST → /v1/agents, parent_agent_id default-omit, parent_agent_id pass-through, webhook_url+metadata pass-through, display_name required (Zod gate) Substrate spec: - live_fallback_mode: Optional[Literal['live_only','fallback_to_background']] = 'fallback_to_background' - parent_agent_id: Optional[String] (FK to agents.id) Design Dock: https://trydock.ai/workspaces/agent-id-split-refactor-2026-05-12 Backlog: cmp2zi9tl001w04jxcxw3ank1 Part 2 of 3 in the Layer 4 SDK additive port (PR 1: cueapi-cli #56; PR 3 next: cueapi-action flag forwarding). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Additive port of the 2026-05-12 agent-id-split substrate refactor — one new field on
cueapi_send_message+ one new toolcueapi_create_agentwith the new FK exposed.Changes
cueapi_send_message—live_fallback_modeOptional enum
'live_only' | 'fallback_to_background'. Default-omit on the wire when value matches substrate default (fallback_to_background) so pre-refactor senders see unchanged wire format. Same default-omit shape asmode: 'auto'.fallback_to_background— substrate looks up the BG sibling viaparent_agent_idand routes there when the Live session is silent. Default.live_only— message queues against the Live agent until that specific Live session attaches.cueapi_create_agent(NEW tool)Additive write surface on agents. Mirrors
cueapi-cli agents create(#56) and substrate POST/v1/agents. Exposesparent_agent_idfrom day 1.Fields:
display_name(required)slug,webhook_url,metadata(optional, pass-through)parent_agent_id— optional FK to a parent (BG-sibling) agent for the agent-id-split refactorThe historical "agents are read-only via MCP" stance is lifted only for create — the workflow that needs
parent_agent_idexposed. Update and delete remain dashboard-only for now.Substrate contract pin
Design Dock: https://trydock.ai/workspaces/agent-id-split-refactor-2026-05-12
Tests (9 new, 158/158 passing)
live_fallback_mode:
mode: 'auto')live_onlypass-throughcueapi_create_agent:
/v1/agentsparent_agent_iddefault-omitparent_agent_idpass-through (Live-sibling create scenario)webhook_url+metadatapass-throughdisplay_namerequired (Zod gate)Layer 4 PR stack
🤖 Generated with Claude Code