Repository navigation
feat(executor): expose task identity to codex #2308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,10 @@ async fn codex_app_server_engine_drives_thread_and_turn_over_json_rpc() { | |
| let fake_codex = write_fake_codex(&log_path); | ||
| let engine = CodexAppServerEngine::new(fake_codex.display().to_string()); | ||
| let request = ExecutionRequest { | ||
| 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()), | ||
|
Comment on lines
+33
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win Avoid writing bearer-token values to the fake Codex log.
As per coding guidelines, “never log tokens, API keys, or local authentication-file contents.” Also applies to: 73-88 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| prompt: json!("implement feature"), | ||
| bot: json!([{"shell_type": "ClaudeCode"}]), | ||
| model_config: json!({ | ||
|
|
@@ -66,6 +70,22 @@ async fn codex_app_server_engine_drives_thread_and_turn_over_json_rpc() { | |
| assert_eq!(messages[2]["params"]["model"], "gpt-5"); | ||
| assert_eq!(messages[2]["params"]["cwd"], "/tmp/wegent/project"); | ||
| assert_eq!(messages[2]["params"]["permissions"], ":danger-full-access"); | ||
| assert_eq!( | ||
| messages[2]["params"]["config"]["shell_environment_policy.set.WEGENT_TASK_ID"], | ||
| "task-525" | ||
| ); | ||
| assert_eq!( | ||
| messages[2]["params"]["config"]["shell_environment_policy.set.AUTH_TOKEN"], | ||
| "task-jwt" | ||
| ); | ||
| assert_eq!( | ||
| messages[2]["params"]["config"]["shell_environment_policy.set.WEGENT_SKILL_IDENTITY_TOKEN"], | ||
| "skill-jwt" | ||
| ); | ||
| assert_eq!( | ||
| messages[2]["params"]["config"]["shell_environment_policy.set.WEGENT_SKILL_USER_NAME"], | ||
| "alice" | ||
| ); | ||
| assert_eq!(messages[3]["method"], "turn/start"); | ||
| assert_eq!(messages[3]["params"]["threadId"], "thread-1"); | ||
| assert_eq!(messages[3]["params"]["model"], "gpt-5"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the regular
AgentProcessEngineCodex path,run_codex_app_server_turn_with_cancelpasses thislaunch_configtospawn_codex_app_server, which serializes every override into-ccommand-line arguments. Consequently,AUTH_TOKENandWEGENT_SKILL_IDENTITY_TOKENare 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 👍 / 👎.