Commit bd9b21b
authored
feat(layer-4): SDK additive — live_fallback_mode + parent_agent_id kwargs (cueapi #823 + #824 parity) (#44)
Agent-id-split refactor Layer 4 OSS-SDK additives. Hosted cueapi shipped
the substrate today (PR-A #823 schema + PR-B #824 router + PR-C #825
migration + #828 hotfix + PR-D #830 orphan-binding). cueapi-core OSS
substrate port is DEFERRED to a future sprint (Backlog row
cmp2zi9tl001w04jxcxw3ank1 — 4-layer dependency stack: agent_live_sessions
convergence → Surface 6 OSS → Lane 1 OSS → Layer 4 OSS); this PR ships
the additive SDK surface in parallel so hosted-cueapi users get the new
kwargs immediately. Graceful degradation: hosted accepts; cueapi-core
will 422 until precursors land.
## What ships
- **`MessagesResource.send(live_fallback_mode=None)`** — per-message
override for substrate's Live-fallback semantic. `"live_only"` queues
until target Live agent's session is heartbeating; `"fallback_to_background"`
falls through to Live-sibling's BG parent (via parent_agent_id) when
Live is silent. Default `None` omits the field from the wire body —
server applies its default (`"fallback_to_background"` per spec lock
22:11Z 2026-05-12).
- **`AgentsResource.create(parent_agent_id=None)`** — caller-supplied
`agt_<12alpha>` linking the new agent to a BG parent. `None` = BG
agent (default — canonical entry point for a project). Substrate
enforces same-tenant + 1-level hierarchy. When supplied without
explicit slug, substrate auto-derives `<parent_slug>-live` (collision-
suffix on per-user duplicates).
Both kwargs are PURELY ADDITIVE — wire format identical to pre-Layer-4
callers when omitted. Docstrings cross-link the Backlog row + flag the
hosted-vs-cueapi-core graceful-degradation contract explicitly so SDK
users understand the OSS gap.
## Tests (8 new across 2 files)
`tests/test_messages_resource.py::TestLiveFallbackMode` (3 tests):
- live_fallback_mode omitted when None ⇒ field absent on wire
- live_fallback_mode="live_only" passes through verbatim
- live_fallback_mode="fallback_to_background" passes through verbatim
`tests/test_agents_resource.py::TestCreate` (3 new in existing class):
- parent_agent_id omitted when None ⇒ field absent on wire
- parent_agent_id="agt_bg_parent" passes through verbatim
- parent_agent_id combines cleanly with slug + webhook_url + display_name
Full unit suite (161 tests): all pass.
## Companion artifacts
- Backlog row cmp2zi9tl001w04jxcxw3ank1 updated 2026-05-13 ~00:32Z with
explicit TRIGGER CONDITION (auto-pick-up when 3 OSS predecessors land)
+ LAST-VERIFIED EMPIRICAL STATE of cueapi-core (2 checks pinned for
clean restart context). Future agent reading the row sees exactly what
to verify before starting Layer 4 substrate port.
## cueapi-three-2 owns cli + mcp + action additives
This PR is the cueapi-python additive only. Per PM CTO call msg_8e7b5f47,
cli + mcp + action mirror additives are cueapi-three-2's lane. No overlap.1 parent 9669ccc commit bd9b21b
4 files changed
Lines changed: 186 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
51 | | - | |
| 65 | + | |
| 66 | + | |
52 | 67 | | |
53 | 68 | | |
54 | 69 | | |
| |||
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
61 | 82 | | |
62 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
90 | 104 | | |
91 | 105 | | |
92 | 106 | | |
| |||
117 | 131 | | |
118 | 132 | | |
119 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
120 | 141 | | |
121 | 142 | | |
122 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
51 | 117 | | |
52 | 118 | | |
53 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
209 | 286 | | |
210 | 287 | | |
211 | 288 | | |
| |||
0 commit comments