Skip to content

Extract protocol_translation.py seam for Responses and Chat conversion #25

Closed

Description

@NOirBRight

Problem

Responses ↔ Chat Completions conversion logic is still embedded inside src-python/codex_proxy.py, which makes protocol fixes risky. External audit reconciliation confirmed protocol conversion is one of the highest-risk correctness areas and should get a pure, testable seam before broad behavior changes.

Scope

  • Extract pure conversion functions/classes from src-python/codex_proxy.py into src-python/protocol_translation.py or equivalent.
  • Keep public behavior unchanged in this issue unless required to preserve tests.
  • Add focused tests around the extracted seam before semantic fixes land.

Acceptance Criteria

  • Existing conversion call sites delegate to the extracted module.
  • Unit tests cover representative Chat→Responses, Responses→Chat, and stream conversion cases.
  • No broad retry/transport/routing behavior changes are mixed into this extraction.
  • Full Python suite remains green.

Required Verification

python -m pytest tests/test_chat_completions_gateway.py tests/test_routing.py
python -m pytest

Related

Activity

  1. added
    needs-triageMaintainer needs to evaluate this issue
    enhancementNew feature or request
    ready-for-agentFully specified, ready for an AFK agent
    and removed
    needs-triageMaintainer needs to evaluate this issue
    on Jul 9, 2026
  2. NOirBRight commented on Jul 9, 2026

    @NOirBRight
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: Extract a pure protocol translation seam before broad semantic fixes.

    Current behavior:
    System.Collections.Hashtable.Current

    Desired behavior:
    System.Collections.Hashtable.Desired

    Key interfaces:

    • Responses-to-Chat body conversion
    • Chat-to-Responses body conversion
    • Stream event conversion

    Acceptance criteria:

    • Call sites delegate to the extracted seam.
    • Representative conversion tests pass before and after extraction.
    • No transport/retry/routing behavior is changed.

    Out of scope:

    • Do not fix all semantic loss in the extraction PR.
    • Do not mix reconnect diagnostics changes into this issue.
  3. self-assigned this
    on Jul 12, 2026
  4. NOirBRight commented on Jul 12, 2026

    @NOirBRight
    OwnerAuthor

    Dispatch

  5. NOirBRight commented on Jul 12, 2026

    @NOirBRight
    OwnerAuthor

    Merged PR 98 into dev at 051bc9a. Standards/spec review passed with no P0-P2 findings; all four CI jobs passed. The extraction unlocks Issue 26 and provides the protocol seam consumed by Issues 61 and 66.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions