Skip to content

feat(messages,agents): --live-fallback-mode + --parent-agent-id — agent-id-split refactor port#56

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

feat(messages,agents): --live-fallback-mode + --parent-agent-id — agent-id-split refactor port#56
mikemolinet merged 1 commit into
mainfrom
feat/agent-id-split-additive

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Additive port of the agent-id-split substrate refactor (2026-05-12) — two new optional flags on existing subcommands. Purely additive; wire format unchanged for pre-refactor senders.

Changes

messages send --live-fallback-mode <live_only|fallback_to_background>

Controls behavior when the recipient is a Live-sibling agent and its Live session is silent (no fresh heartbeat).

  • fallback_to_background — substrate looks up the BG sibling via parent_agent_id and routes there. Default. Matches substrate default per spec Q2 lean ("work should get done").
  • live_only — message queues against the Live agent until that specific Live session attaches.

CLI default-omits the field on the wire when value matches the substrate default. Same shape as --mode auto (Surface 6 v2).

agents create --parent-agent-id <agt_xxx>

Optional FK to a parent (BG-sibling) agent. Used when creating a Live sibling of an existing BG agent so substrate can fall back from Live to BG via the FK. Default-omits on the wire; standalone agents create with unchanged wire format.

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
Backlog: cmp2zi9tl001w04jxcxw3ank1

Tests (6 new, all passing)

  • test_messages_send_live_fallback_mode_default_omitted — no flag → field absent
  • test_messages_send_live_fallback_mode_explicit_default_omitted — explicit-default symmetric with --mode auto
  • test_messages_send_live_fallback_mode_live_only_passed_through — opt-in case
  • test_messages_send_live_fallback_mode_rejects_unknown — Click.Choice validation
  • test_agents_create_parent_agent_id_default_omitted — no flag → field absent
  • test_agents_create_parent_agent_id_passed_through — FK populated on wire

Layer 4 PR stack

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

cueapi-secondary2 is driving the parallel cueapi-core + cueapi-python SDK ports.

🤖 Generated with Claude Code

…t-id-split refactor 2026-05-12)

Additive port of the agent-id-split substrate refactor — two new flags
on existing subcommands, no breaking changes.

`messages send`:
- `--live-fallback-mode <live_only|fallback_to_background>`
- Default `fallback_to_background` (matches substrate default per
  spec Q2 lean — "work should get done")
- CLI omits the field on the wire when value matches the substrate
  default → wire format unchanged for pre-refactor senders. Same
  default-omit pattern as `--mode auto` (Surface 6 v2).

`agents create`:
- `--parent-agent-id <agt_xxx>`
- Optional FK to a parent (BG-sibling) agent. Substrate uses it for
  the Live → BG fallback path when a Live-sibling agent's session is
  silent.
- Default-omits on the wire when None → standalone agents create
  with unchanged wire format.

6 new tests in tests/test_cli.py:
- live_fallback_mode default omitted
- live_fallback_mode explicit-default omitted (symmetric with --mode auto)
- live_fallback_mode=live_only passed through as body field
- live_fallback_mode rejects unknown values (Click.Choice validation)
- parent_agent_id default omitted
- parent_agent_id passed through as body field

All 6 pass locally; pre-existing Pyright `_FakeResp` redeclaration
warnings unchanged (pattern across the test file).

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 1 of 3 in the Layer 4 SDK additive port:
- PR 1 (this): cueapi-cli
- PR 2 (next): cueapi-mcp tool schemas
- PR 3 (next): cueapi-action flag forwarding

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@govindkavaturi-art govindkavaturi-art enabled auto-merge (squash) May 13, 2026 00:25
@mikemolinet mikemolinet merged commit e47476a into main May 13, 2026
5 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