Track Codex native Responses sessions and reload skills after evolve#45
Merged
Conversation
The native Responses API path (_responses_native_enabled) bypassed _handle_request entirely, skipping session turn recording, skill injection tracking, and snapshot uploads. Codex sessions through the proxy were invisible to the evolve pipeline. Adds _record_responses_turn to capture prompt/response text and injected_skills for Responses API requests, enabling the full session -> evolve -> skill generation loop for Codex users.
Parse native Responses streaming events before forwarding each chunk so session tracking is not lost if the client closes after response.completed. Reconstruct assistant output from response.output_text and response.output_item events because real Responses streams may omit output from the final response.completed payload. Update Codex integration to use the current split profile file at ~/.codex/skillclaw.config.toml while keeping ~/.codex/config.toml free of legacy [profiles.skillclaw] tables.
When the proxy uploads a session snapshot and triggers the evolve server, wait for the synchronous trigger response and pull skills from shared storage when the evolve result reports uploaded_skills > 0. This keeps the demo path working without requiring the evolve server to call back into a proxy port that may not be reachable or safe to expose. Future TODO: replace the long synchronous trigger with an explicit async evolve job API. /trigger should return accepted/job_id, jobs should persist status/heartbeat/timeouts and claim sessions idempotently, and reload notification should prefer proxy polling, Nacos watch/listener, or secured same-network callbacks with token/mTLS/IP allowlist.
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
_responses_native_enabledpath previously bypassed_handle_requestand was invisible to evolve)response.output_textandresponse.output_itemevents because real Responses streams may omit output from the finalresponse.completedpayload~/.codex/skillclaw.config.tomlso the global~/.codex/config.tomlstays free of[profiles.skillclaw]and doesn't interfere with normal Codex runsuploaded_skills > 0; add an optional callback notify mode on the evolve server for future useTest plan