Commit c06508a
committed
fix(linear): correct agent-activity emit GraphQL selection + thread_id + result-omit (L4 review)
Apply the L4 emit review fix-list:
1. GraphQL selection: agentActivityCreate return selection requested a
non-existent scalar agentActivity.agentSessionId; Linear's schema exposes
only the relation agentSession: AgentSession!, so strict selection
validation server-rejected the whole mutation. Select agentSession { id }.
2. Consumer read (lockstep): _parse_message_from_agent_activity now reads the
session id None-safely off (activity.get("agentSession") or {}).get("id"),
keeping the raise-on-missing guard + message.
3. thread_id: _raw_message_from_source_comment encoded the routed thread id
with the source comment's parentId; upstream parseMessage and the adapter's
own read-path encode the comment's OWN id. Use comment_data["id"].
4. task_update action wire-shape: omit the result key when output is None
(upstream passes result: chunk.output string|undefined; JSON.stringify omits
undefined) instead of serializing "result": null.
5. Doc: correct the UPSTREAM_SYNC.md emit row to the fixed selection and note
the organizationId "" fallback divergence; keep the live-tenant hedge.
Tests (test_linear_agent_session_emit.py): fix the response fixture to emit
the agentSession relation; add thread_id own-id assertions (post + stream),
split the mislabeled final-flush test into the RuntimeError force-flush branch
and the AdapterError parse-failure branch, add the missing-agentSession
AdapterError case, bot-author nullish-precedence coverage, the _JS_WHITESPACE
NEL-retain / BOM-strip deltas, and the result-omit/include pair. Each
new/changed assertion verified to fail against the corresponding pre-fix code.1 parent 63658ee commit c06508a
3 files changed
Lines changed: 265 additions & 15 deletions
File tree
- docs
- src/chat_sdk/adapters/linear
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
688 | | - | |
| 688 | + | |
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
146 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
| |||
1253 | 1260 | | |
1254 | 1261 | | |
1255 | 1262 | | |
1256 | | - | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1257 | 1268 | | |
1258 | 1269 | | |
1259 | 1270 | | |
| |||
1354 | 1365 | | |
1355 | 1366 | | |
1356 | 1367 | | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1357 | 1371 | | |
1358 | 1372 | | |
1359 | 1373 | | |
1360 | | - | |
| 1374 | + | |
1361 | 1375 | | |
1362 | 1376 | | |
1363 | 1377 | | |
| |||
1953 | 1967 | | |
1954 | 1968 | | |
1955 | 1969 | | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
1956 | 1982 | | |
1957 | 1983 | | |
1958 | | - | |
1959 | | - | |
1960 | | - | |
1961 | | - | |
1962 | | - | |
1963 | | - | |
| 1984 | + | |
1964 | 1985 | | |
1965 | 1986 | | |
1966 | 1987 | | |
| |||
0 commit comments