Skip to content

feat(send_message,agents): live_fallback_mode + cueapi_create_agent w/ parent_agent_id — agent-id-split refactor port#37

Merged
mikemolinet merged 1 commit into
mainfrom
feat/agent-id-split-additive
May 13, 2026
Merged

feat(send_message,agents): live_fallback_mode + cueapi_create_agent w/ parent_agent_id — agent-id-split refactor port#37
mikemolinet merged 1 commit into
mainfrom
feat/agent-id-split-additive

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Additive port of the 2026-05-12 agent-id-split substrate refactor — one new field on cueapi_send_message + one new tool cueapi_create_agent with the new FK exposed.

Changes

cueapi_send_messagelive_fallback_mode

Optional 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 as mode: 'auto'.

  • fallback_to_background — substrate looks up the BG sibling via parent_agent_id and 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. Exposes parent_agent_id from 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 refactor

The historical "agents are read-only via MCP" stance is lifted only for create — the workflow that needs parent_agent_id exposed. Update and delete remain dashboard-only for now.

Substrate contract pin

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

Tests (9 new, 158/158 passing)

live_fallback_mode:

  • default-omitted
  • explicit-default-omitted (symmetric with mode: 'auto')
  • 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 (Live-sibling create scenario)
  • webhook_url + metadata pass-through
  • display_name required (Zod gate)

Layer 4 PR stack

# Repo Status
1 cueapi-cli #56 open
2 cueapi-mcp (this PR) open
3 cueapi-action flag forwarding next

🤖 Generated with Claude Code

…/ 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>
@mikemolinet mikemolinet merged commit f29c97d into main May 13, 2026
2 checks passed
@mikemolinet mikemolinet deleted the feat/agent-id-split-additive branch May 13, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant