Repository navigation
0.1.8 Beta6: Implement generic Collaboration V2 over Chat Completions #394
Copy link
Copy link
Closed
Labels
P1Priority 1: current iteration goalPriority 1: current iteration goalcampaign:0.1.8-beta60.1.8 Beta6 usable Chat campaign0.1.8 Beta6 usable Chat campaigncampaign:gateway-chatGateway deep modules and Codex↔Chat bridgeGateway deep modules and Codex↔Chat bridgeenhancementNew feature or requestNew feature or requestready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agenttier:heavyOrchestrator provider tier: heavyOrchestrator provider tier: heavywayfinder:taskWayfinder implementation taskWayfinder implementation task
Description
Parent
Outcome
Implement the generic, reversible Collaboration V2 lifecycle over selected third-party Chat Completions endpoints.
This consumes the exact Beta4 runtime contract and the runtime-derived Chat matrix in #66. The Codex Client remains the agent owner/executor; the Gateway converts protocol shapes only.
Required behavior
- Preserve the six V2 direct function declarations and exact schemas through the Responses-to-Chat request boundary.
- Convert Chat tool calls and results back to the exact V2 function-call lifecycle with stable call/item identity and ordering.
- Preserve or reversibly adapt task identity, message/
agent_message, follow-up, wait/result, list/interrupt, history, replay, and progressive streaming. - Keep V1 repair, agent-ID scheduling, close/resume, and wait-result fabrication structurally unreachable from V2.
- Use one field/value-driven implementation for GLM-5.2, K2.7 Code, DeepSeek V4 Flash 0731, and unknown compatible Chat endpoints.
- If an essential semantic cannot be represented reversibly, fail before upstream sampling; do not silently downgrade, transcript-convert an active lifecycle, or retry another codec.
Acceptance criteria
- Deterministic fixtures cover declaration, call, result, history, and streaming for all six V2 tools.
- Task identity and
agent_messagesemantics survive the Chat round trip without V1 substitution. - Missing/duplicate IDs, mixed V1/V2 state, unknown aliases, malformed tool calls, and incompatible history fail visibly.
- Translation failure after streaming begins emits exactly one standard
response.failedterminal. - No Provider/model name selects production conversion behavior.
- No Responses/Official fallback, cross-Provider execution, Gateway agent creation, scheduling, or fabricated completion occurs.
Non-goals
- Chat Code Mode/custom/freeform, client
tool_search, arbitrary namespace tools, or provider-hosted tools beyond separately proven Chat contracts. - Cross-Home topology/history migration.
Blocked by
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1Priority 1: current iteration goalPriority 1: current iteration goalcampaign:0.1.8-beta60.1.8 Beta6 usable Chat campaign0.1.8 Beta6 usable Chat campaigncampaign:gateway-chatGateway deep modules and Codex↔Chat bridgeGateway deep modules and Codex↔Chat bridgeenhancementNew feature or requestNew feature or requestready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agenttier:heavyOrchestrator provider tier: heavyOrchestrator provider tier: heavywayfinder:taskWayfinder implementation taskWayfinder implementation task
Activity
CCanxue commentedon Aug 11, 2026
Useful reference for the
agent_messagesemantics you need to preserve: on DeepSeek (Responses), theagent_messageitem itself is dropped even when its content is plaintext; only a standardmessageitem is consumed reliably (verified with wire captures on codex-cli 0.146.0). So for third-party endpoints, converting the task to a plain user message is the representation that works, which is what our local patch does for non-OpenAI providers: https://github.com/CCanxue/codex-deepseek-subagent-fix6 remaining items
NOirBRight commentedon Aug 19, 2026
Starting Chat Collaboration V2 adapter against the #66 matrix: first slice is declaration + call identity through compatible_request_body then prepare_exchange.
NOirBRight commentedon Aug 19, 2026
Candidate implementation is on local
mainat3edaff6plus fail-closed deltae25d382(not pushed yet).Coverage:
agent_messageauthor/recipient/content through bound reversible envelopescompatible_request_body -> prepare_exchangewhile staying localVerification on exact
e25d382:Standards review found no hard violations. Spec review is still running before closeout.
NOirBRight commentedon Aug 19, 2026
Completed on local
mainat3edaff6+e25d382(ahead of origin; not pushed yet).Acceptance mapping:
tests/test_issue_394_chat_collaboration_v2.pyagent_messageinverse are request-scoped and deterministicresponse.failedVerification: focused strict 1,219 passed + 380 subtests; exact-SHA Python core 2,431 passed / 85 skipped / 508 subtests, with only the unchanged 62 Linux PowerShell/Windows launcher-release gaps; quality scan parse_errors=0. Standards review: no hard violations. Spec checklist: no blockers.
NOirBRight commentedon Aug 19, 2026
Reopened after #395 harness review found a live-path gap: TRANSPARENT_CONVERTED Chat SSE writes ChatToResponsesStreamConverter events directly without compatible_sse_line, so V2 aliases are not reverse-mapped on the production stream. Unit composition covered the two stages separately but not Handler wiring. Fixing with Handler integration coverage before closing again.
NOirBRight commentedon Aug 19, 2026
Reopened live-path gaps are fixed in
229e2a8,be80542, and6aedd33:TRANSPARENT_CONVERTEDChat SSE now performs runtime-tool inverse before writingresponse.failed, preserves response identity and boundedunknown_aliasclassification, and cannot later completeagent_messageshape (not a bare type tag); ADR-0002 records this continuation-only discriminator__main__module ascodex_proxy, preventing a duplicate event writer during late compatibility importsFinal focused suite: 609 passed + 129 subtests. Full Python core: 2,442 passed, 89 skipped, 508 subtests; 61 remaining failures are the unchanged Linux PowerShell/Windows launcher-release gaps. Quality scan parse_errors=0.
NOirBRight commentedon Aug 19, 2026
Final closeout after live-path review fixes: source through 6aedd33, no Standards or Spec blockers, final combined targeted 609 passed + 129 subtests, final full Python core 2,446 passed / 89 skipped / 508 subtests with only 61 known Linux PowerShell/Windows host gaps.
feat(gateway): adapt Collaboration V2 over Chat Completions (#394)
fix(gateway): fail closed on invalid Chat transport enums (#394)
fix(gateway): preserve V2 identity through live Chat streams (#394 #395)
fix(gateway): fail closed across V2 child stream boundaries (#394)
fix(gateway): preserve converted stream terminal contracts (#394)