Repository navigation
fix(bots): keep model limits for codex bots and budget history - #185
Merged
Merged
Conversation
Codex bots replaced the model metadata with the title-generation catalog, which has no context_window and no auto_compact_token_limit, so Codex never auto-compacted long bot conversations. The bot catalog now starts from the instance's real entry (`codex debug models`) and overrides only the fields that add local tools, with a conservative fallback window and compaction limit. A rebuilt bot session sent the whole transcript as its first input. The gateway now gives history about half of a default 128k window, keeps the newest messages that fit with a marked omission note, and always keeps the current input whole.
This was referenced Nov 13, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 18, 2026
The Slack PNG was stored correctly, but the bot catalog declared the configured Codex model text-only. Codex removed the image block from the tool result before inference. Keep an advertised image modality and follow Codex's text-and-image default when modality metadata is absent. Explicitly text-only models retain their declared limit. Bot tool isolation remains in force. ## Verification - The official Codex app-server test runs against a local Responses endpoint and verifies both a user-uploaded image and an image fetched by the bot's connector in the outgoing inference requests. - Catalog and isolation tests passed locally. Worker typecheck and scoped lint passed. - Required CI covers the repository gate. The production Slack read will be verified after the corrected Nightly is installed. Fixes: #185 Related: #987
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex bots now keep the model's real context limits, so long bot conversations compact instead of overflowing. Rebuilt bot sessions get a bounded history.
Cause. Codex bots were launched with the minimal catalog written for title generation,
codexTextCatalog. Throughmodel_catalog_jsonit replaced the model's metadata.codex debug modelswith that catalog reportscontext_window: null,auto_compact_token_limit: null, a 10 kB truncation policy and the base instructions "Generate only the requested text.". Without a window, Codex has no compaction threshold.Codex bot catalog (
apps/worker/src/bots/codex-catalog.ts)codex debug models, using the bot's executable, environment andCODEX_HOME.use_responses_liteis forced off, so tool schemas stay intoolsand the isolation capture still sees every one of them.History budget (
apps/gateway/src/bots/history-budget.ts)Tests
tests/integration/bots-harness-context.test.ts(gateway↔worker, scripted Codex CLI):apps/worker/src/bots/codex-catalog.test.ts: the realcodexaccepts both the derived catalog and the fallback catalog.isolation.test.tspasses unchanged with the real Claude, Codex and Grok CLIs.check:tmp: 1204 passed, 154 skipped, 0 failed.Not verified
Docs:
docs/bots-harness.md.Copy audit: no UI text changed.
Fixes: #97