feat(messages,agents): --live-fallback-mode + --parent-agent-id — agent-id-split refactor port#56
Merged
Merged
Conversation
…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>
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 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 viaparent_agent_idand 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
Design Dock: https://trydock.ai/workspaces/agent-id-split-refactor-2026-05-12
Backlog:
cmp2zi9tl001w04jxcxw3ank1Tests (6 new, all passing)
test_messages_send_live_fallback_mode_default_omitted— no flag → field absenttest_messages_send_live_fallback_mode_explicit_default_omitted— explicit-default symmetric with--mode autotest_messages_send_live_fallback_mode_live_only_passed_through— opt-in casetest_messages_send_live_fallback_mode_rejects_unknown— Click.Choice validationtest_agents_create_parent_agent_id_default_omitted— no flag → field absenttest_agents_create_parent_agent_id_passed_through— FK populated on wireLayer 4 PR stack
cueapi-secondary2 is driving the parallel cueapi-core + cueapi-python SDK ports.
🤖 Generated with Claude Code