Skip to content

fix: sanitize chat payloads and provider precedence#903

Closed
adavyas wants to merge 3 commits intoNousResearch:mainfrom
adavyas:fix/strict-chat-completions-schema-sanitization
Closed

fix: sanitize chat payloads and provider precedence#903
adavyas wants to merge 3 commits intoNousResearch:mainfrom
adavyas:fix/strict-chat-completions-schema-sanitization

Conversation

@adavyas
Copy link
Contributor

@adavyas adavyas commented Mar 11, 2026

Fixes #893

Summary

This PR prevents Codex-only replay metadata from leaking into chat-completions requests and fixes provider precedence regressions in the CLI. It also replaces a multiprocessing lock in a checkpoint test so sandboxed CI runners do not fail on SemLock permissions.

Changes

  • sanitize outbound chat-completions messages by removing codex-only fields
  • preserve original stored history for Codex Responses replay mode
  • prefer saved config provider over stale environment override in CLI/provider resolution
  • rename the skills command surface to skills-config in the touched branch changes
  • switch checkpoint test lock usage from multiprocessing.Lock to threading.Lock

Validation

  • pytest -q tests/test_provider_parity.py
  • pytest -q tests/test_batch_runner_checkpoint.py
  • pytest -q tests/test_cli_provider_resolution.py tests/test_runtime_provider_resolution.py tests/test_batch_runner_checkpoint.py tests/test_provider_parity.py

Notes

A full local suite run did not complete within the manual time caps used here, but the previously failing points were reproduced and fixed, and the focused touched-file test set passed.

@adavyas adavyas marked this pull request as draft March 11, 2026 08:08
@adavyas adavyas force-pushed the fix/strict-chat-completions-schema-sanitization branch from 3657c51 to 0311e5a Compare March 11, 2026 08:10
@adavyas adavyas marked this pull request as ready for review March 11, 2026 08:47
@adavyas adavyas force-pushed the fix/strict-chat-completions-schema-sanitization branch from 332d605 to 9cdd752 Compare March 11, 2026 16:39
@teknium1
Copy link
Contributor

Opened salvage PR #1253 onto current main, preserving your authored commits for the substantive fixes. I omitted the stale redundant top-level \ rename because current main already uses . Thanks for the fixes and tests here.

@teknium1
Copy link
Contributor

Correction: the omitted redundant rename was the top-level skills-config command surface; current main already uses the existing "hermes skills config" flow. Salvage PR is #1253.

@teknium1
Copy link
Contributor

Merged via PR #1253. Your substantive commits were cherry-picked onto current main with authorship preserved where applicable. Thanks for the fix and tests.

@teknium1 teknium1 closed this Mar 14, 2026
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.

Strict OpenAI-compatible chat completions endpoints reject replayed tool_calls.call_id / response_item_id fields

2 participants