Files
dev/codex-rs/thread-manager-sample
5f8f3a994a feat(reward-signals): content-free router-training feedback (#8)
Add a new `codex-reward-signals` crate and wire it into the TUI so the
Hanzo router gets production training feedback. Signals are content-free:
a response id, an enum, and (for ratings) a small integer — never any
prompt/response/file/code text.

Signals emitted:
- rating (1..3) on exit via a one-shot prompt; 0/Esc/Enter => dismiss
- regenerate on backtrack/re-run of a turn
- abandon on Ctrl+C interrupt mid-generation

The client POSTs {gateway_base}/v1/feedback with the same bearer token the
model client uses, fire-and-forget and silent on any failure. The exit
rating uses a bounded (<=1500ms) synchronous send since a detached task
would be killed on process exit. Gated to the Hanzo gateway; opt out via
HANZO_FEEDBACK=0|false|off or config `reward_signals = false`.

Response ids (previously discarded from ResponseEvent::Completed) are now
threaded through SamplingRequestResult -> turn state -> TurnCompleteEvent
-> app-server Turn.response_id -> ChatWidget.last_request_id.

Bumps hanzo-node to 0.6.53.

Co-authored-by: hanzo-dev <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-16 10:31:48 -07:00
..

ThreadManager Sample

Small one-shot binary that starts a Codex thread with ThreadManager from codex-core-api, submits a single user turn, and prints the final assistant message.

cargo run -p codex-thread-manager-sample -- "Say hello"

Use --model to override the configured default model:

cargo run -p codex-thread-manager-sample -- --model gpt-5.2 "Say hello"

The prompt can also be piped through stdin:

printf 'Say hello\n' | cargo run -p codex-thread-manager-sample