Skip to content

fix(openai-chat): bring openai-chat.ts back under its file-size cap - #5822

Merged
lidge-jun merged 2 commits into
devfrom
codex/openai-chat-size-ratchet
Sep 25, 2026
Merged

lidge-jun merged 2 commits into
devfrom
codex/openai-chat-size-ratchet

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

dev fails file-size ratchet: repository: #5804 left src/adapters/openai-chat.ts at 823 lines against its 822-line cap, so every branch cut from dev goes red on that test. The cap only moves down, so this moves code instead of raising it.

The freeform-tool lookup #5804 added is built by freeformToolsByWireName() in src/adapters/openai-chat/serialized-tool-call-content.ts, beside the echo matching that consumes it. The { name, namespace } shape repeated four times across both files is now one FreeformToolIdentity type. openai-chat.ts is back to 822 lines. Behavior is unchanged.

Verification

  • bun test tests/ci-workflows/file-size-ratchet.test.ts plus every openai-chat, chat tool-call, chat-compat, and MiMo test file (29 files): 462 pass, 0 fail.
  • tests/adapters/openai/openai-chat-serialized-tool-call-content.test.ts gains a case for freeformToolsByWireName(): only freeform tools are kept, keyed by wire name, with the declared name and namespace (42 pass).
  • bun x tsc --noEmit, bun run structure:check, bun run privacy:scan: pass.
  • Squash-merged without waiting for PR CI at the maintainer's request (CI backlog); the full suite runs on dev after merge.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (none needed; no behavior change)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (none touched)

#5804 left the adapter one line over its 822-line cap, failing the file-size ratchet on dev. The freeform-tool lookup it added now lives in serialized-tool-call-content.ts as freeformToolsByWireName(), beside the echo matching that uses it, and the repeated { name, namespace } shape is one FreeformToolIdentity type. No behavior change.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 25, 2026 05:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T05:29:17.331040Z 201b5fe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a51ae025-a405-41a2-8be7-cbf28b060f3a

📥 Commits

Reviewing files that changed from the base of the PR and between c0599d0 and 201b5fe.

📒 Files selected for processing (2)
  • src/adapters/openai-chat.ts
  • src/adapters/openai-chat/serialized-tool-call-content.ts
 ________________________________
< Goodbye, diff induced despair. >
 --------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun
lidge-jun merged commit fb20f0c into dev Sep 25, 2026
4 of 5 checks passed
@lidge-jun
lidge-jun deleted the codex/openai-chat-size-ratchet branch September 25, 2026 05:27
@github-actions github-actions Bot added the bug Something isn't working label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant