Skip to content

chore(compat): remove dead chat_response_to_messages_response#6

Merged
ax128 merged 1 commit into
mainfrom
chore/remove-dead-chat-to-messages-mapper
Jun 14, 2026
Merged

chore(compat): remove dead chat_response_to_messages_response#6
ax128 merged 1 commit into
mainfrom
chore/remove-dead-chat-to-messages-mapper

Conversation

@ax128

@ax128 ax128 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Removes the unused chat_response_to_messages_response function and its sole consumer _ANTHROPIC_STOP_REASON_MAP from aegisgate/adapters/openai_compat/mapper.py.

Why

  • Zero references anywhere in the tree (grep over *.py; not in any __all__; no dynamic/getattr use). The live non-stream messages←responses path uses responses_response_to_messages_response, not this Chat-based variant.
  • The dead function is also latently buggy: it emits a text-only content block and silently drops tool_calls, and hardcodes a stop-reason map that ignores tool_calls. Leaving it invites accidental future wiring that would re-introduce a tool-loop break.

Scope

Pure dead-code deletion — single file, 41 deletions, no behavior change, no interface/shape change.

Validation

  • grep confirms no remaining references to either symbol.
  • ruff check mapper.py clean; mypy mapper.py → Success.
  • Full local suite: 943 passed, 10 skipped — byte-for-byte identical to main. The one failing test (test_doc_alignment::test_filter_class_count_matches_docs) is pre-existing on main (reproduced there), caused by untracked local test fixtures (DummyFilter etc.) polluting the BaseFilter subclass count when the full on-disk suite runs; it passes in isolation and is not in the CI-tracked path. Not introduced by this PR.
  • Remote CI (3.10/3.12/3.13): pending — not yet observed.

🤖 Generated with Claude Code

chat_response_to_messages_response and its sole consumer
_ANTHROPIC_STOP_REASON_MAP have zero references in the tree (grep-confirmed,
not in __all__, no dynamic use). The function was also latently buggy — it
drops tool_calls and emits a text-only block — so removing it prevents
accidental future wiring. Pure dead-code deletion; no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ax128 ax128 merged commit 46a7d19 into main Jun 14, 2026
3 checks passed
@ax128 ax128 deleted the chore/remove-dead-chat-to-messages-mapper branch June 14, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant