[codex] Add RL trajectory capture#83
Open
Lixtt wants to merge 6 commits into
Open
Conversation
Lixtt
marked this pull request as ready for review
July 6, 2026 14:58
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.
Summary
Adds opt-in RL trajectory capture to a3s-code so agent runs can emit structured JSONL records for downstream RL/SFT data construction. The latest update also captures token-level logprobs and full tool schemas so saved traces are usable as training examples without relying on the OpenClaw-RL wrapper to reconstruct missing fields.
Changes
RlTrajectoryRecorderanda3s.rl_trajectory.v1JSONL event schemaavailable_toolsas tool-name compatibility data and add fulltool_definitionsto LLM request eventsTokenLogProb/TopTokenLogProbtoLlmResponseand writetoken_logprobsto trajectory response eventslogprobs/top_logprobsfor non-streaming and streaming responsesValidation
cargo fmtgit diff --checkcargo test -p a3s-code-core openaicargo test -p a3s-code-core rl_trajectorycargo test --manifest-path sdk/python/Cargo.toml session_options_mapcargo test --manifest-path sdk/node/Cargo.toml session_options_mapsNotes
The logprob request remains off by default because some public providers reject logprob requests when tools are present. Training and evaluation harnesses can enable it explicitly via session options or
A3S_CODE_LLM_LOGPROBS/A3S_CODE_LLM_TOP_LOGPROBS.