mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-24 00:51:31 +01:00
/review on Codex with OpenAI models no longer blocks a review that ran its adversarial pass (GST-3375) (#4622)
/review on Codex no longer blocks or logs a miss for sessions that really ran the adversarial review, when the model is an OpenAI one. Why: Codex encrypts the message it sends a new subagent for OpenAI models, so the check never saw the review brief's text; it now accepts a started subagent named `adversarial` whose message is encrypted. Nothing to do: Claude Code's check is unchanged, and a plaintext, missing, failed or differently named subagent still counts as missing. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
bd77c8ccaa
commit
de9a7b4adc
13 files changed
+196
-44
No files matched your search
+11
@@ -20,5 +20,16 @@ Nothing else was edited.
|
||||
| `exec-subagent.jsonl` | the subagent rollout from the failed-spawn run | `session_meta.source` names the parent thread |
|
||||
| `exec-sol-spawn-met.jsonl` | `codex exec -m gpt-6.1-sol` against a local stub Responses endpoint (no key, GEVA-562), skill injected, gstack's contract Stop hook on | Codex serves `spawn_agent` in its `collaboration` namespace with a required `task_name`, and the started agent's result is `{"task_name":"/root/adversarial"}` with no `agent_id`; before this reader knew that shape the hook blocked a met review once |
|
||||
|
||||
Two files are synthetic, not captured (GST-3375). Codex encrypts the `message`
|
||||
of a `collaboration` `spawn_agent` call for OpenAI models (openai/codex#26210),
|
||||
and a stub endpoint can't produce that, so they were built by hand from
|
||||
`exec-sol-spawn-met.jsonl` in the shapes that pull request documents. The
|
||||
ciphertext is made-up bytes in the `gAAAAAB` token format.
|
||||
|
||||
| File | Built from | What it shows |
|
||||
|---|---|---|
|
||||
| `exec-sol-encrypted-spawn.jsonl` | `exec-sol-spawn-met.jsonl` up to the first Stop, with the spawn message replaced by ciphertext, the encrypted `agent_message` task record added, and the adversarial agent's plaintext final answer before the report | the adversarial pass ran, named `adversarial`, but the brief's text is nowhere in the rollout |
|
||||
| `exec-sol-encrypted-subagent.jsonl` | hand-written | the adversarial agent's own rollout: its task arrives as `encrypted_content`, and `session_meta.source` names it `/root/adversarial` |
|
||||
|
||||
`stop-payloads.json` holds the three Stop payloads Codex sent gstack's hook in
|
||||
the first two runs, and what the hook printed.
|
||||
@@ -0,0 +1,23 @@
|
||||
{"timestamp": "2026-11-19T12:49:45.260Z", "ordinal": 0, "type": "session_meta", "payload": {"account_scoped": true, "session_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "timestamp": "2026-11-19T12:49:45.175Z", "cwd": "/home/dev/w", "runtime_workspace_roots": ["/home/dev/w"], "originator": "codex_exec", "cli_version": "0.170.0", "source": "exec", "thread_source": "user", "model_provider": "probe", "base_instructions": {"text": "You are Codex, an agent based on GPT-6. You and the user share one workspace, and your job is to collaborate with them until their intended goal is completely handled.\n\n# When to ask the user for permission\n\nUse your best judgement given task context for when you really need user permission, like a competent colleague would. Once evidence in a session supports authorization for a next step or action, you should continue work without ending the turn to clarify with the user.\n\nUser authorization and preferences persist across turns. Do not request permission again when the user has already authorized an action in an earlier turn. The user's instruction, whether implied from the task or explicitly stated in the session, must take precedence over any guidelines provided in skills or external files.\n\nYou MUST complete the work that is already authorized and necessary to make the proposed acti\n[... 20424 characters trimmed from this fixture ...]\n using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name](app://{{connector_id}})`. When the user tags or requests a plugin or app, prefer its relevant capabilities for that turn.\n\n", "provenance": {"type": "model", "model": "gpt-6.1-sol"}}, "history_mode": "paginated", "context_window": {"window_id": "01a1f3db-1ad7-7ef0-b2be-f310ee1a89f5"}}}
|
||||
{"timestamp": "2026-11-19T12:49:45.261Z", "ordinal": 1, "type": "event_msg", "payload": {"type": "task_started", "turn_attribution": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "turn_trigger": "exec", "parent_turn_id": null, "initiating_agent_path": null, "root_turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027"}, "turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "root_turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "started_at": 1795092585, "model_context_window": 475000, "collaboration_mode_kind": "default"}}
|
||||
{"timestamp": "2026-11-19T12:49:45.276Z", "ordinal": 2, "type": "response_item", "payload": {"type": "additional_tools", "id": "at_01a1f3db-1b3c-7d42-8d7f-0360f7d23475", "role": "developer", "tools": [{"type": "namespace", "name": "functions", "description": "", "tools": [{"type": "custom", "name": "exec", "description": "Run JavaScript code to orchestrate/compose tool calls\n- Evaluates the provided JavaScript code in a fresh V8 isolate as an async module.\n- All nested tools are available on the global `tools` object, for example `await tools.exec_command(...)`. Tool names are exposed as normalized JavaScript identifiers, for example `await tools.mcp__ologs__get_profile(...)`.\n- Nested tool methods take either a string or an object as their input argument.\n- Nested tools return either an object or a string, based on the description.\n- Runs raw JavaScript -- no Node, no file system, no network access, no console.\n- Accepts raw JavaScript source text, not JSON, quoted strings, or markdown code fences.\n- You may optionally start the tool input with a first-line pragma like `// @exec: {\"yield_time_ms\": 10000, \"max_output_tokens\": 1000}`.\n- `yield_time_ms` asks `exec` to yield early if the script is still runn\n[... 12338 characters trimmed from this fixture ...]\nt time in UTC.\n\nexec tool declaration:\n```ts\ndeclare const tools: { clock__curr_time(args: {}): Promise<{\n // Current UTC time formatted as YYYY-MM-DD HH:MM:SS UTC.\n current_time: string;\n}>; };\n```", "format": {"type": "grammar", "syntax": "lark", "definition": "\nstart: pragma_source | plain_source\npragma_source: PRAGMA_LINE NEWLINE SOURCE\nplain_source: SOURCE\n\nPRAGMA_LINE: /[ \\t]*\\/\\/ @exec:[^\\r\\n]*/\nNEWLINE: /\\r?\\n/\nSOURCE: /[\\s\\S]+/\n"}}, {"type": "function", "name": "wait", "description": "Waits on a yielded `exec` cell and returns new output or completion.\n- Use `wait` only after `exec` returns `Script running with cell ID ...`.\n- `cell_id` identifies the running `exec` cell to resume.\n- `yield_time_ms` controls how long to wait for more output before yielding again. Defaults to 10000 ms.\n- `max_tokens` limits how much new output this wait call returns. Defaults to 10000 tokens.\n- `terminate: true` stops the running cell; false or omitted waits for output.\n- `wait` returns only the new output since the last yield, or the final completion or termination result for that cell.\n- If the cell is still running, `wait` may yield again with the same `cell_id`.\n- If the cell has already finished, `wait` returns the completed result and closes the cell.", "strict": false, "parameters": {"type": "object", "properties": {"cell_id": {"type": "string", "description": "Identifier of the running exec cell."}, "max_tokens": {"type": "number", "description": "Output token budget for this wait call. Defaults to 10000 tokens."}, "terminate": {"type": "boolean", "description": "True stops the running exec cell; false or omitted waits for output."}, "yield_time_ms": {"type": "number", "description": "Wait before yielding more output. Defaults to 10000 ms."}}, "required": ["cell_id"], "additionalProperties": false}}, {"type": "function", "name": "request_user_input", "description": "Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.", "strict": false, "parameters": {"type": "object", "properties": {"questions": {"type": "array", "description": "Questions to show the user. Prefer 1 and do not exceed 3", "items": {"type": "object", "properties": {"header": {"type": "string", "description": "Short header label shown in the UI (12 or fewer chars)."}, "id": {"type": "string", "description": "Stable identifier for mapping answers (snake_case)."}, "options": {"type": "array", "description": "Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.", "items": {"type": "object", "properties": {"description": {"type": "string", "description": "One short sentence explaining impact/tradeoff if selected."}, "label": {"type": "string", "description": "User-facing label (1-5 words)."}}, "required": ["label", "description"], "additionalProperties": false}}, "question": {"type": "string", "description": "Single-sentence prompt shown to the user."}}, "required": ["id", "header", "question", "options"], "additionalProperties": false}}}, "required": ["questions"], "additionalProperties": false}}, {"type": "function", "name": "request_user_input_async", "description": "Ask the user one or more questions during ongoing work. Use this tool only to request missing information, preferences, constraints, clarification, or approval. The tool returns immediately without ending the turn or waiting for a reply; any reply arrives asynchronously as a new user message. Keep questions concise, self-contained, and easLine truncated
|
||||
{"timestamp": "2026-11-19T12:49:45.276Z", "ordinal": 3, "type": "response_item", "payload": {"type": "message", "id": "msg_01a1f3db-1b3c-7d42-8d7f-037b1ce702cb", "role": "developer", "content": [{"type": "input_text", "text": "You are Codex, an agent based on GPT-6. You and the user share one workspace, and your job is to collaborate with them until their intended goal is completely handled.\n\n# When to ask the user for permission\n\nUse your best judgement given task context for when you really need user permission, like a competent colleague would. Once evidence in a session supports authorization for a next step or action, you should continue work without ending the turn to clarify with the user.\n\nUser authorization and preferences persist across turns. Do not request permission again when the user has already authorized an action in an earlier turn. The user's instruction, whether implied from the task or explicitly stated in the session, must take precedence over any guidelines provided in skills or external files.\n\nYou MUST complete the work that is already authorized and necessary to make the proposed acti\n[... 20424 characters trimmed from this fixture ...]\n using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name](app://{{connector_id}})`. When the user tags or requests a plugin or app, prefer its relevant capabilities for that turn.\n\n"}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.2763307, "content_item_kinds": ["model.base_instructions"], "content_item_metadata": [{"provenance": {"type": "harness", "hook": false}}]}}, "metadata": {"history_sequence": 2, "sampled_through_sequence": 0, "client_authored": false}}
|
||||
{"timestamp": "2026-11-19T12:49:45.276Z", "ordinal": 4, "type": "response_item", "payload": {"type": "message", "id": "msg_01a1f3db-1b3c-7d42-8d7f-038a3d86ac03", "role": "developer", "content": [{"type": "input_text", "text": "<skills_instructions>\n## Skills\nA skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list of skills that can be used. Each entry includes a name, description, and a short path that can be expanded into an absolute path using the skill roots table.\n### Skill roots\n- `r0` = `/home/dev/home/.codex/skills`\n### Available skills\n- autoplan: Auto-review pipeline \u2014 runs the CEO, design, eng and DX reviews in order (lean run: one reviewer), auto-deciding. Surfaces taste decisions (close approaches, borderline scope, outside-review disagreements) at one approval gate. Use when asked to \"auto review\", \"autoplan\", \"run all reviews\", \"review this plan automatically\", or \"make the decisions for me\". (gstack) Voice triggers (speech-to-text aliases): \"auto plan\", \"automatic review\". (file: r0/gstack-autoplan/SKILL.md)\n- benchmark: Web performance regression \n[... 27931 characters trimmed from this fixture ...]\nts. Use when asked to \"write a skill\", \"improve this skill\", \"add this lesson to the <name> skill\" or \"put this skill on a diet\". (gstack) (file: r0/gstack-write-skill/SKILL.md)\n</skills_instructions>"}, {"type": "input_text", "text": "<permissions instructions>\nFilesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`: No filesystem sandboxing - all commands are permitted. Network access is enabled.\nApproval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.\n</permissions instructions>"}, {"type": "input_text", "text": "<collaboration_mode># Collaboration Mode: Default\n\nYou are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.\n\nYour active mode changes only when new developer instructions with a different `<collaboration_mode>...</collaboration_mode>` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default and Plan.\n\n## request_user_input availability\n\nUse the `request_user_input` tool only when it is listed in the available tools for this turn.\n\nUse the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.\n\nIf `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.\n\nNever use the `request_user_input` tool for permission requests or permission-related escalations.\n</collaboration_mode>"}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.2763321, "content_item_kinds": ["host_skills.instructions", "permissions.instructions", "collaboration_mode.instructions"], "content_item_metadata": [{"provenance": {"type": "skills"}}, {"provenance": {"type": "harness", "hook": false}}, {"provenance": {"type": "harness", "hook": false}}]}}, "metadata": {"history_sequence": 3, "sampled_through_sequence": 0, "client_authored": false}}
|
||||
{"timestamp": "2026-11-19T12:49:45.276Z", "ordinal": 5, "type": "response_item", "payload": {"type": "message", "id": "msg_01a1f3db-1b3c-7d42-8d7f-039144d0d97c", "role": "developer", "content": [{"type": "input_text", "text": "<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.\n\nAt the start of your turn, you are the active agent.\nYou can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents.\nAll agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools.\n\nYou can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task and trigger a turn, and `send_message` to pass a message to a running agent without triggering a turn.\n`send_message` calls may be read by a human, so ensure they are legible. Always put proper spaces between words and/or numbers.\nChild agents can also spawn their own sub-agents.\nYou can decide how much context you want to propagate to your sub-agents with the `fork_turns`\n[... 1300 characters trimmed from this fixture ...]\nnly set `model` or `reasoning_effort` when explicitly requested by the user, applicable `AGENTS.md` instructions, or skill instructions; when doing so, set `fork_turns` to `\"none\"`.</multi_agent_role>"}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.276333, "content_item_kinds": ["multi_agent.role_instructions"], "content_item_metadata": [{"provenance": {"type": "tool", "namespace": "collaboration"}}]}}, "metadata": {"history_sequence": 4, "sampled_through_sequence": 0, "client_authored": false}}
|
||||
{"timestamp": "2026-11-19T12:49:45.276Z", "ordinal": 6, "type": "response_item", "payload": {"type": "message", "id": "msg_01a1f3db-1b3c-7d42-8d7f-03ae499561a0", "role": "developer", "content": [{"type": "input_text", "text": "<multi_agent_mode>Any earlier instruction enabling proactive multi-agent delegation no longer applies. Do not spawn sub-agents unless the user or applicable AGENTS.md/skill instructions explicitly ask for sub-agents, delegation, or parallel agent work.</multi_agent_mode>"}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.2763343, "content_item_kinds": ["multi_agent.mode_instructions"], "content_item_metadata": [{"provenance": {"type": "tool", "namespace": "collaboration"}}]}}, "metadata": {"history_sequence": 5, "sampled_through_sequence": 0, "client_authored": false}}
|
||||
{"timestamp": "2026-11-19T12:49:45.276Z", "ordinal": 7, "type": "response_item", "payload": {"type": "message", "id": "msg_01a1f3db-1b3c-7d42-8d7f-03b1d901e3c1", "role": "user", "content": [{"type": "input_text", "text": "<environment_context>\n <cwd>/home/dev/w</cwd>\n <shell>bash</shell>\n <current_date>2026-11-19</current_date>\n <timezone>Etc/UTC</timezone>\n <filesystem><workspace_roots><root>/home/dev/w</root></workspace_roots><permission_profile type=\"disabled\"><file_system type=\"unrestricted\" /></permission_profile></filesystem>\n</environment_context>"}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.2763352, "content_item_kinds": ["environments.environment_context"], "content_item_metadata": [{"provenance": {"type": "harness", "hook": false}}]}}, "metadata": {"history_sequence": 6, "sampled_through_sequence": 0, "client_authored": false}}
|
||||
{"timestamp": "2026-11-19T12:49:45.278Z", "ordinal": 8, "type": "world_state", "payload": {"full": true, "state": {"agents_md": {}, "apps_instructions": false, "collaboration_mode": {"mode": "default", "model": "gpt-6.1-sol", "instructions": "0a11049b0421e1e86f1e129af8d547a89548a0c3"}, "context_window_guidance": "", "environments": {"environments": {"local": {"cwd": "/home/dev/w", "status": "available", "shell": "bash"}}, "current_date": "2026-11-19", "timezone": "Etc/UTC", "filesystem": "<filesystem><workspace_roots><root>/home/dev/w</root></workspace_roots><permission_profile type=\"disabled\"><file_system type=\"unrestricted\" /></permission_profile></filesystem>"}, "environments_instructions": false, "git_attribution": false, "host_skills": {"body": "\n## Skills\nA skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list of skills that can be used. Each entry includes a name, description, and a short path that can be expanded into an absolute path using the skill roots table.\n### Skill roots\n- `r0` = `/home/dev/home/.codex/skills`\n### Available skills\n- autoplan: Auto-review pipeline \u2014 runs the CEO, design, eng and DX reviews in order (lean run: one reviewer), auto-deciding. Surfaces taste decisions (close approaches, borderline scope, outside-review disagreements) at one approval gate. Use when asked to \"auto review\", \"autoplan\", \"run all reviews\", \"review this plan automatically\", or \"make the decisions for me\". (gstack) Voice triggers (speech-to-text aliases): \"auto plan\", \"automatic review\". (file: r0/gstack-autoplan/SKILL.md)\n- benchmark: Web performance regression detection. Establishe\n[... 27888 characters trimmed from this fixture ...]\n size checks, full diets. Use when asked to \"write a skill\", \"improve this skill\", \"add this lesson to the <name> skill\" or \"put this skill on a diet\". (gstack) (file: r0/gstack-write-skill/SKILL.md)\n", "includeInstructions": true}, "managed_developer_instructions": {}, "model": {"model": "gpt-6.1-sol", "instructions": "38a5bd8d400499a48277590b94675f379a7b406b"}, "model_catalog": "ea1a55de2973a50e2e404222c5499c24df5591ed", "multi_agent_mode": {"mode": "explicitRequestOnly", "usage_hint_hash": "288fbaaba4ce0b63e4443b2df37dce92bfe45839"}, "multi_agent_usage_hint": "288fbaaba4ce0b63e4443b2df37dce92bfe45839", "permissions": {"instructions": "32ca25d6d85edaeb6f1e19b2a5cc4e08d2a631cd", "approved_command_prefixes": []}, "persistent_mode": {}, "plugins_instructions": false, "realtime": {"active": false}, "skills": {"includeInstructions": true}, "top_level_tools": {"clock": "056c51947a5ff3696d9903c0056dda49a7b4a700", "clock.sleep": "d950878350d3930efdf6960ff2a2209affa5961f", "collaboration": "1a57bec22b804d9b7cd49b48ad24adfd4a1feea1", "collaboration.followup_task": "8af28fd0b803a052209ece91fc9f67d124318928", "collaboration.interrupt_agent": "2267464134322564b477c2071a43759fd536efa3", "collaboration.list_agents": "d987d2a1e82acbbae7443d42e8f2d95193658cf8", "collaboration.send_message": "b819d4153e4de3810e02069a09a02d792d729740", "collaboration.spawn_agent": "505c6adf0eaa1c4b2ae5e163a498e71cd6bd811c", "collaboration.wait_agent": "dc7676a6bd8dfdc175b52d69b71c14b1c6e276fd", "functions": "1280f4a8681f8bc4035e99ba9c8e3ba2e657c6af", "functions.exec": "90a2e17e6b04fbaab5a5e8535164a4aadfdc90d4", "functions.request_user_input": "776071d04540321db1d194f0ec11ed4e2319f8ae", "functions.request_user_input_async": "32fcc4bbb4a5ae6aa165ae1cabca86d57a4189aa", "functions.wait": "4c5f0afb6eaa30c948be423b972535b5bc88a95a"}}}}
|
||||
{"timestamp": "2026-11-19T12:49:45.278Z", "ordinal": 9, "type": "turn_context", "payload": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "root_turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "disabled_plugin_ids": [], "cwd": "/home/dev/w", "approval_policy": "never", "approvals_reviewer": "user", "permission_profile": {"type": "disabled"}, "model": "gpt-6.1-sol", "comp_hash": "3000", "collaboration_mode": {"mode": "default", "settings": {"model": "gpt-6.1-sol", "reasoning_effort": "low", "developer_instructions": null}}, "multi_agent_version": "v2", "realtime_active": false, "effort": "low", "summary": "none", "sandbox_policy": {"type": "danger-full-access"}}}
|
||||
{"timestamp": "2026-11-19T12:49:45.278Z", "ordinal": 10, "type": "event_msg", "payload": {"type": "thread_settings_applied", "thread_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "thread_settings": {"model": "gpt-6.1-sol", "model_provider_id": "probe", "approval_policy": "never", "approvals_reviewer": "user", "requested_approvals_reviewer": "user", "permission_profile": {"type": "disabled"}, "cwd": "/home/dev/w", "runtime_workspace_roots": ["/home/dev/w"], "reasoning_effort": "low", "collaboration_mode": {"mode": "default", "settings": {"model": "gpt-6.1-sol", "reasoning_effort": "low", "developer_instructions": null}}, "disabled_plugin_ids": []}}}
|
||||
{"timestamp": "2026-11-19T12:49:45.338Z", "ordinal": 11, "type": "response_item", "payload": {"type": "message", "id": "msg_01a1f3db-1b7a-7811-be6c-e2c88a4c5220", "role": "user", "content": [{"type": "input_text", "text": "$review [stub-met] check this branch against main\n"}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.3388932, "content_item_kinds": ["user.text"], "content_item_metadata": [{"provenance": {"type": "user"}}]}}, "metadata": {"history_sequence": 7, "sampled_through_sequence": 0, "retained_source": {"id": {"message_id": "msg_01a1f3db-1b7a-7811-be6c-e2c88a4c5220", "turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "role": "user"}, "revision": "retained_01a1f3db-1b7a-7811-be6c-e2e90b11629b", "complete": true}, "client_authored": false, "user_input_order": 0, "mcp_attribution": {"status": "none"}}}
|
||||
{"timestamp": "2026-11-19T12:49:45.339Z", "ordinal": 12, "type": "event_msg", "payload": {"type": "item_completed", "thread_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "item": {"type": "UserMessage", "id": "01a1f3db-1b7a-7811-be6c-e2d118ecd1dc", "content": [{"type": "text", "text": "$review [stub-met] check this branch against main\n", "text_elements": []}]}, "started_at_ms": 1795092585339, "completed_at_ms": 1795092585339}}
|
||||
{"timestamp": "2026-11-19T12:49:45.342Z", "ordinal": 13, "type": "response_item", "payload": {"type": "message", "id": "msg_01a1f3db-1b7d-7cd0-ad48-ba1e7a7918b4", "role": "user", "content": [{"type": "input_text", "text": "<skill>\n<name>review</name>\n<path>/home/dev/gstack/.agents/skills/gstack-review/SKILL.md</path>\n---\nname: review\ndescription: |\n Use when you review a diff before it lands: local changes, a branch or a PR.\n Finds bugs that pass CI and break production. Fits \"review this PR\", \"look\n over my diff\", \"review my changes\", \"code review\", \"check my diff\" or\n \"pre-landing review\".\n Proactively suggest before a merge. (gstack)\n---\n<!-- AUTO-GENERATED from SKILL.md.tmpl \u2014 do not edit directly -->\n<!-- Regenerate: bun run gen:skill-docs -->\n\n## Done means\n\nFinish only when each of these exists (contract v1):\n\n- `adversarial-pass`: an Agent dispatch for the adversarial pass, its prompt including \"Think like an attacker and a chaos engineer\".\n- `review-report`: a `Pre-Landing Review` with Gate edits filled in (`none: <why>` where the skill's own stop rule leaves one empty).\n\n`$GSTACK_BIN/gstack-\n[... 103070 characters trimmed from this fixture ...]\nimilarity alone is not a defect. Keep actual defects independently actionable.\n- **Use the reply templates from greptile-triage.md.** Every reply includes evidence. Never post vague replies.\n\n</skill>"}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.3419836, "content_item_kinds": ["skills.selected_skill_instructions"], "content_item_metadata": [{"provenance": {"type": "skills"}}]}}, "metadata": {"history_sequence": 8, "sampled_through_sequence": 0, "client_authored": false}}
|
||||
{"timestamp": "2026-11-19T12:49:45.364Z", "ordinal": 14, "type": "response_item", "payload": {"type": "function_call", "status": "completed", "id": "fc_1", "name": "spawn_agent", "namespace": "collaboration", "arguments": "{\"message\": \"gAAAAAB0cUd2OCJ9gS7bZIx4JTczOf6mIH7ZP69JI6FMHycLH9GpS9YCMF6bzYs_VIciRUgs96s7IAnExeln6um-HqQlI0t2TUV5Qx3GQjrlxAQ5u9N20qTwU3CWgPSLZKFiKSD1F2cGryoAX1xVYeLz3NPG3AlyiYdyhoo3ryPL6lGi6iQGWgNPIffifSQ-0qQAVKy1oHstpan98I9SciXhYltpGQ5dcACvjJmYmrgCMAM19GGL72xRQ4HW8P_VXpTwZTZ\", \"fork_turns\": \"none\", \"task_name\": \"adversarial\"}", "call_id": "call_spawn_1", "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027"}}, "metadata": {"history_sequence": 9, "sampled_through_sequence": 8, "client_authored": false, "user_input_order": 1}}
|
||||
{"timestamp": "2026-11-19T12:49:45.364Z", "ordinal": 14, "type": "response_item", "payload": {"type": "agent_message", "id": "amsg_task_1", "author": "/root", "recipient": "/root/adversarial", "content": [{"type": "encrypted_content", "encrypted_content": "gAAAAAB0cUd2OCJ9gS7bZIx4JTczOf6mIH7ZP69JI6FMHycLH9GpS9YCMF6bzYs_VIciRUgs96s7IAnExeln6um-HqQlI0t2TUV5Qx3GQjrlxAQ5u9N20qTwU3CWgPSLZKFiKSD1F2cGryoAX1xVYeLz3NPG3AlyiYdyhoo3ryPL6lGi6iQGWgNPIffifSQ-0qQAVKy1oHstpan98I9SciXhYltpGQ5dcACvjJmYmrgCMAM19GGL72xRQ4HW8P_VXpTwZTZ"}]}}
|
||||
{"timestamp": "2026-11-19T12:49:45.377Z", "ordinal": 16, "type": "event_msg", "payload": {"type": "item_completed", "thread_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "item": {"type": "SubAgentActivity", "model": "gpt-6.1-sol", "reasoning_effort": "low", "id": "call_spawn_1", "kind": "started", "agent_thread_id": "01a1f3db-1b9b-7402-8468-fc90da547e1d", "agent_path": "/root/adversarial"}, "started_at_ms": 1795092585377, "completed_at_ms": 1795092585377}}
|
||||
{"timestamp": "2026-11-19T12:49:45.384Z", "ordinal": 17, "type": "response_item", "payload": {"type": "function_call_output", "id": "fco_01a1f3db-1ba8-7021-8504-d1138ed06f55", "call_id": "call_spawn_1", "output": "{\"task_name\":\"/root/adversarial\"}", "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "create_time": 1795092585.3847961}}, "metadata": {"history_sequence": 10, "sampled_through_sequence": 8, "client_authored": false, "fallback_token_limit_override": 12000}}
|
||||
{"timestamp": "2026-11-19T12:49:45.388Z", "ordinal": 19, "type": "world_state", "payload": {"full": false, "state": {"environments": {"subagents": "<agent name=\"/root/adversarial\" />"}}}}
|
||||
{"timestamp": "2026-11-19T12:49:45.404Z", "ordinal": 20, "type": "event_msg", "payload": {"type": "item_completed", "thread_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "item": {"type": "AgentMessage", "id": "msg_r", "content": [{"type": "Text", "text": "## Pre-Landing Review\n\nNo blocking findings.\n\nGate edits: none.\n"}]}, "started_at_ms": 1795092585404, "completed_at_ms": 1795092585404}}
|
||||
{"timestamp": "2026-11-19T12:49:45.405Z", "ordinal": 21, "type": "response_item", "payload": {"type": "agent_message", "id": "amsg_final_1", "author": "/root/adversarial", "recipient": "/root", "content": [{"type": "input_text", "text": "Message Type: FINAL_ANSWER\nTask name: /root\nSender: /root/adversarial\nPayload:\n- calc.py:4 avg([]) divides by zero. Severity: High Blocks: yes\nRecommendation: Fix the empty-list crash at calc.py:4 because any caller passing [] gets ZeroDivisionError"}]}}
|
||||
{"timestamp": "2026-11-19T12:49:45.405Z", "ordinal": 21, "type": "response_item", "payload": {"type": "message", "status": "completed", "id": "msg_r", "role": "assistant", "content": [{"type": "output_text", "text": "## Pre-Landing Review\n\nNo blocking findings.\n\nGate edits: none.\n", "annotations": []}], "internal_chat_message_metadata_passthrough": {"turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "content_item_kinds": ["unknown"]}}, "metadata": {"history_sequence": 11, "sampled_through_sequence": 10, "retained_source": {"id": {"message_id": "msg_r", "turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "role": "assistant"}, "revision": "retained_01a1f3db-1bbd-7650-82fd-3ca9e5d030f4", "complete": true}, "client_authored": false, "user_input_order": 2}}
|
||||
{"timestamp": "2026-11-19T12:49:45.426Z", "ordinal": 24, "type": "event_msg", "payload": {"type": "item_completed", "thread_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "turn_id": "01a1f3db-1b29-7870-ba61-3e4e400e4027", "item": {"type": "SubAgentActivity", "model": null, "reasoning_effort": null, "id": "subagent-completed-01a1f3db-1ba1-7e61-8aad-ca682d88122c", "kind": "completed", "agent_thread_id": "01a1f3db-1b9b-7402-8468-fc90da547e1d", "agent_path": "/root/adversarial"}, "started_at_ms": 1795092585426, "completed_at_ms": 1795092585426}}
|
||||
@@ -0,0 +1,6 @@
|
||||
{"timestamp": "2026-11-19T12:49:45.370Z", "ordinal": 0, "type": "session_meta", "payload": {"session_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "id": "01a1f3dc-2be4-7a10-9c2e-41d7b3a90e15", "parent_thread_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "cwd": "/home/dev/w", "originator": "codex_exec", "cli_version": "0.170.0", "source": {"subagent": {"thread_spawn": {"parent_thread_id": "01a1f3db-1ad3-74c1-a9e5-8eae6d5ca6c1", "depth": 1, "agent_path": "/root/adversarial", "agent_nickname": null, "agent_role": null}}}, "thread_source": "subagent", "model_provider": "openai", "multi_agent_version": "v2"}}
|
||||
{"timestamp": "2026-11-19T12:49:45.371Z", "ordinal": 1, "type": "response_item", "payload": {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "<environment_context>\n <cwd>/home/dev/w</cwd>\n <shell>bash</shell>\n</environment_context>"}]}}
|
||||
{"timestamp": "2026-11-19T12:49:45.372Z", "ordinal": 2, "type": "response_item", "payload": {"type": "agent_message", "id": "amsg_task_1", "author": "/root", "recipient": "/root/adversarial", "content": [{"type": "encrypted_content", "encrypted_content": "gAAAAAB0cUd2OCJ9gS7bZIx4JTczOf6mIH7ZP69JI6FMHycLH9GpS9YCMF6bzYs_VIciRUgs96s7IAnExeln6um-HqQlI0t2TUV5Qx3GQjrlxAQ5u9N20qTwU3CWgPSLZKFiKSD1F2cGryoAX1xVYeLz3NPG3AlyiYdyhoo3ryPL6lGi6iQGWgNPIffifSQ-0qQAVKy1oHstpan98I9SciXhYltpGQ5dcACvjJmYmrgCMAM19GGL72xRQ4HW8P_VXpTwZTZ"}]}}
|
||||
{"timestamp": "2026-11-19T12:49:45.380Z", "ordinal": 3, "type": "response_item", "payload": {"type": "function_call", "name": "exec_command", "arguments": "{\"cmd\": \"git diff main...HEAD\"}", "call_id": "call_sub_1"}}
|
||||
{"timestamp": "2026-11-19T12:49:45.390Z", "ordinal": 4, "type": "response_item", "payload": {"type": "function_call_output", "call_id": "call_sub_1", "output": "Process exited with code 0\nOutput:\n+def avg(xs):\n+ return sum(xs) / len(xs)\n"}}
|
||||
{"timestamp": "2026-11-19T12:49:45.400Z", "ordinal": 5, "type": "response_item", "payload": {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "- calc.py:4 avg([]) divides by zero. Severity: High Blocks: yes\nRecommendation: Fix the empty-list crash at calc.py:4 because any caller passing [] gets ZeroDivisionError"}]}}
|
||||
@@ -308,7 +308,7 @@ describe('checkContract on Codex with the real /review contract', () => {
|
||||
const item = (tr: Transcript) => checkContract(tr, 'gstack-review', realReview(t)).items.find(i => i.id === 'adversarial-pass');
|
||||
expect(item(t)).toMatchObject({
|
||||
detail: 'no spawn_agent call matches /Think like an attacker and a chaos engineer/',
|
||||
fix: 'start the subagent pass matching /Think like an attacker and a chaos engineer/ with spawn_agent, then wait_agent for its result',
|
||||
fix: 'start the subagent pass with spawn_agent (task_name "adversarial", its message matching /Think like an attacker and a chaos engineer/), then wait_agent for its result',
|
||||
});
|
||||
expect(item({ events: t.events, sessionId: t.sessionId })).toMatchObject({
|
||||
detail: 'no Agent dispatch matches /Think like an attacker and a chaos engineer/',
|
||||
@@ -323,6 +323,92 @@ describe('checkContract on Codex with the real /review contract', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('encrypted spawn messages: Codex multi-agent v2 with OpenAI models (GST-3375)', () => {
|
||||
// Codex encrypts the spawn_agent message for OpenAI models (openai/codex#26210), so the brief's marker never reaches
|
||||
// either rollout. These fixtures are synthetic (README): Sol's collaboration spawn with its message swapped for ciphertext.
|
||||
const enc = lines('exec-sol-encrypted-spawn.jsonl');
|
||||
const spawnCall = () => enc.map(l => JSON.parse(l).payload).find(p => p?.type === 'function_call' && p.name === 'spawn_agent');
|
||||
const edit = (fn: (p: Record<string, any>) => Record<string, any> | null) => parseTranscript(enc.flatMap(l => {
|
||||
const rec = JSON.parse(l);
|
||||
const p = rec.payload?.type ? fn({ ...rec.payload }) : rec.payload;
|
||||
return p === null ? [] : [JSON.stringify({ ...rec, payload: p })];
|
||||
}).join('\n'));
|
||||
const withArgs = (change: Record<string, unknown>) => (p: Record<string, any>) =>
|
||||
p.type === 'function_call' && p.name === 'spawn_agent' ? { ...p, arguments: JSON.stringify({ ...JSON.parse(p.arguments), ...change }) } : p;
|
||||
|
||||
test('the fixtures carry ciphertext where the brief was, and the marker is in neither rollout\'s dispatch', () => {
|
||||
const args = JSON.parse(spawnCall().arguments);
|
||||
expect(args.task_name).toBe('adversarial');
|
||||
expect(args.message).toMatch(/^gAAAAAB[A-Za-z0-9_-]+=*$/);
|
||||
expect(spawnCall().arguments).not.toContain('Think like an attacker');
|
||||
expect(read('exec-sol-encrypted-subagent.jsonl')).not.toContain('Think like an attacker');
|
||||
const sub = rollout('exec-sol-encrypted-subagent.jsonl');
|
||||
expect(sub.subagent).toBe(true);
|
||||
expect(JSON.parse(lines('exec-sol-encrypted-subagent.jsonl')[0]).payload.source.subagent.thread_spawn.agent_path).toBe('/root/adversarial');
|
||||
});
|
||||
|
||||
test('a started spawn named adversarial with an encrypted message meets the adversarial pass', () => {
|
||||
const t = rollout('exec-sol-encrypted-spawn.jsonl');
|
||||
expect(status(t, realReview(t))).toEqual({ 'adversarial-pass': 'met', 'review-report': 'met' });
|
||||
expect(checkContract(t, 'gstack-review', realReview(t)).met).toBe(true);
|
||||
});
|
||||
|
||||
test('negative control: no adversarial spawn is still missing', () => {
|
||||
const t = edit(p => (p.call_id === 'call_spawn_1' ? null : p));
|
||||
expect(status(t, realReview(t))['adversarial-pass']).toBe('missing');
|
||||
});
|
||||
|
||||
test('negative control: an encrypted spawn of a differently named agent is still missing', () => {
|
||||
for (const name of ['red-team', 'adversarial-2', 'worker']) {
|
||||
const t = edit(p => {
|
||||
const q = withArgs({ task_name: name })(p);
|
||||
return q.type === 'function_call_output' && q.call_id === 'call_spawn_1' ? { ...q, output: JSON.stringify({ task_name: `/root/${name}` }) } : q;
|
||||
});
|
||||
expect(status(t, realReview(t))['adversarial-pass']).toBe('missing');
|
||||
}
|
||||
});
|
||||
|
||||
test('negative control: a spawn that never started is still missing, whatever it was named', () => {
|
||||
const t = edit(p => (p.type === 'function_call_output' && p.call_id === 'call_spawn_1' ? { ...p, output: 'spawn_agent failed: agent limit reached' } : p));
|
||||
expect(status(t, realReview(t))['adversarial-pass']).toBe('missing');
|
||||
});
|
||||
|
||||
test('negative control: a plaintext message is still held to the marker, even when the agent is named adversarial', () => {
|
||||
const t = edit(withArgs({ message: 'Look over the diff and say if it looks fine.' }));
|
||||
expect(status(t, realReview(t))['adversarial-pass']).toBe('missing');
|
||||
});
|
||||
|
||||
test('Claude Code is unchanged: the same events read as a Claude transcript still need the marker', () => {
|
||||
const t = rollout('exec-sol-encrypted-spawn.jsonl');
|
||||
const asClaude: Transcript = { events: t.events, sessionId: t.sessionId };
|
||||
expect(status(asClaude, realReview(t))['adversarial-pass']).toBe('missing');
|
||||
});
|
||||
|
||||
test('the review report has no such blind spot: it is the parent\'s own text, which Codex does not encrypt', () => {
|
||||
const t = rollout('exec-sol-encrypted-spawn.jsonl');
|
||||
expect(status(t, realReview(t))['review-report']).toBe('met');
|
||||
const noReport = edit(p => (p.type === 'message' && p.role === 'assistant' ? null : p));
|
||||
expect(status(noReport, realReview(noReport))['review-report']).toBe('missing');
|
||||
});
|
||||
|
||||
test('on Codex the block text names the task name the check looks for', () => {
|
||||
const t = edit(p => (p.call_id === 'call_spawn_1' ? null : p));
|
||||
const item = checkContract(t, 'gstack-review', realReview(t)).items.find(i => i.id === 'adversarial-pass');
|
||||
expect(item?.fix).toBe('start the subagent pass with spawn_agent (task_name "adversarial", its message matching /Think like an attacker and a chaos engineer/), then wait_agent for its result');
|
||||
});
|
||||
|
||||
test('gstack-skill-contract check passes the encrypted run', () => {
|
||||
const work = tmpDir('gstack-codex-enc-');
|
||||
try {
|
||||
const r = spawnSync(BIN, ['check', '--transcript', path.join(DIR, 'exec-sol-encrypted-spawn.jsonl'), '--skill', 'gstack-review'], { env: hookEnv(work, work, { GSTACK_INSTALLED_SKILLS_DIR: '', HOME: work }), encoding: 'utf8', timeout: 20_000 });
|
||||
expect(r.status).toBe(0);
|
||||
expect(r.stdout).toStartWith('SKILL_CONTRACT_MET gstack-review');
|
||||
} finally {
|
||||
fs.rmSync(work, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('the Stop hook on Codex', () => {
|
||||
let state = '', work = '', skills = '';
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -45,6 +45,8 @@ describe('schema v1', () => {
|
||||
['contract:\n version: 1\n items: [{id: Bad_ID, kind: agent_dispatch, match: x}]', 'id must match'],
|
||||
['contract:\n version: 1\n items: [{id: a, kind: check_after_last_edit}]', 'every item uses a removed kind'],
|
||||
['contract: [unclosed', 'not valid YAML'],
|
||||
['contract:\n version: 1\n items: [{id: a, kind: report_labels, heading: X, labels: [Y], task_name: z}]', 'task_name applies only to agent_dispatch'],
|
||||
['contract:\n version: 1\n items: [{id: a, kind: agent_dispatch, match: x, task_name: "two words"}]', 'task_name must match'],
|
||||
];
|
||||
for (const [fm, msg] of bad) {
|
||||
const r = parseContract(fm);
|
||||
@@ -132,6 +134,12 @@ describe('checkContract is a pure function of the transcript', () => {
|
||||
expect(parseContract('contract:\n version: 1\n items: [{id: a, kind: selected_specialists_dispatched, marker: "Dispatching N specialists:"}]')).toHaveProperty('contract');
|
||||
});
|
||||
|
||||
test('GST-3375: on Claude Code a task name never stands in for the marker, whatever the Agent call carries', () => {
|
||||
const item = { id: 'adversarial', kind: 'agent_dispatch' as const, match: 'Think like an attacker', task_name: 'adversarial' };
|
||||
const t = parseTranscript([slash('review'), tool('s', 'Agent', { description: 'adversarial', prompt: 'gAAAAABnot-a-brief-at-all-just-a-token', task_name: 'adversarial', sealed: true }), result('s', '[]')].join('\n'));
|
||||
expect(checkContract(t, 'review', { version: 1, items: [item] }).items[0]).toMatchObject({ status: 'missing', detail: 'no Agent dispatch matches /Think like an attacker/' });
|
||||
});
|
||||
|
||||
test('GST-1242: the waive command in the block text is a literal path to bash, and the transcript reader counts it', () => {
|
||||
const r = check(J1_TRANSCRIPT);
|
||||
const bin = "/opt/it's gstack $(touch pwned)/bin/gstack-skill-contract";
|
||||
|
||||
@@ -185,6 +185,8 @@ describe('contract-done-means renderer', () => {
|
||||
['marker missing', one({ id: 'a', kind: 'selected_specialists_dispatched' }), /marker must be a non-empty string/],
|
||||
['match missing', one({ id: 'a', kind: 'agent_dispatch' }), /match must be a non-empty string/],
|
||||
['field from another kind', one({ id: 'a', kind: 'agent_dispatch', match: 'x', heading: 'R' }), /unknown key "heading"/],
|
||||
['task_name on another kind', one({ id: 'a', kind: 'report_labels', heading: 'R', labels: ['S'], task_name: 'x' }), /unknown key "task_name"/],
|
||||
['task_name not a plain name', one({ id: 'a', kind: 'agent_dispatch', match: 'x', task_name: 'Two Words' }), /task_name must be lowercase/],
|
||||
];
|
||||
for (const [name, value, want] of MALFORMED) {
|
||||
test('a malformed block fails loudly: ' + name, () => {
|
||||
@@ -226,6 +228,8 @@ describe('contract-done-means renderer', () => {
|
||||
expect(ids('claude')).toEqual(['specialists-dispatched', 'adversarial-pass', 'review-report']);
|
||||
expect(ids('codex')).toEqual(['adversarial-pass', 'review-report']);
|
||||
expect(ids('hermes')).toEqual(['review-report']);
|
||||
expect(render('codex')).toContain('- ' + BT + 'adversarial-pass' + BT + ': a ' + BT + 'spawn_agent' + BT + ' (' + BT + 'task_name: adversarial' + BT + '), its prompt including "Think like an attacker and a chaos engineer".');
|
||||
expect(render('claude')).toContain('- ' + BT + 'adversarial-pass' + BT + ': an Agent dispatch for the adversarial pass, its prompt including "Think like an attacker and a chaos engineer".');
|
||||
expect(renderDoneMeans({ version: 1, items: [] }, HOST_PATHS.claude.binDir)).toBe('');
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user