Skip to content

Preserve codex response fidelity#140

Open
w32zhong wants to merge 2 commits into
runta-dev:mainfrom
highclaws-com:preserve-codex-response-fidelity
Open

Preserve codex response fidelity#140
w32zhong wants to merge 2 commits into
runta-dev:mainfrom
highclaws-com:preserve-codex-response-fidelity

Conversation

@w32zhong

@w32zhong w32zhong commented May 22, 2026

Copy link
Copy Markdown
Contributor

Why

ClawShell translates /v1/chat/completions traffic to the Codex OAuth /responses backend.

That translation already handled the basic message/tool schema conversion, but translated chat traffic could still differ from native Codex Responses traffic in important request controls. In my Hermes + Discord + Codex setup, that
showed up as Codex sometimes returning a plain final text promise instead of starting tool work, so the agent loop saw finish_reason=stop with no tool calls and ended the turn.

The gap was that the translated Codex request could lose or omit Responses-oriented fields that Hermes' native Codex Responses path normally carries, especially reasoning and tool-use controls.

What changed

  • Preserve Responses-compatible fields when they arrive through chat-compatible traffic:
    • reasoning
    • include
    • parallel_tool_calls
    • prompt_cache_key
  • For Codex OAuth translated requests, fill missing Codex Responses defaults closer to native Codex clients:
    • default reasoning to medium effort with summary enabled
    • request encrypted reasoning content when reasoning is enabled
    • default tool_choice to auto when tools are present
    • default parallel_tool_calls to true when tools are present
  • Normalize chat-style reasoning controls before sending them to Codex Responses:
    • remove chat-only reasoning.enabled
    • treat effort: "none" as disabled reasoning
    • clamp minimal to low

Scope

This only adjusts the Codex OAuth translated chat path. Explicit caller-provided Responses controls are preserved instead of being overwritten.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

@pullfrog

pullfrog Bot commented May 22, 2026

Copy link
Copy Markdown

Pullfrog stalled

The agent stopped emitting events for 303s and was killed by the activity-timeout watchdog. 56 events were processed before the failure.

Recent agent stderr
INFO  2026-05-22T21:32:46 +80ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +80ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +80ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +80ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +85ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +79ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +79ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +79ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +85ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +73ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +88ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:46 +78ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +74ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +81ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +80ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +79ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +85ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +77ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +81ms service=bus type=message.part.delta publishing
INFO  2026-05-22T21:32:47 +80ms service=bus type=message.part.delta publishing

Pullfrog  | Rerun failed job ➔View workflow run | via Pullfrog | Using Kimi K2𝕏

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