Repository navigation
fix(codex): accept multi-line inline tables in Codex config.toml - #4436
JerrettDavis merged 8 commits into
Conversation
PR governanceThis PR follows the template and is marked ready for human review. |
| return cast("dict[str, Any]", tomllib.loads(content)) | ||
| except tomllib.TOMLDecodeError as exc: | ||
| try: | ||
| return tomlkit.parse(content).unwrap() |
There was a problem hiding this comment.
🔴 Multiline profile overrides lose their provider
For multiline inline profiles, loads_codex_config now admits nested provider keys that provider setup mistakes for root keys. Init and persistent install delete them; persistent wrap rewrites them. The affected profile loses its selected provider.
Learn more
Codex config may define a profile inside a multiline inline table rather than a [profiles.work] section. The fallback accepts this TOML 1.1 syntax. Root splitting and _strip_root_provider_assignments then mistake indented entries inside that inline table for document-root assignments and delete them. _redirect_existing_top_level_keys also matches the nested line; it replaces its provider, consumes its trailing comma, and _has_redirectable_top_level_key prevents insertion of a root model_provider key. These writes pass the new syntax check but alter the user's profile.
Example: With profiles = {\n work = {\n model_provider = "company",\n },\n}\n, headroom init codex removes work.model_provider rather than preserving the company profile. Persistent wrap rewrites that setting to headroom and treats the original nested key as a root declaration.
Recommended fix: Identify root assignments using parsed TOML structure or a tokenizer that tracks inline-table scope, rather than line-based matching. Apply that scope check to init, provider-scope install, and persistent wrap, and test that each leaves multiline inline profile overrides unchanged.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Good catch, I reproduced it: with a multi-line profiles = { table, init and the provider-scope install dropped work.model_provider, and persistent wrap rewrote it to headroom and then skipped adding a real root key. Fixed in dc19387. I added root_assignment_lines() in config_toml.py, which tracks quotes, comments and bracket depth so it only reports lines that are real root assignments, and init, install and both wrap helpers now use it instead of plain line matching. Wrap is also scoped to the root now, so a [profiles.work] section override is no longer rewritten either. There are regression tests for each path (init, install, wrap) plus a unit test for the scanner.
| "pyyaml>=6.0", # omp wrap: parse/merge omp's models.yml registry | ||
| "tomli>=2.0.0; python_version < '3.11'", # tomllib backport for helper scripts | ||
| "tomlkit>=0.13.0,<1.0", # Loss-minimizing Codex config recovery | ||
| "tomlkit>=0.15.0,<1.0", # Loss-minimizing Codex config recovery |
There was a problem hiding this comment.
🔍 Dependency review context is incomplete
The tomlkit bump explains the required parser behavior but omits maintainer and install-surface details required by dependency policy. Add those details for the dependency review.
Was this helpful? React with 👍 or 👎 to provide feedback.
JerrettDavis
left a comment
There was a problem hiding this comment.
The latest head fixes the earlier multiline-profile issue and passes all 54 selected parser/install/registry tests. I read the inline discussion and verified a remaining quoted-data corruption case in the new scanner.
[P2] Split scanner/rewrite input only on TOML line endings, not Python's full splitlines() character set. root_assignment_lines and its rewrite callers use splitlines(keepends=True), which also splits at Unicode U+2028. TOML permits that character inside a single-line quoted value. The scanner then forgets the single-line quote context at this artificial boundary and reports text within the value as a root assignment.
Exact reproduction: s = "notes = 'hello" + chr(0x2028) + 'model_provider = "company"' + chr(0x2028) + "world'\n". loads_codex_config(s) correctly parses one notes value. root_assignment_lines(s) returns {0,1,2}; _redirect_existing_top_level_keys(s,8787) changes the notes value to 'hello<U+2028>model_provider = "headroom" # was: companyworld'. The rewritten file still parses, so the final validation does not catch the unrelated user-data modification. No actual root model_provider existed.
Please use consistent TOML LF/CRLF boundaries across the scanner and all rewrite callers (or a parser-backed assignment location), and cover U+2028/U+0085 quoted values that contain provider-looking text. The configuration preservation contract must hold for valid Unicode strings too. The standalone reproduction and all focused tests ran in an isolated Windows checkout; no contributor logic was modified or merged, and no contributor CI action is requested.
|
@JerrettDavis good catch, thanks. I reproduced it with your exact string before changing anything: Fixed in 1c33784. I added a small
The marker block helpers were worth switching too: they split with New tests cover a quoted value with provider-looking text after U+2028 and U+0085 in the wrap redirect, init provider and feature flag paths, provider-scope install, and |
JerrettDavis
left a comment
There was a problem hiding this comment.
Reviewed the new Unicode line-boundary fix and author response, then cleanly merged current upstream/main (a616232) without changing contributor logic. Qualified head: 78f8cd3.
The scanner and rewrite callers now share LF/CRLF-only line boundaries, so U+2028/U+2029/U+0085 within quoted TOML values remain data and cannot expose fake root provider assignments. The added preservation and CRLF regressions cover the previous finding. No remaining blocker found in this delta.
Validation after main sync: 281 tests passed across Codex config parsing, wrap, init, install, and MCP registrar suites; Ruff 0.17.0 lint/format and git diff --check passed. Tests used the existing local native extension, not a fresh native build. Hosted CI is separate; inherited main failures are not attributed to this PR. No merge into main performed.
JerrettDavis
left a comment
There was a problem hiding this comment.
The hosted lint run revealed a PR-local typing issue that my earlier Ruff and runtime checks did not cover, so I am correcting the approval. The Unicode preservation fix remains validated by 281 passing focused tests.
Please fix headroom/providers/codex/config_toml.py:30: loads_codex_config declares dict[str, Any], but tomlkit.parse(content).unwrap() is typed as Any in the CI environment. The required mypy step reports Returning Any from function declared to return "dict[str, Any]" [no-any-return] (CI run 40080643959, lint job 120833434304). Narrow/cast the validated parser result consistently with the tomllib branch, and verify the repository mypy command. No change to parsing behavior is needed.
This is a finding in the PR's added module, not an inherited main audit failure. Separately, the inspected Linux wheel-build log failed fetching its Docker image with HTTP 503; that infrastructure failure is not the basis for this change request. I will handle CI authorization; no contributor CI action is requested.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@JerrettDavis thanks for catching that. Fixed in 10a7f89. The tomlkit fallback now goes through the same |
JerrettDavis
left a comment
There was a problem hiding this comment.
The tomlkit fallback cast resolves my previous no-any-return finding while preserving parsing behavior. I reviewed the contributor reply and new commit; the focused Codex/config/install/MCP/CLI suite passed all 281 tests, and the corrected helper passed the local mypy return check.
Current main is included and whitespace checks pass. All current-head workflows are terminal, with 67 successful checks and 12 skipped, no failures or approval gates remaining; GitHub reports MERGEABLE. Approval restored for human merge review. No merge performed.
…ine-inline-table # Conflicts: # pyproject.toml # uv.lock
|
Merged current main to clear the pyproject.toml / uv.lock conflict from #4517. I took main's side of both files and kept only this PR's |
JerrettDavis
left a comment
There was a problem hiding this comment.
Re-reviewed synced head f61a83d and the existing discussion. Contributor TOML parsing/writing fixes are preserved; the previous typing correction remains intact. Root-only provider configuration and the shared multiline-inline-table fallback continue to be covered across init, wrap, install, and MCP registration.
Fresh validation: 281 focused configuration/CLI/install/registration tests passed with the native extension present; Ruff and whitespace checks pass. Current main 4288fbd is an ancestor and GitHub reports MERGEABLE. Current-head hosted checks are terminal without failures, including wheel smoke imports, native Docker E2E, and all four Python shards. No claim of a live authenticated Codex session is made.
Restoring approval for final human merge review. Only main was synced; contributor implementation was preserved. Nothing merged into main.
🤖 I have created a release *beep* *boop* --- ## [0.43.0](v0.42.0...v0.43.0) (2026-11-05) ### ⚠ BREAKING CHANGES * **mcp:** port MCP servers to SDK 2.x ([#4603](#4603)) ### Features * **ccr:** answer headroom_retrieve on streaming chat completions ([#4631](#4631)) ([31dcaf4](31dcaf4)) * **mcp:** port MCP servers to SDK 2.x ([#4603](#4603)) ([ee2252a](ee2252a)) * **plugins:** headroom skill for Claude Code, Codex, Copilot and skills.sh ([#4533](#4533)) ([66e1467](66e1467)) * **savings:** show the proxy's model-routing savings in headroom savings ([#4304](#4304)) ([aaab338](aaab338)) ### Bug Fixes * [BUG] A timeout in one image compression call resets the shared worker pool and affects concurrent requests ([#4528](#4528)) ([e9bcfe7](e9bcfe7)) * [BUG] DirectMem0Adapter.search_memories calls removed mem0 search API ([#4518](#4518)) ([d9cee45](d9cee45)) * [BUG] Saved request metrics lose their cache optimization fields ([#4584](#4584)) ([b4c9bdf](b4c9bdf)) * [BUG] Volatile SQLite metrics stores lose their schema before the first save ([#4633](#4633)) ([d8ff0fe](d8ff0fe)) * Add info about apply to README.md ([#1592](#1592)) ([4d34680](4d34680)) * **backends/litellm:** keep cache_control on text blocks for Bedrock prompt caching ([#4565](#4565)) ([23a5bb1](23a5bb1)) * **backends:** forward the standard service_tier param (litellm + anyllm) ([#2468](#2468)) ([62cc38a](62cc38a)) * **cache:** build semantic entry before evicting so a failed embedding keeps live entries ([#4581](#4581)) ([0d4c450](0d4c450)) * **cache:** count a tool_result with no text as replayable in the frozen prefix ([#4523](#4523)) ([fba09f6](fba09f6)) * **cache:** fail closed on SQLite corruption instead of deleting the store online ([#4361](#4361)) ([9801833](9801833)) * **cache:** invalidate configured registry instances on replacement ([#4363](#4363)) ([1bcdca2](1bcdca2)) * **cache:** namespace SemanticCacheLayer by provider, model and metadata ([#4473](#4473)) ([99cdaaf](99cdaaf)) * **cache:** preserve OpenAI tool block metadata on cached replay ([#4334](#4334)) ([f1035ac](f1035ac)) * **cache:** scope router results to request compression policy ([#4590](#4590)) ([5d40fe7](5d40fe7)) * **ccr:** buffer a stream only for a marker new this turn ([#4607](#4607)) ([946a70c](946a70c)) * **ccr:** keep proactive expansion out of the cached prefix ([#4300](#4300)) ([b1f340e](b1f340e)) * **cli:** document that code-aware compression is enabled by default ([#4616](#4616)) ([affd17c](affd17c)) * **client:** close upstream responses when wrapped streams are closed ([#4482](#4482)) ([3d8dcf4](3d8dcf4)) * **client:** honor configured cache optimizer enablement ([#4501](#4501)) ([d4c0810](d4c0810)) * **client:** preserve Anthropic create stream flags ([#4500](#4500)) ([3910caa](3910caa)) * **codex:** accept multi-line inline tables in Codex config.toml ([#4436](#4436)) ([4a851ed](4a851ed)) * **compaction:** reject negative dictionary indices and non-array legends in expand_compacted ([#4470](#4470)) ([3c1fcbd](3c1fcbd)) * **core:** case-insensitive Bearer scheme, clamp SQLite CCR TTLs, redact the Redis URL in logs ([#4561](#4561)) ([9e8cc64](9e8cc64)) * **dedup:** bound line-number digit run and never fold into a longer pointer ([#4488](#4488)) ([21e8867](21e8867)) * **deps:** clear the glob and minimatch npm audit findings ([#4599](#4599)) ([2e49e53](2e49e53)) * **diff:** keep combined-diff changes made against a later parent ([#4318](#4318)) ([4b788fd](4b788fd)) * **docker:** install the redis extra in every image ([#4514](#4514)) ([8d5dde7](8d5dde7)) * **docker:** pass RUNTIME_HOME=/root for root bake targets ([#4445](#4445)) ([670767e](670767e)) * **doctor:** detect root openai_base_url Codex routing and agent-configured proxy ports ([#4490](#4490)) ([222f2d1](222f2d1)) * **evals:** reject changed numeric probe values ([#4502](#4502)) ([1fe8549](1fe8549)) * **install:** stabilize Windows task lifecycle and eliminate console window popup ([#4627](#4627)) ([6b903cb](6b903cb)) * **install:** tolerate absent Windows tasks in stop_supervisor ([#4465](#4465)) ([#4468](#4468)) ([50af2ff](50af2ff)) * **kompress:** keep words past the tokenizer's truncation point ([#4328](#4328)) ([bb13384](bb13384)) * **kompress:** read the pinned snapshot from Python's one HF cache in the native proxy ([#4438](#4438)) ([eef44f6](eef44f6)) * **langgraph:** replace the compressed ToolMessage in graph state ([#4620](#4620)) ([70a8f09](70a8f09)) * **mcp:** confine headroom_read to the workspace (GHSA-8g49-pg6g-xgrf) ([#4525](#4525)) ([8ab2e91](8ab2e91)) * **memory:** bound verb-pattern word runs to stop quadratic backtracking in bridge import ([#4370](#4370)) ([#4376](#4376)) ([d232d09](d232d09)) * **memory:** fail close unresolved project operations ([#2637](#2637)) ([957ab18](957ab18)) * **memory:** keep learned evidence until persistence succeeds ([#4229](#4229)) ([662a7f6](662a7f6)) * **memory:** preserve parent scopes when clearing memories ([#4305](#4305)) ([a8375a1](a8375a1)) * **mixed-content:** do not carve ISO-timestamped log rows as search results ([#4463](#4463)) ([abbade9](abbade9)) * **offline:** guard the learn and memory-eval LLM calls under HEADROOM_OFFLINE ([#4344](#4344)) ([dd361bb](dd361bb)) * **openclaw/release:** ship responsive npm integrations ([#1458](#1458)) ([33f2044](33f2044)) * **openclaw:** record turn advancements as one marker file per key ([#4212](#4212)) ([24acbe8](24acbe8)) * **opencode:** only route POST requests to LLM endpoint paths ([#4464](#4464)) ([336d462](336d462)) * **opencode:** route Copilot Claude models through the proxy ([#4594](#4594)) ([3d9a6f2](3d9a6f2)) * **output-savings:** rewrite a pre-rule ledger once instead of warning on every /stats poll ([#4196](#4196)) ([96e81ac](96e81ac)) * **packaging:** rename the sandbox extra to lean and correct SECURITY.md claims ([#3727](#3727)) ([09b7e8c](09b7e8c)) * **packaging:** use direct CLI module entry point ([#2665](#2665)) ([2892214](2892214)) * **pipeline:** store the pipeline input in CCR behind offload markers ([#4576](#4576)) ([4d7765c](4d7765c)) * **pricing:** add Claude Haiku 5.5 rates, 1M context and its 100K long-prompt card ([#4037](#4037)) ([703755e](703755e)) * **privacy:** turn off Mem0's PostHog telemetry by default ([#4619](#4619)) ([fe69f38](fe69f38)) * **providers:** isolate resolved Anthropic context limits ([#4593](#4593)) ([51258ef](51258ef)) * **proxy/memory:** harden _extract_tool_calls against malformed choices and blocks ([#2483](#2483)) ([effa5a5](effa5a5)) * **proxy:** allow loopback-published container hosts to access /debug/memory ([#4259](#4259)) ([e546e71](e546e71)) * **proxy:** answer /api/hello probes behind the token gate, log rejection context ([#4150](#4150)) ([673831a](673831a)) * **proxy:** cap cache_control breakpoints on OpenAI chat path ([#4471](#4471)) ([#4491](#4491)) ([55602fc](55602fc)) * **proxy:** do not book Gemini countTokens as a request outcome ([#4412](#4412)) ([4d2dd62](4d2dd62)) * **proxy:** don't fail startup when libc_ver() can't read the interpreter ([#4519](#4519)) ([28172a9](28172a9)) * **proxy:** forward Copilot accounting headers on streaming path ([#4431](#4431)) ([66023a0](66023a0)) * **proxy:** handle ClientDisconnect in anthropic_messages ([#3532](#3532)) ([251d149](251d149)) * **proxy:** honor x-headroom-base-url on provider passthrough routes ([#4596](#4596)) ([5c8772b](5c8772b)) * **proxy:** install SOCKS support for websocket proxies ([#3357](#3357)) ([79181ca](79181ca)) * **proxy:** keep Gemini memory context on entries with non-text parts ([#4506](#4506)) ([35a2b76](35a2b76)) * **proxy:** keep health probes and the Codex attestation out of the proxy log ([#4611](#4611)) ([78736a1](78736a1)) * **proxy:** keep read maturation out of the provider-confirmed prefix ([#4522](#4522)) ([526e06b](526e06b)) * **proxy:** keep tool deferral on Copilot Business/Enterprise/Individual hosts ([#4608](#4608)) ([be456d4](be456d4)) * **proxy:** log unknown model ids as one bounded token; skip unparseable PERF lines ([#4374](#4374)) ([c014bd6](c014bd6)) * **proxy:** preserve response cache keys across in-place hooks ([#4457](#4457)) ([03590cd](03590cd)) * **proxy:** recognise every local spelling of the proxy in the cc-switch loop guard ([#4405](#4405)) ([d9958bf](d9958bf)) * **proxy:** reconcile Chat content-block cache markers after prefix replay ([#4333](#4333)) ([35ca9b8](35ca9b8)) * **proxy:** route /v1/models to the x-headroom-base-url upstream ([#4308](#4308)) ([6ef52c2](6ef52c2)) * **proxy:** skip memory-context search in cache mode on OpenAI routes ([#4632](#4632)) ([365f6fe](365f6fe)) * **proxy:** skip memory-context search on OpenAI paths in cache mode ([#4634](#4634)) ([3654037](3654037)) * **proxy:** skip the memory-context search in cache mode ([#4606](#4606)) ([053925b](053925b)) * **proxy:** strip only one leading space from SSE field values ([#4306](#4306)) ([9226eaf](9226eaf)) * **proxy:** strip upstream transport framing headers from Gemini response replays ([#4605](#4605)) ([dfcac78](dfcac78)) * **read-lifecycle:** keep Reads fresh after a failed Edit or Write ([#4461](#4461)) ([4c3799f](4c3799f)) * **relevance:** cap embedding batch size so ORT's arena stays small ([#4507](#4507)) ([a2d4fe7](a2d4fe7)) * **relevance:** hand the embedding arena back after each run on macOS ([#4567](#4567)) ([2363f83](2363f83)) * **relevance:** load the Rust default embedder from Python's pinned snapshot ([#4190](#4190)) ([9bb4b13](9bb4b13)) * **router:** keep small shell results verbatim ([#3590](#3590)) ([#4426](#4426)) ([4ee6164](4ee6164)) * **router:** preserve read protection for quiet sed options ([#4521](#4521)) ([312ffec](312ffec)) * **router:** validate lossless provider output on the excluded-tool path ([#4486](#4486)) ([9f068a6](9f068a6)) * **scripts:** resolve hooks dir via git so install-git-hooks works in linked worktrees ([#4176](#4176)) ([0f4275f](0f4275f)) * **sdk:** carry Vercel AI SDK reasoning parts and provider options through compression ([#4564](#4564)) ([a26faae](a26faae)) * **sdk:** send Anthropic messages to /v1/compress natively so thinking blocks survive ([#4489](#4489)) ([cd5e2b9](cd5e2b9)) * **security:** lstat before narrowing sqlite files ([#4527](#4527)) ([2cf64ef](2cf64ef)) * **smart-crusher:** preserve unchanged JSON bytes ([#4044](#4044)) ([93279f3](93279f3)) * **tabular:** keep empty records and separator-like Markdown body rows ([#4582](#4582)) ([5cebb90](5cebb90)) * **tabular:** keep interior blank CSV rows instead of dropping them ([#4563](#4563)) ([8c360ca](8c360ca)) * **thinking:** isolate compaction memo by compressor instance ([#4569](#4569)) ([5dcb1e4](5dcb1e4)) * **thinking:** leave a thinking block with a null or non-string value unchanged ([#4562](#4562)) ([cc1eb54](cc1eb54)) * **toin:** preserve stores that exceed the byte limit ([#4589](#4589)) ([f9cae66](f9cae66)) * **toin:** retain pending changes after filesystem save failures ([#4568](#4568)) ([8b15a15](8b15a15)) * **toin:** skip a malformed pattern instead of aborting the store load ([#4484](#4484)) ([8b628d9](8b628d9)) * **tokenizers:** coerce structured text values in message token counters ([#4472](#4472)) ([6cc27a4](6cc27a4)) * **tokenizers:** don't cache token-count inputs larger than max_chars ([#4469](#4469)) ([aebb729](aebb729)) * **tokenizers:** price Anthropic document blocks by page count, not as ([fc1ba89](fc1ba89)) * **tokenizers:** price Anthropic document blocks by page count, not as base64 text ([#4441](#4441)) ([fc1ba89](fc1ba89)) * **tokenizers:** resolve tiktoken encoding for gateway-prefixed model ids ([#4637](#4637)) ([e9331b6](e9331b6)) * **transforms:** enforce role, mutable, and cache zone guards in batch compression ([#4480](#4480)) ([#4494](#4494)) ([40cd7e7](40cd7e7)) * **transforms:** honour Subscription toin_read_only when the router calls SmartCrusher ([#4493](#4493)) ([7c11d46](7c11d46)) * **transforms:** preserve YAML block scalar data during comment elision ([#4498](#4498)) ([534cec0](534cec0)) * **transforms:** recognise code fences whose info string is not a bare word ([#4291](#4291)) ([a8df6f9](a8df6f9)) * **transforms:** stop an embedded markdown table from dropping the rest of a tool result ([#4216](#4216)) ([b66c9c7](b66c9c7)) * **transforms:** tolerate malformed assistant tool calls in ContentRouter.apply ([#4459](#4459)) ([cddd2fd](cddd2fd)) * **update-check:** skip releases with no files and do not fall back to an uninstallable version ([#4560](#4560)) ([c1dae5a](c1dae5a)) * use all user text blocks for relevance scoring ([#4628](#4628)) ([12dca26](12dca26)) * **wrap:** overwrite drifted selfheal hook command instead of skipping it ([#2723](#2723)) ([2643f34](2643f34)) * **wrap:** route OMP OpenAI providers through Headroom ([#2755](#2755)) ([fae1e84](fae1e84)) ### Dependencies * Bump @anthropic-ai/sdk from 0.133.0 to 1.3.0 in /sdk/typescript ([#4554](#4554)) ([74277d4](74277d4)) * Bump lru from 0.18.5 to 0.19.0 ([#4382](#4382)) ([038af59](038af59)) * bump ruff from 0.17.0 to 0.17.2 in the pip-minor-patch group across 1 directory ([#4380](#4380)) ([64f43bd](64f43bd)) * bump ruff from 0.17.2 to 0.17.3 in the pip-minor-patch group ([#4652](#4652)) ([cb9602a](cb9602a)) * Bump the cargo-minor-patch group across 1 directory with 12 updates ([#4553](#4553)) ([b9049d7](b9049d7)) * Bump the npm-minor-patch group across 1 directory with 6 updates ([#4621](#4621)) ([5e4827d](5e4827d)) * Bump the npm-minor-patch group across 2 directories with 14 updates ([#4455](#4455)) ([f10725e](f10725e)) * Bump the npm-minor-patch group across 3 directories with 9 updates ([#4495](#4495)) ([f367728](f367728)) * Bump tsup from 8.5.1 to 9.0.0 in /plugins/openclaw ([#4384](#4384)) ([9d87151](9d87151)) * Bump tsup from 8.5.1 to 9.0.0 in /plugins/opencode ([#4385](#4385)) ([99e223c](99e223c)) * Bump tsup from 8.5.1 to 9.0.0 in /sdk/typescript ([#4386](#4386)) ([e666fd8](e666fd8)) * qualify latest Anthropic SDK 1.4.0 in docs ([#4556](#4556)) ([65bcc4c](65bcc4c)) * qualify latest compatible docs and E2E tools ([#4580](#4580)) ([e42f74e](e42f74e)) * require Python 3.11; clear Dependabot alerts in the 3.10 lock fork ([#4517](#4517)) ([3c6f82b](3c6f82b)) * update tomlkit requirement from <1.0,>=0.15.0 to >=0.15.2,<1.0 ([#4653](#4653)) ([00d5a5c](00d5a5c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). ### Maintainer current-main requalification Exact head `0dea0c5acf5a9b00efff4eb4aa5cb4bf44d5d4fe`, upstream main `ecbaf86d78cf52d185fbffa306157b9a4cc1b906`. Re-reviewed generated release metadata against current main ecbaf86. The bot-generated release commit had restored Ruff 0.17.2 while current main, uv.lock and pre-commit use 0.17.3. Both verify-ruff-version and offline lock checks reproduced this mechanical mismatch; restored only the current-main development-tool pin. No release version, contributor runtime logic or dependency lock versions changed. All 88 focused release workflow/version/MCP descriptor/Gemini tests pass. verify-versions reports tracked release metadata aligned at 0.43.0. After the pin correction, verify-ruff-version, uv lock --check --offline and whitespace checks pass. Generated CHANGELOG was reviewed without manual edits. Earlier Devin version-metadata finding is addressed. Formal approval awaits exact-head hosted qualification; maintainers handle CI. Nothing merged or published as a release. Exact-head hosted checks are being handled by maintainers. No new finding in the reviewed scope; formal approval awaits exact-head hosted qualification; nothing merged. Current release-bot head 2a1ebf7 has the identical tree to the locally verified Ruff correction (including preserved manifest line endings). Exact-head hosted qualification is in progress; no release published or PR merged. --------- Co-authored-by: headroom-release[bot] <352661243+headroom-release[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: JerrettDavis <[email protected]>
- fix(deps): patch OpenClaw Undici and narrow E2E audit exceptions (headroomlabs-ai#4453) - feat(ccr): Redis backend, one CCR store for every replica (headroomlabs-ai#4368) - fix(cache): bound the router's compression cache, keep the rest in SQLite (headroomlabs-ai#4357) - feat(compress): share /v1/compress sessions across replicas via Redis (headroomlabs-ai#4369) - fix(proxy): keep in-period costs in the budget ledger when the entry cap is reached (headroomlabs-ai#4448) - fix(proxy): import Response at runtime in the Bedrock handler (headroomlabs-ai#4397) - fix(tabular): pass tables with repeated header names through verbatim (headroomlabs-ai#4278) - fix(smart-crusher): match audit-safe protected_patterns against unescaped text (headroomlabs-ai#4294) - fix(copilot): detect COPILOT_API_URL in cli-main.js for Copilot CLI >= 1.0.93 (headroomlabs-ai#4450) - fix(proxy): do not rebuild a failed turn-hook re-drive as HTTP 200 (headroomlabs-ai#4398) - fix(transforms): keep the fences of a code block passed through for a protected tag (headroomlabs-ai#4292) - fix(cache): keep indented lines intact in OpenAI whitespace normalization (headroomlabs-ai#4343) - fix(gemini): keep snake_case inline_data and function parts when compressing (headroomlabs-ai#4290) - fix(proxy): record outcome when a passthrough stream ends mid-character (headroomlabs-ai#4429) - fix(image): flatten transparent images onto white before re-encoding as JPEG (headroomlabs-ai#4296) - fix(proxy): honor bypass header and license gate in Anthropic batch create (headroomlabs-ai#4411) - fix(install): keep the HuggingFace cache on a writable mount in Docker presets (headroomlabs-ai#4207) (headroomlabs-ai#4209) - fix(opencode): do not rewrite an OpenCode config that fails to parse (headroomlabs-ai#4424) - fix(openai): recompress cached Responses units whose CCR entries expired (headroomlabs-ai#4146) - fix(kompress): never drop words the model did not see (headroomlabs-ai#4175) - fix(proxy): bound per-model state keyed by the client model string (headroomlabs-ai#4407) - fix(copilot): preserve native inline OAuth identity (headroomlabs-ai#4144) - fix(proxy): drop web_search_call history from a Responses request with no web_search tool (headroomlabs-ai#4202) - fix(security): restrict the Windows runtime log via NTFS ACL, not just warn (headroomlabs-ai#4135) - fix(sdk): preserve Vercel AI SDK file and image parts through compression (headroomlabs-ai#4048) - fix(ci): pin checkout in release notification smoke workflow (headroomlabs-ai#4399) - docs(troubleshooting): explain the frozen ghcr.io/chopratejas/headroom image (headroomlabs-ai#4069) - fix(proxy): count output tokens from CRLF-framed SSE streams too (headroomlabs-ai#4298) - fix(telemetry): give empty-item compressions a stable tool signature (headroomlabs-ai#4396) - fix(proxy): keep tool deferral for GitHub Copilot upstream (headroomlabs-ai#4356) - fix(savings): key a Responses conversation on its thread, not the shared session (headroomlabs-ai#4440) - fix(storage): normalize timezone-aware JSONL time filters (headroomlabs-ai#4063) - fix(gateway): keep input_includes_cache when re-drive usage is merged (headroomlabs-ai#4423) - fix(proxy): copy cached tool compaction results (hardening) (headroomlabs-ai#4410) - fix(image): clear last_result before each compress() call (headroomlabs-ai#4341) - fix(memory): resolve partial IDs beyond the first 1000 records (headroomlabs-ai#4389) - fix(memory): ignore incidental cwd prose (headroomlabs-ai#4166) - fix(mcp): accept the JSONC opencode config that wrap and install already accept (headroomlabs-ai#4297) - fix(proxy): accept HEADROOM_MEMORY_INJECTION_MODE=tool (headroomlabs-ai#4395) - fix(memory): treat a cwd with no UTF-8 form as unresolved instead of raising (headroomlabs-ai#4167) - fix(opencode): restore process env keys on transport dispose (headroomlabs-ai#4430) - docs: drop effort-routing text that headroomlabs-ai#3377 removed (headroomlabs-ai#4449) - fix(transforms): pass HeadroomConfig.smart_crusher to the default pipeline's router (headroomlabs-ai#4243) - fix(proxy): skip memory tool injection on streamed OpenAI requests (headroomlabs-ai#4451) - fix(learn): anchor the managed block on its last start marker, append when no end marker (headroomlabs-ai#4342) - fix(proxy): keep negative compression savings across restart (headroomlabs-ai#4406) - fix(ccr): recognize client-owned MCP retrieval aliases (headroomlabs-ai#4165) - fix(logs): count omitted levels from dropped lines (headroomlabs-ai#4141) - fix(zcode): skip providers that point at the Headroom proxy itself (headroomlabs-ai#4413) - fix(memory): bound retrieval queries before embedding (headroomlabs-ai#4244) - fix(offline): keep litellm's pricing table local under HEADROOM_OFFLINE (headroomlabs-ai#4242) - feat(proxy): report the same tool savings on gateway /v1/compress as the proxy path (headroomlabs-ai#4467) - chore: release 0.42.0 (headroomlabs-ai#4228) - deps: Bump the npm-minor-patch group across 3 directories with 9 updates (headroomlabs-ai#4495) - deps: Bump the npm-minor-patch group across 2 directories with 14 updates (headroomlabs-ai#4455) - deps: require Python 3.11; clear Dependabot alerts in the 3.10 lock fork (headroomlabs-ai#4517) - docs(teams): replace the 3-months-free perk with a talk-to-us pitch (headroomlabs-ai#4524) - fix(docker): install the redis extra in every image (headroomlabs-ai#4514) - fix(packaging): rename the sandbox extra to lean and correct SECURITY.md claims (headroomlabs-ai#3727) - fix(openclaw/release): ship responsive npm integrations (headroomlabs-ai#1458) - fix(memory): fail close unresolved project operations (headroomlabs-ai#2637) - fix(proxy): install SOCKS support for websocket proxies (headroomlabs-ai#3357) - fix(pricing): add Claude Haiku 5.5 rates, 1M context and its 100K long-prompt card (headroomlabs-ai#4037) - fix(proxy): keep deferred tool loads out of the prefix-tracker lineage key (headroomlabs-ai#4204) - fix(transforms): stop an embedded markdown table from dropping the rest of a tool result (headroomlabs-ai#4216) - fix(client): store metrics at HeadroomConfig.store_url (headroomlabs-ai#4270) - fix(install): write persistent shell env values verbatim (headroomlabs-ai#4289) - fix: do not report a seeded stored setting as an env override (headroomlabs-ai#4326) - fix(cache): invalidate configured registry instances on replacement (headroomlabs-ai#4363) - fix(cache): validate malformed learned TTL values (headroomlabs-ai#4364) - fix(memory): bound history traversal on cyclic supersession links (headroomlabs-ai#4366) - fix(memory): skip the edit-distance retry check on long commands (headroomlabs-ai#4371) - fix(memory): match compound and null SQLite metadata filters (headroomlabs-ai#4373) - fix(proxy): log unknown model ids as one bounded token; skip unparseable PERF lines (headroomlabs-ai#4374) - fix(memory): preserve relationships when updating graph entities (headroomlabs-ai#4379) - chore(sdk-typescript): npm metadata and the proxy requirement up front (headroomlabs-ai#4536) - fix(proxy): recognise every local spelling of the proxy in the cc-switch loop guard (headroomlabs-ai#4405) - fix(proxy): do not book Gemini countTokens as a request outcome (headroomlabs-ai#4412) - fix(router): keep small shell results verbatim (headroomlabs-ai#3590) (headroomlabs-ai#4426) - fix(codex): accept multi-line inline tables in Codex config.toml (headroomlabs-ai#4436) - fix(proxy): preserve response cache keys across in-place hooks (headroomlabs-ai#4457) - fix(transforms): tolerate malformed assistant tool calls in ContentRouter.apply (headroomlabs-ai#4459) - fix(read-lifecycle): keep Reads fresh after a failed Edit or Write (headroomlabs-ai#4461) - fix(mixed-content): do not carve ISO-timestamped log rows as search results (headroomlabs-ai#4463) - fix(install): tolerate absent Windows tasks in stop_supervisor (headroomlabs-ai#4465) (headroomlabs-ai#4468) - fix(tokenizers): don't cache token-count inputs larger than max_chars (headroomlabs-ai#4469) - fix(compaction): reject negative dictionary indices and non-array legends in expand_compacted (headroomlabs-ai#4470) - fix(tokenizers): coerce structured text values in message token counters (headroomlabs-ai#4472) - docs: clarify Target savings metric is % of new input tokens (headroomlabs-ai#4485) - fix(toin): skip a malformed pattern instead of aborting the store load (headroomlabs-ai#4484) - fix(client): close upstream responses when wrapped streams are closed (headroomlabs-ai#4482) - fix(cache): namespace SemanticCacheLayer by provider, model and metadata (headroomlabs-ai#4473) - fix(router): validate lossless provider output on the excluded-tool path (headroomlabs-ai#4486) - fix(dedup): bound line-number digit run and never fold into a longer pointer (headroomlabs-ai#4488) - fix(sdk): send Anthropic messages to /v1/compress natively so thinking blocks survive (headroomlabs-ai#4489) - fix(doctor): detect root openai_base_url Codex routing and agent-configured proxy ports (headroomlabs-ai#4490) - fix(proxy): cap cache_control breakpoints on OpenAI chat path (headroomlabs-ai#4471) (headroomlabs-ai#4491) - fix(cache): count a tool_result with no text as replayable in the frozen prefix (headroomlabs-ai#4523) - fix(proxy): keep read maturation out of the provider-confirmed prefix (headroomlabs-ai#4522) - fix(relevance): cap embedding batch size so ORT's arena stays small (headroomlabs-ai#4507) - fix(transforms): honour Subscription toin_read_only when the router calls SmartCrusher (headroomlabs-ai#4493) - fix(transforms): enforce role, mutable, and cache zone guards in batch compression (headroomlabs-ai#4480) (headroomlabs-ai#4494) - fix(transforms): preserve YAML block scalar data during comment elision (headroomlabs-ai#4498) - fix(memory): compare SQLite timestamps as UTC instants (headroomlabs-ai#4499) - fix(client): preserve Anthropic create stream flags (headroomlabs-ai#4500) - fix(client): honor configured cache optimizer enablement (headroomlabs-ai#4501) - fix(proxy): don't fail startup when libc_ver() can't read the interpreter (headroomlabs-ai#4519) - fix(security): lstat before narrowing sqlite files (headroomlabs-ai#4527) - docs(site): Python-first quickstart and a FastAPI page built on compress() (headroomlabs-ai#4529) - fix(cache): preserve OpenAI tool block metadata on cached replay (headroomlabs-ai#4334) - fix(evals): reject changed numeric probe values (headroomlabs-ai#4502) - fix(tokenizers): price Anthropic document blocks by page count, not as base64 text (headroomlabs-ai#4441) - fix(deps): clear the glob and minimatch npm audit findings (headroomlabs-ai#4599) - test(proxy): make compression timeout regression deterministic (headroomlabs-ai#4587) - deps: bump ruff from 0.17.0 to 0.17.2 in the pip-minor-patch group across 1 directory (headroomlabs-ai#4380) - ci: Bump actions/setup-python from 6 to 7 (headroomlabs-ai#4558) - fix(mcp): confine headroom_read to the workspace (GHSA-8g49-pg6g-xgrf) (headroomlabs-ai#4525) - ci: Bump the actions-minor-patch group with 2 updates (headroomlabs-ai#4557) - deps: Bump the npm-minor-patch group across 1 directory with 6 updates (headroomlabs-ai#4621) - chore(deps): bump the uv group across 1 directory with 2 updates (headroomlabs-ai#4537) - deps: Bump @anthropic-ai/sdk from 0.133.0 to 1.3.0 in /sdk/typescript (headroomlabs-ai#4554) - fix(proxy): keep tool deferral on Copilot Business/Enterprise/Individual hosts (headroomlabs-ai#4608) - fix(deps): bump mem0ai, langgraph and langgraph-sdk past open advisories (headroomlabs-ai#4614) - deps: Bump the cargo-minor-patch group across 1 directory with 12 updates (headroomlabs-ai#4553) - deps: Bump tsup from 8.5.1 to 9.0.0 in /sdk/typescript (headroomlabs-ai#4386) - deps: Bump tsup from 8.5.1 to 9.0.0 in /plugins/opencode (headroomlabs-ai#4385) - deps: Bump lru from 0.18.5 to 0.19.0 (headroomlabs-ai#4382) - fix(cli): document that code-aware compression is enabled by default (headroomlabs-ai#4616) - fix(proxy): keep health probes and the Codex attestation out of the proxy log (headroomlabs-ai#4611) - fix(privacy): turn off ONNX Runtime's Microsoft telemetry by default (headroomlabs-ai#4602) - test(deps): fail when a composite extra's uv.lock list drops a nested extra's package (headroomlabs-ai#4598) - deps: qualify latest Anthropic SDK 1.4.0 in docs (headroomlabs-ai#4556) - fix(router): preserve read protection for quiet sed options (headroomlabs-ai#4521) - fix(wrap): overwrite drifted selfheal hook command instead of skipping it (headroomlabs-ai#2723) - fix(langgraph): replace the compressed ToolMessage in graph state (headroomlabs-ai#4620) - test(wrap): isolate two auth-precedence tests from the caller's ANTHROPIC_* env (headroomlabs-ai#4601) - fix(privacy): turn off Mem0's PostHog telemetry by default (headroomlabs-ai#4619) - fix(relevance): hand the embedding arena back after each run on macOS (headroomlabs-ai#4567) - fix(codec): reject densified blocks with mismatched row counts (headroomlabs-ai#4271) - fix(proxy): skip the memory-context search in cache mode (headroomlabs-ai#4606) - fix(pipeline): store the pipeline input in CCR behind offload markers (headroomlabs-ai#4576) - fix(backends/litellm): keep cache_control on text blocks for Bedrock prompt caching (headroomlabs-ai#4565) - fix(relevance): load the Rust default embedder from Python's pinned snapshot (headroomlabs-ai#4190) - fix(smart-crusher): preserve unchanged JSON bytes (headroomlabs-ai#4044) - fix(scripts): resolve hooks dir via git so install-git-hooks works in linked worktrees (headroomlabs-ai#4176) - fix(proxy/memory): harden _extract_tool_calls against malformed choices and blocks (headroomlabs-ai#2483) - fix: Add info about apply to README.md (headroomlabs-ai#1592) - Fix(proxy) vertex model override propagation (headroomlabs-ai#2367) - fix(backends): forward the standard service_tier param (litellm + anyllm) (headroomlabs-ai#2468) - fix(wrap): route OMP OpenAI providers through Headroom (headroomlabs-ai#2755) - fix(proxy): warm deferred kompress model so /health stops reporting backend=null (headroomlabs-ai#2799) - ci: run eval smoke test on Rust compressor changes (headroomlabs-ai#2948) - fix(proxy): handle ClientDisconnect in anthropic_messages (headroomlabs-ai#3532) - fix(output-savings): rewrite a pre-rule ledger once instead of warning on every /stats poll (headroomlabs-ai#4196) - fix(openclaw): record turn advancements as one marker file per key (headroomlabs-ai#4212) - fix(ccr): keep proactive expansion out of the cached prefix (headroomlabs-ai#4300) - fix(proxy): route /v1/models to the x-headroom-base-url upstream (headroomlabs-ai#4308) - fix(docker): pass RUNTIME_HOME=/root for root bake targets (headroomlabs-ai#4445) - docs: fix generate_report example arguments (headroomlabs-ai#4435) - fix(proxy): forward Copilot accounting headers on streaming path (headroomlabs-ai#4431) - fix(memory): bound verb-pattern word runs to stop quadratic backtracking in bridge import (headroomlabs-ai#4370) (headroomlabs-ai#4376) - fix(cache): fail closed on SQLite corruption instead of deleting the store online (headroomlabs-ai#4361) - fix(proxy): reconcile Chat content-block cache markers after prefix replay (headroomlabs-ai#4333) - fix(diff): keep combined-diff changes made against a later parent (headroomlabs-ai#4318) - fix(opencode): only route POST requests to LLM endpoint paths (headroomlabs-ai#4464) - fix: [BUG] A timeout in one image compression call resets the shared worker pool and affects concurrent requests (headroomlabs-ai#4528) - docs(readme): lead with two front doors and one measured savings claim (headroomlabs-ai#4530) - docs(llms): add a by-task section and state the measured savings claim once (headroomlabs-ai#4531) - docs: add AGENTS.md for agents using Headroom and agents changing the repo (headroomlabs-ai#4532) - docs(pypi): job-word summary and keywords, and a PyPI-specific README (headroomlabs-ai#4534) - deps: qualify latest compatible docs and E2E tools (headroomlabs-ai#4580) - fix(proxy): preserve retrieval outputs across Codex WS deltas (headroomlabs-ai#4574) - fix(sdk): carry Vercel AI SDK reasoning parts and provider options through compression (headroomlabs-ai#4564) - feat(savings): show the proxy's model-routing savings in headroom savings (headroomlabs-ai#4304) - feat(plugins): headroom skill for Claude Code, Codex, Copilot and skills.sh (headroomlabs-ai#4533) - fix(providers): isolate resolved Anthropic context limits (headroomlabs-ai#4593) - fix(proxy): honor x-headroom-base-url on provider passthrough routes (headroomlabs-ai#4596) - fix(packaging): use direct CLI module entry point (headroomlabs-ai#2665) - test(onnx): fix magika idle-thread test on macOS with ORT 1.31 (headroomlabs-ai#4194) - fix(memory): dispatch core text search to the async FTS5 adapter (headroomlabs-ai#4365) - fix: [BUG] DirectMem0Adapter.search_memories calls removed mem0 search API (headroomlabs-ai#4518) - fix(toin): retain pending changes after filesystem save failures (headroomlabs-ai#4568) - fix(thinking): isolate compaction memo by compressor instance (headroomlabs-ai#4569) - fix(cache): build semantic entry before evicting so a failed embedding keeps live entries (headroomlabs-ai#4581) - fix(tabular): keep empty records and separator-like Markdown body rows (headroomlabs-ai#4582) - fix(code): preserve syntax in CCR retrieval comments (headroomlabs-ai#4583) - fix: [BUG] Saved request metrics lose their cache optimization fields (headroomlabs-ai#4584) - fix(proxy): preserve Cline headroom__headroom_retrieve results from recompression (headroomlabs-ai#4586) - fix(cache): scope router results to request compression policy (headroomlabs-ai#4590) - fix(proxy): keep mid-conversation system sections for third-party models (headroomlabs-ai#4591) - feat(mcp)!: port MCP servers to SDK 2.x (headroomlabs-ai#4603) - fix(proxy): strip upstream transport framing headers from Gemini response replays (headroomlabs-ai#4605) - fix(code): keep multi-line class headers' opening brace (headroomlabs-ai#4623) - fix(code): keep Rust attributes attached to their items (headroomlabs-ai#4624) - docs: add Kong AI Gateway integration page (headroomlabs-ai#4625) - fix: use all user text blocks for relevance scoring (headroomlabs-ai#4628) - fix: [BUG] Volatile SQLite metrics stores lose their schema before the first save (headroomlabs-ai#4633) - fix(kompress): read the pinned snapshot from Python's one HF cache in the native proxy (headroomlabs-ai#4438) - test(tokenizer): hold the env lock in the invalid-repo Hub error test (headroomlabs-ai#4151) - fix(proxy): skip memory-context search in cache mode on OpenAI routes (headroomlabs-ai#4632) - fix(proxy): skip memory-context search on OpenAI paths in cache mode (headroomlabs-ai#4634) - feat(ccr): answer headroom_retrieve on streaming chat completions (headroomlabs-ai#4631) - fix(openclaw): read the retrieve hash from params, not the tool-call id (headroomlabs-ai#4641) - fix(proxy): bypass compression for large admitted histories (headroomlabs-ai#4142) - fix(tokenizers): resolve tiktoken encoding for gateway-prefixed model ids (headroomlabs-ai#4637) - fix(proxy): answer /api/hello probes behind the token gate, log rejection context (headroomlabs-ai#4150) - fix(memory): keep learned evidence until persistence succeeds (headroomlabs-ai#4229) - fix(proxy): allow loopback-published container hosts to access /debug/memory (headroomlabs-ai#4259) - fix(code): keep semicolon-separated statements valid (headroomlabs-ai#4630) - fix(config): use the longest matching model_context_limits prefix (headroomlabs-ai#4288) - fix(transforms): recognise code fences whose info string is not a bare word (headroomlabs-ai#4291) - fix(transforms): stop the dense-line elider cutting Chinese, Japanese and Thai prose (headroomlabs-ai#4295) - fix(cache): reject nonpositive semantic cache capacities (headroomlabs-ai#4301) - fix(proxy): strip only one leading space from SSE field values (headroomlabs-ai#4306) - fix(tokenizers): honor registered model factories (headroomlabs-ai#4437) - fix(memory): preserve parent scopes when clearing memories (headroomlabs-ai#4305) - deps: Bump tsup from 8.5.1 to 9.0.0 in /plugins/openclaw (headroomlabs-ai#4384) - fix(diff): renumber hunk headers after trimming context (headroomlabs-ai#4319) - fix(kompress): keep words past the tokenizer's truncation point (headroomlabs-ai#4328) - fix(tabular): keep tables whose columns share a name (headroomlabs-ai#4329) - fix(proxy): let model discovery honor the custom base URL (headroomlabs-ai#4330) - fix(offline): guard the learn and memory-eval LLM calls under HEADROOM_OFFLINE (headroomlabs-ai#4344) - fix(proxy): keep Gemini memory context on entries with non-text parts (headroomlabs-ai#4506) - docs(security): sync security model with egress pollers, counts and beacon payload (headroomlabs-ai#4539) - fix(proxy): say a forwarded streaming error came from the provider (headroomlabs-ai#4629) - fix(install): stabilize Windows task lifecycle and eliminate console window popup (headroomlabs-ai#4627) - fix(ccr): buffer a stream only for a marker new this turn (headroomlabs-ai#4607) - fix(toin): preserve stores that exceed the byte limit (headroomlabs-ai#4589) - fix(opencode): route Copilot Claude models through the proxy (headroomlabs-ai#4594) - fix(thinking): leave a thinking block with a null or non-string value unchanged (headroomlabs-ai#4562) - fix(tabular): keep interior blank CSV rows instead of dropping them (headroomlabs-ai#4563) - fix(update-check): skip releases with no files and do not fall back to an uninstallable version (headroomlabs-ai#4560) - fix(core): case-insensitive Bearer scheme, clamp SQLite CCR TTLs, redact the Redis URL in logs (headroomlabs-ai#4561) - fix(kompress): run the CPU and ONNX Runtime loader guards before building a session (headroomlabs-ai#4559) - fix(router): gate block-form tool output against cached lossy results (headroomlabs-ai#4504) - ci: bump astral-sh/setup-uv from 10.3.2 to 10.3.3 in the actions-minor-patch group (headroomlabs-ai#4659) - deps: update tomlkit requirement from <1.0,>=0.15.0 to >=0.15.2,<1.0 (headroomlabs-ai#4653) - deps: bump ruff from 0.17.2 to 0.17.3 in the pip-minor-patch group (headroomlabs-ai#4652) - docs(security): describe the per-route outcome of an unsafe base-URL override (headroomlabs-ai#4660) - chore: release 0.43.0 (headroomlabs-ai#4643) - fix(router): log the ONNX fallbacks at info instead of warning (headroomlabs-ai#4535) - fix: keep parent predicates when clearing a narrower memory scope (headroomlabs-ai#4327) - fix(proxy): preserve Unicode separators in SSE JSON (headroomlabs-ai#4337) - fix(proxy): bound the model-keyed tokenizer, beacon and litellm caches (headroomlabs-ai#4497) - fix(router): keep tagged blocks out of the lossy size-gate fallback (headroomlabs-ai#4543) - fix(ccr): keep the in-memory order queue from evicting re-stored entries (headroomlabs-ai#4545) - fix(ort): avoid implicit runtime discovery from the workspace (headroomlabs-ai#4570) - fix(ccr): only refuse a bare marker, not originals that start and end with markers (headroomlabs-ai#4626) - fix(proxy): use HTTP/1.1 client for ChatGPT streaming and model metadata (headroomlabs-ai#4006) - test(gemini): serve the memory-tail tests' body through request.stream() (headroomlabs-ai#4645) - fix(kompress): load ONNX Runtime through the dynamic loader guard before building a session (headroomlabs-ai#4644) - fix(openclaw): accept 12-character hashes in headroom_retrieve (headroomlabs-ai#4640) - deps: bump the npm-minor-patch group across 3 directories with 6 updates (headroomlabs-ai#4662) - fix(release): normalize damaged release PR envelopes before detection (headroomlabs-ai#4664) - fix(memory): replace the HNSW vector when a memory is re-indexed (headroomlabs-ai#4649) - fix(memory): read the relation key the memory_save schema advertises (headroomlabs-ai#4647) - chore: release 0.43.1 (headroomlabs-ai#4661) - fix(proxy): keep cold-turn reasoning drops sticky so the next warm turn reuses the cached prefix (headroomlabs-ai#4592) - fix(tabular): split fixed-width rows on column boundaries, not on double spaces (headroomlabs-ai#4541) - fix(learn): support opencode v2 session schema in learn scanner (headroomlabs-ai#4199) - fix(proxy): rename leaked_threads metric to timed_out_workers_total (headroomlabs-ai#3908) - fix(content-router): trust confident HTML detection over mixed-content heuristics (headroomlabs-ai#3627) - deps: bump the npm-minor-patch group across 1 directory with 2 updates (headroomlabs-ai#4650) - deps: update tree-sitter requirement from <0.27,>=0.25.2 to >=0.26.0,<0.27 (headroomlabs-ai#4656) - fix(proxy): add --no-ccr-response-handling flag to bypass response buffering (headroomlabs-ai#3082) (headroomlabs-ai#3100) - fix(install): make install status agree with doctor when the proxy is reachable (headroomlabs-ai#3072) (headroomlabs-ai#3141) - fix(cli): resolve active proxy port for read commands (headroomlabs-ai#3522) - feat(providers): add Hermes agent wrap support (headroomlabs-ai#934) - deps: update click requirement from >=8.3.3 to >=8.5.0 (headroomlabs-ai#4655) - deps: update sqlite-vec requirement from >=0.1.6 to >=0.1.9 (headroomlabs-ai#4654) - deps: bump rusqlite from 0.40.2 to 0.41.1 (headroomlabs-ai#4658) - deps: bump the cargo-minor-patch group with 3 updates (headroomlabs-ai#4657) - fix(kompress): prevent loading model when enable_kompress is False (headroomlabs-ai#4667) - fix(kompress): let the next window decide the words past the token cut (headroomlabs-ai#4669) - fix(sdk): keep Vercel AI SDK tool-result output kinds through compression (headroomlabs-ai#4670) - ci: pin every GitHub Action to a commit SHA (headroomlabs-ai#4671) - fix(memory): keep multimodal user content intact when injecting memories (headroomlabs-ai#4648) - fix(router): ignore shell operators inside quoted arguments in read detection (headroomlabs-ai#4646) - fix(packaging)!: keep PyTorch extras out of all (headroomlabs-ai#4067) - fix(langchain): check optional integration availability (headroomlabs-ai#4042) - fix(memory): gracefully degrade on context lookup and initialization errors (headroomlabs-ai#3251) (headroomlabs-ai#4049) - fix(install): decode Windows Task Scheduler XML output before parsing (headroomlabs-ai#3969) (headroomlabs-ai#4064) - fix(search_compressor): keep kept rows byte-for-byte and in input order (headroomlabs-ai#3982) - fix(telemetry): keep install ID stateless (headroomlabs-ai#3542) - fix(providers): count Anthropic tool_result/tool_use content blocks in OpenAI token counter (headroomlabs-ai#2681) - fix(binaries): fail closed on HEADROOM_BINARIES_ALLOW_UNVERIFIED=0/false (headroomlabs-ai#3218) - fix(doctor): recognize IPv6 loopback and case-insensitive proxy routing URLs (headroomlabs-ai#3255) - fix(vertex): explain Vertex failures in-band, correct the model/region matrix (headroomlabs-ai#2640)
Description
Codex accepts an inline table split across lines, with a trailing comma, in
~/.codex/config.toml:That is TOML 1.1 syntax. Headroom reads the Codex config with the standard library
tomllib, which only implements TOML 1.0 before Python 3.15, so it rejects the file withInvalid initial character for a key part. The result is what the issue shows:headroom wrap codexandheadroom mcp installrefuse to register MCP servers ("is not valid TOML ... refusing to overwrite") and session routing fails with "could not read Codex config for session routing", even though Codex itself is happy with the file.tomlkitis already a runtime dependency (used for Codex config recovery) and parses this syntax from 0.15.0. 0.13.3 and 0.14.0 both fail on it (Empty key at line 1 col 7).The fix adds one helper,
loads_codex_config(), that parses withtomllibfirst and only onTOMLDecodeErrorretries withtomlkit. Iftomlkitrejects the text too, it re-raises the originaltomllib.TOMLDecodeError, so every caller keeps its existingexcept tomllib.TOMLDecodeErrorhandling and its error messages unchanged. All places that parse the user's Codex config now go through it.The follow-up commit (
dc193870) fixes a problem the first commit exposed: once a multi-line inline table parses, aprofiles = {table can carry per-profilemodel_provider/openai_base_urlkeys on their own indented lines, and the line-based "root key" edits in init, the provider-scope install and persistent wrap mistook those nested lines for root assignments. Init and install deleted the profile's provider, and wrap rewrote it toheadroomand then skipped adding a real rootmodel_provider. Those edits now only touch lines that are actual root assignments.Fixes #4378
Type of Change
Changes Made
headroom/providers/codex/config_toml.py(new):loads_codex_config(content),tomllibfirst,tomlkitfallback, originaltomlliberror if both fail.headroom/cli/wrap.py: session routing read, the user-content check and its fallback in_inject_codex_provider_config, and the two "never write a malformed candidate" checks.headroom/cli/init.py: provider snapshot check, the candidate check in_ensure_codex_provider, and_codex_features.headroom/providers/codex/install.py:_codex_credential_store,codex_auth_helper_is_referenced, and the merged-config check before writing.headroom/providers/codex/project_context.py: thesqlite_homelookup.headroom/mcp_registry/codex.py:_load_toml,_unmergeable_reason, and both sides of_only_server_changed. This registrar class is shared with Grok, so a Grokconfig.tomlwith the same syntax is accepted too.tomllibon purpose:_table_path(parses a single[table]header line) and the auth snippet check inbuild_codex_auth_config(validates text Headroom generates itself).pyproject.toml/uv.lock: raise thetomlkitminimum from>=0.13.0to>=0.15.0, the first release that parses multi-line inline tables. The lock already resolved 0.15.0, souv lockonly changed the specifier line.tomlkitround-trip in wrap keeps the multi-line table byte for byte (checked below).tests/test_provider_codex_config_toml.py: the helper on the exact shape from the issue (multi-line, trailing comma, whitespace-only line, indented}), and that invalid TOML still raisestomllib.TOMLDecodeError.tests/test_mcp_registry/test_codex_registrar.py::test_register_accepts_multiline_inline_table: registering into that config succeeds and the user's text is kept as a byte-for-byte prefix.tests/test_cli/test_wrap_codex.py::test_codex_session_launch_settings_accept_multiline_inline_table: session routing reads that config and leaves the file untouched.dc193870(multi-line inline profile overrides):headroom/providers/codex/config_toml.py:root_assignment_lines(content)returns the indexes of lines that start a key/value pair at the document root. It stops at the first table header and skips lines inside a multi-line inline table, array or string, with a small scanner that tracks quotes, comments and bracket depth.headroom/cli/init.py(_ensure_codex_provider) andheadroom/providers/codex/install.py(_strip_root_provider_assignments) only dropmodel_provider/openai_base_urllines that are root assignments.headroom/cli/wrap.py:_redirect_existing_top_level_keysand_has_redirectable_top_level_keyonly look at root assignments. Before, they matched the key on any line, so a[profiles.work]section override was also rewritten toheadroomand counted as a root key; that now stays the user's, matching how init, install and_strip_codex_headroom_blocksalready treat[profiles.*].test_root_assignment_lines_skip_keys_nested_in_multiline_inline_table,test_ensure_codex_provider_preserves_multiline_inline_profile_overrides(init),test_provider_scope_preserves_multiline_inline_profile_overrides(install) andtest_inject_preserves_multiline_inline_profile_overrides(wrap).Testing
pytest) - Codex, MCP registry, init and Grok suites: 774 passed, 2 failed (the 2 failures are intests/test_codex_responses_passthrough_bytes.pyand fail the same way onmainwithout this change)ruff check .) -ruff checkandruff format --checkon the 9 changed Python filesmypy headroom) -mypyon the 6 changed source files, no issuesTest Output
New end-to-end tests on
main(fix stashed):(
tests/test_provider_codex_config_toml.pycannot import onmainbecause the helper does not exist yet.)With the fix:
Follow-up commit, the three new write-path tests on the first commit (
dfe93720, source changes reverted):With
dc193870:The 4 failures are in
tests/test_cli/test_wrap_persistent.py(AttributeError: '_Manifest' object has no attribute 'runtime_kind') and fail the same way with this PR's changes stashed.ruff check,ruff format --check(8 files) andmypyon the 4 changed source files are clean.tomlkit versions on the issue's snippet:
Real Behavior Proof
Environment: macOS 26.2 (Apple Silicon), Python 3.14.7, repo venv with the
mcppackage installed, a throwawayHOME/CODEX_HOMEwhoseconfig.tomlholds the issue's config:Exact command / steps:
HOME=<tmp>/home CODEX_HOME=<tmp>/home/.codex python -m headroom.cli mcp install --agent codex, then compare the start of the resulting file with the original bytes and count[mcp_servers.headroom]tables. Also calledwrap._inject_codex_provider_config(8787)andinit._ensure_codex_provider(path, 8787)on the same config to check the write paths.Observed result: before (
main):After:
The user's original bytes are an exact prefix of the new file and one
[mcp_servers.headroom]table was appended. The wrap injector printedCodex config: injected Headroom provider (WS + HTTP), and in both the wrap and init outputs the user's multi-line table is still present verbatim, the file parses,envis{'DINGTALK_Client_ID': '**********'}andmodel_providerisheadroom.Follow-up commit: with a throwaway
HOME/CODEX_HOMEholdingI ran
init._ensure_codex_provider,install.apply_provider_scope(provider scope) andwrap._inject_codex_provider_config(same config without the root key) and parsed the result:Not tested: a full
headroom wrap codexrun with a live proxy and the real Codex CLI, and Python 3.10 (wheretomliis the first parser; thetomlkitfallback is the same there).Runtime Rollout Safety
tomllibrejects buttomlkit0.15 accepts (TOML 1.1 multi-line inline tables). Valid TOML 1.0 still goes throughtomllibexactly as before, and text both parsers reject fails with the same error as before.tomllibhas already failed.Review Readiness
Checklist
CHANGELOG.md, it is generated by release-please from my Conventional Commit PR title (a CI guard enforces this)Screenshots (if applicable)
N/A
Additional Notes
tomllibimplements TOML 1.1 and parses this config directly (as noted in the issue thread), so on 3.15 the fallback simply never runs.tomlkitis a bit more permissive thantomllibonly where TOML 1.1 is; it still rejects duplicate keys and malformed tables, so the existing "refuse to overwrite an unparseable file" guards still trigger for genuinely broken configs (covered by the existing registrar tests).tomlkitminimum bump (>=0.13.0,<1.0to>=0.15.0,<1.0):wrap.py), so no new package enters the tree. Writing a TOML 1.1 parser here is not worth it, andtomllibonly gains TOML 1.1 in Python 3.15.python-poetry/tomlkit, MIT), with Frost Ming and Sébastien Eustace as the main maintainers. It is actively released: 0.13.3 (2025-06), 0.14.0 (2026-01), 0.15.0 (2026-05), 0.15.1 (2026-07), 0.15.2 (2026-10). No GitHub security advisories are published for the repo.py3-none-anywheel (about 41 KB for 0.15.0), no runtime dependencies, no native code, no install-time or runtime network access.uv.lockalready resolved 0.15.0 before this PR, so the locked version and hashes do not change; only the specifier line moves.Empty key at line 1 col 7, output above). 0.15.0 also includes an upstream parser hang fix (fix: fix a parser hang python-poetry/tomlkit#470).