Repository navigation
feat(executor): expose task identity to codex - #2308
Conversation
📝 WalkthroughWalkthroughCodex now receives task identity through thread-scoped ChangesCodex task identity propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 970af62943
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| launch_config | ||
| .config_overrides | ||
| .extend(task_identity_config_overrides(request)); |
There was a problem hiding this comment.
Keep task credentials out of app-server arguments
In the regular AgentProcessEngine Codex path, run_codex_app_server_turn_with_cancel passes this launch_config to spawn_codex_app_server, which serializes every override into -c command-line arguments. Consequently, AUTH_TOKEN and WEGENT_SKILL_IDENTITY_TOKEN are exposed through process listings, /proc/*/cmdline, and process-monitoring telemetry for the lifetime of every Codex task. Keep these overrides exclusively in the thread JSON-RPC config, and filter them from the per-task process launch config as the persistent app-server path already does.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@executor/tests/codex_app_server_contract.rs`:
- Around line 33-36: Update write_fake_codex so JSON-RPC requests are validated
for the expected auth_token and skill_identity_token values but those sensitive
fields are redacted or removed before being appended to log_path. Preserve the
propagation assertions in the test without persisting raw bearer-token values in
the fake Codex log.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a606cb7-33d5-45a7-9d33-448a25b00daa
📒 Files selected for processing (5)
docs/en/wegent/developer-guide/local-device-architecture.mddocs/zh/wegent/developer-guide/local-device-architecture.mdexecutor/src/agents/codex.rsexecutor/src/agents/codex/tests.rsexecutor/tests/codex_app_server_contract.rs
| task_id: "task-525".to_owned(), | ||
| auth_token: Some("task-jwt".to_owned()), | ||
| skill_identity_token: Some("skill-jwt".to_owned()), | ||
| user_name: Some("alice".to_owned()), |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Avoid writing bearer-token values to the fake Codex log.
write_fake_codex appends every JSON-RPC request to log_path (Lines 863-864), so this test now persists the raw auth_token and skill_identity_token values. Keep the propagation check, but make the fake server validate or redact sensitive fields before logging.
As per coding guidelines, “never log tokens, API keys, or local authentication-file contents.”
Also applies to: 73-88
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@executor/tests/codex_app_server_contract.rs` around lines 33 - 36, Update
write_fake_codex so JSON-RPC requests are validated for the expected auth_token
and skill_identity_token values but those sensitive fields are redacted or
removed before being appended to log_path. Preserve the propagation assertions
in the test without persisting raw bearer-token values in the fake Codex log.
Source: Coding guidelines
Summary by CodeRabbit
Documentation
Bug Fixes