codex icon indicating copy to clipboard operation
codex copied to clipboard

[Desktop Windows 26.825] Cross-thread delegation card fails to inject prompt body into destination LLM context

Open seasoninlife512-blip opened this issue 2 months ago • 6 comments

Summary

In Codex Desktop for Windows 26.825.6671.0, cross-thread task delegation (send_message_to_thread / codex_delegation) renders a task card in the UI ("Sent by ChatGPT from another task" / "由 ChatGPT 从另一项任务发送" with a collapsible "Show more ∨" / "显示更多 ∨"), but fails to inject the actual prompt text into the destination model's input context window (UserMessage).

As a result:

  1. The target thread's LLM never receives the new task prompt in its actual model context.
  2. The destination agent either blindly repeats its previous turn's output/completion text (with 0 new reasoning tokens), or idles.
  3. When the user manually inquires in the thread what task it received, the agent explicitly confesses that its conversation context contains none of the delegated task text.

Reproduction Steps

  1. In Thread A (Coordinator), invoke tools.mcp__codex_app__send_message_to_thread targeting an existing Thread B with a multi-line task description.
  2. Thread B's window in Codex Desktop renders the delegation header card: "Sent by ChatGPT from another task" with a collapsed task snippet and "Show more ∨".
  3. Thread B immediately responds without executing the new task, regurgitating its previous turn completion (e.g. COMPLETED_FOR_ACCEPTANCE or repeating previously completed commit info).
  4. In Thread B's chat input, manually type and send: "Can you recite the full task you received from the other thread?"
  5. Thread B responds that its textual conversation context does not contain the delegated task prompt at all, and that it can only guess from the truncated snippet visible if provided a screenshot.

Observed Behavior

  • The UI renders the delegation card correctly.
  • In the session JSONL (rollout-*.jsonl), the cross-thread dispatch is delivered as a custom event or tool output, but is never translated into a valid UserMessage turn containing the prompt text in the destination LLM context.
  • The model in Thread B has essentially 0 reasoning tokens for the turn, hallucinates or recycles its previous state, and halts.
  • Only when the user manually enters text into Thread B's input field is a proper role: user message dispatched, waking up the model properly.

Expected Behavior

When send_message_to_thread delivers a message to a destination thread:

  • The entire prompt body must be injected into the destination turn's context as a first-class user instruction (UserMessage).
  • The model must receive the full text (not truncated by UI folds) and initiate a new reasoning/planning turn to execute the requested instructions.

Environment

  • Client: Codex Desktop App for Windows (Microsoft Store package OpenAI.Codex_26.825.6671.0_x64__2p2nqsd0c76g0)
  • App Version: 26.825.6671.0
  • OS: Windows 11 Pro 64-bit
  • Tool involved: tools.mcp__codex_app__send_message_to_thread / codex_delegation

Impact

This breaks autonomous coordinator-worker / multi-agent orchestration. A controller thread believes the task was successfully handed off, while the worker thread never received the instructions and falsely reports completion based on stale context.

seasoninlife512-blip avatar Sep 03 '26 06:09 seasoninlife512-blip

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #42131

Powered by Codex Action

github-actions[bot] avatar Sep 03 '26 06:09 github-actions[bot]

Confirmed reproduction on a newer build (Windows, bundled runtime 26.904.11930), with a canary-based control that rules out "model saw but ignored it".

Environment

  • Codex Desktop for Windows, bundled runtime 26.904.11930 (reporter was on 26.825.6671.0 — still broken two builds later)
  • OS: Windows 11 64-bit
  • Destination thread model: gpt-5.6-sol

Repro

  1. Thread A (coordinator): create_thread targeting a project workspace, then send_message_to_thread with a task containing a canary: "run echo "hello world", reply starting with the token CANARY_OK, and state where in your conversation history you read this task from (user message / codex_delegation tool output / other)".
  2. Observe Thread B via the read_thread API (raw turn items) and its visible reply.

Observed

  • The delegation is persisted in Thread B's transcript as a functionCallOutput (namespace codex_app, name send_message_to_thread) whose output wraps the prompt in <codex_delegation><source_thread_id>…</source_thread_id><input>…</input></codex_delegation>. The full prompt text is intact there.
  • Thread B's model shows zero awareness of it: no canary, no command execution, and the reply states no task has been assigned and asks for instructions. Notably, the turn emitted zero reasoning items, matching the "0 new reasoning tokens" symptom described in the issue body.
  • Additional affected surfaces on the same build:
    • create_thread's initial prompt never arrives either: the created thread's first turn behaves as if no prompt was supplied ("ready, what would you like to work on?").
    • A heartbeat automation fired on Thread B delivers its instructions the same broken way — persisted as a functionCallOutput containing <heartbeat><instructions>…</instructions></heartbeat>, model unaware. So the injection gap is not specific to cross-thread delegation; any harness-injected instruction payload seems to bypass the model context on this build.
  • Only a manually typed message in Thread B produces a proper user turn.

Notes

  • The canary methodology cleanly separates "never entered model context" from "entered but ignored": the token exists nowhere in the workspace, thread title, or cwd, so producing it is only possible by reading the payload. It was never produced.
  • Happy to share redacted rollout JSONL excerpts if useful.

budahan0 avatar Sep 06 '26 15:09 budahan0

Additional reproduction on Windows, observed 2026-09-06/07, with precise app/runtime versions and redacted read_thread evidence.

Environment

  • Installed/running Windows application package: OpenAI.Codex 26.901.6511.0 (process name ChatGPT.exe).
  • Running codex.exe reports: codex-cli 0.153.4.
  • OS version reported by Windows: NT 10.0.26100.0, x64.
  • User reports this started after an application update and repeated across independent attempts. The last known good version has not been established.

Confirmed cases

  1. create_thread with a nonempty, detailed prompt in a Git worktree: the target completes its initial turn by asking what task it should perform.
  2. create_thread with a nonempty, detailed prompt directly in the saved local project (no worktree): same behavior.
  3. send_message_to_thread to that new local-project target with the full assignment again: the API returns a threadId, but the target again asks for a task. Thus changing to a local checkout or resending is not a working workaround in this reproduction.

The local-project initial turn completed in 20,788 ms; the follow-up completed in 6,349 ms. Both report status=completed and error=null. Neither executed the assigned work.

Redacted evidence

The first-party read_thread response for the local-project follow-up contains these items. Source identifiers and the proprietary assignment body are replaced with explicit placeholders; the assistant reply is verbatim:

{
  "status": "completed",
  "error": null,
  "durationMs": 6349,
  "items": [
    {
      "type": "functionCallOutput",
      "name": "send_message_to_thread",
      "namespace": "codex_app",
      "output": {
        "text": "<codex_delegation>\n  <source_thread_id><redacted-source-thread-id></source_thread_id>\n  <input><redacted-nonempty-assignment-with-objective-constraints-and-completion-criteria></input>\n</codex_delegation>",
        "truncated": false
      }
    },
    {
      "type": "agentMessage",
      "text": "请告诉我具体要处理的任务,例如 BUG 号、日志路径与问题现象,或需要修改的代码/文档。",
      "phase": "final_answer"
    }
  ]
}

Translation of the reply: "Please tell me the specific task to handle, such as a bug number, log path and symptoms, or the code/document to modify."

The initial local-project turn likewise contains the intact assignment in a functionCallOutput named create_thread, then the reply:

你想让我处理什么任务?可以直接给我 BUG 号、日志路径、问题现象,或需要修改的代码/文档。

The worktree target showed the same initial-turn pattern. A later minimal follow-up to that target completed in 2,972 ms, but read_thread returned an empty items array. This empty-readback symptom is recorded separately; it does not by itself prove that no inference occurred.

Scope of the evidence / suspected boundary

The assignment is present in the first-party target transcript, and the receiving assistant behaves as if there is no assignment. This supports investigating the boundary between delegated-event persistence and effective model context/instruction handling. We have not captured the actual outbound inference request, so this evidence alone cannot distinguish omitted model context from mishandling of an included delegation payload. Also, the codex_delegation envelope itself may be intentional provenance handling; merely seeing that wrapper is not proof of the implementation bug.

Please include regression coverage for both create_thread and send_message_to_thread, with both worktree and local targets, asserting an exact harmless response token rather than accepting status=completed as success. Preserve source attribution while ensuring the delegated objective is actionable.

No private bug IDs, project names, host paths, raw logs, credentials, or actual thread IDs are included in this comment.

M1nt-Ch0c0 avatar Sep 07 '26 01:09 M1nt-Ch0c0

Adding a sanitized macOS observation and requesting a maintainer triage update. Cross-task dispatch remains unreliable in our coordinator workflow as of September 7.

In an investigation on September 3, a local receiving task was reported as idle. We sent a narrowly scoped role-refresh request with a unique correlation marker, explicitly selecting gpt-5.6-sol and medium reasoning. The observed results were:

  • A bundled CLI exec resume attempt failed with already has an active writer, despite the task being reported idle. This may be normal Desktop ownership rather than the root cause, but it prevented that fallback.
  • A CLI queue attempt was accepted, but the task readback showed an interrupted turn with an empty items array.
  • After opening the target in Desktop, a second queue attempt produced a completed turn after about 22 seconds, still with empty items in read_thread.
  • A subsequent send_message_to_thread returned the target ID and produced a completed turn after about 4 seconds, again with empty readback and no verifiable acknowledgement of the correlation marker.

Separately, the target had retained an obsolete "waiting for role transfer" statement even though an independent local role check confirmed that the transfer had already happened. Adding an explicit rule to refresh that local state and asking directly in the target task appeared to resolve the role answer, but did not establish that cross-task delivery was repaired.

Evidence limits: we did not capture the outbound inference payload or establish the exact Desktop/runtime build for the September 3 incident. A later local bundled CLI check on September 6 returned 0.153.4; that must not be retroactively assigned to the earlier incident. Empty items could reflect a history projection/readback issue rather than absent inference. Likewise, functionCallOutput can be intentional provenance representation and is not itself proof of failed delivery. We cannot yet establish whether our readback symptoms and the other reports here share a root cause.

The practical impact is that neither an accepted send nor status=completed currently gives us a reliable indication that the receiving task acted on the new assignment. Repeated retries risk duplicate work, while replacing tasks can lose useful continuity. Related #42131 and #42695 also describe loss of the current delegated objective after continuation or compaction.

Could a maintainer please confirm whether this cluster is being triaged, whether there is a tracking fix/PR or a known-good Desktop build, and what minimal redacted evidence would best distinguish delivery/context handling from history projection? A supported temporary workaround would also help. Please prioritize a regression covering an exact harmless acknowledgement marker, idle and loaded/unloaded targets, and continuation across compaction, while preserving the delegated message's source attribution.

This comment intentionally excludes project names, task identifiers, local paths, original prompts, screenshots, and raw logs.

Xigcheck avatar Sep 07 '26 09:09 Xigcheck

Additional macOS reproduction, observed on September 7, 2026 (UTC+8), with an important distinction: the receiving agent initially acted on the delegated assignment, then denied having a task. No context compaction was recorded during the failed turns.

Environment

  • Codex in ChatGPT Desktop 26.901.51231 (build 8109), macOS on Apple Silicon.
  • Affected task metadata: codex-cli/app-server 0.153.4, gpt-6-astra, high reasoning.
  • A new persistent task in a managed Git worktree.
  • A custom provider configured with wire_api = "responses" was used. We have not compared this case against the default provider, so provider compatibility remains a possible contributing factor.

Observed sequence

The task description and replies below are English translations or sanitized summaries, not verbatim transcript excerpts.

  1. At 23:43, a coordinator called create_thread with a detailed implementation assignment identifying the plan, scope, constraints, and completion criteria.
  2. The receiving task acknowledged the correct assignment and successfully ran five read-only commands, including reading the specified plan and related contract. It then ended by saying that its earlier intention to execute the assignment was a mistake and that no specific task had been provided. This turn lasted about 44 seconds.
  3. At 23:44, the coordinator resent the full assignment through send_message_to_thread. That turn completed after about 26 seconds with an empty final-answer text and no command execution.
  4. At 23:45, the coordinator sent a shorter, explicit instruction through the same tool. The receiver again asked for a specific task, after about 12 seconds, without running commands.
  5. At 23:47, the user manually sent a short instruction in the receiving task to execute the planned work. This produced a userMessage item. The same task and model then continued the assignment and successfully changed files.

All three failed turns reported status = completed and error = null. Completion did not mean the requested work was done.

Evidence and boundaries

  • Local saved records contain all three delegated instruction bodies inside function_call_output items named create_thread or send_message_to_thread, namespace codex_app, wrapped in codex_delegation.
  • The manually entered instruction is recorded as an ordinary user message.
  • No compaction events were recorded before or during the three failed turns. This case therefore does not require the mid-turn compaction scenario in #42695.
  • The first turn's correct acknowledgement and plan reads mean this cannot safely be described as total prompt non-delivery. The evidence supports investigating how the delegated objective is carried into subsequent model steps and treated as actionable input.
  • We have not captured the actual outbound inference requests, so we cannot distinguish client context construction, custom-provider handling, or model instruction handling.
  • The function-call-output representation alone is not proof of a defect. Source attribution should remain intact.

Impact and requested investigation

This disrupts unattended development: the coordinator successfully dispatches a task and sees completed turns, but the user must intervene manually to make work continue. Repeated dispatches did not resolve this incident.

Please include a regression that verifies an authenticated delegated assignment remains actionable after the receiver's first tool results, even without compaction. Cover both create_thread and send_message_to_thread, distinguish actual task progress from turn completion, and compare supported provider paths.

No private task IDs, project names, repository paths, original prompts, screenshots, credentials, or raw logs are included. No task history or live database was modified during diagnosis.

griffith-h avatar Sep 07 '26 16:09 griffith-h

Additional reproduction on Windows with the current production desktop build.

Environment:

  • Codex Desktop for Windows: 26.1111.21308, build 27194
  • Target: an existing local Codex task used as a long-lived executor thread
  • Native tool path: codex_app.send_message_to_thread
  • Codex++ 2.7.2 was installed, but the enabled user script only patches local fork readiness; it does not intercept send_message_to_thread or thread turns.

Observed behavior:

  1. The target executor had completed an earlier read-only probe.
  2. A coordinator sent a new task with send_message_to_thread.
  3. The target produced another answer to the old probe instead of the new task. This repeated across several distinct prompts.
  4. In the target rollout/history, the incoming prompt was represented as a function_call_output containing a <codex_delegation> envelope. There was no normal native user-message item containing the new task text.
  5. The stale answer was deterministic: it repeatedly returned the old probe result, even when the new prompt explicitly requested a different fixed token and no file access.

A separate upstream quota failure (HTTP 403) occurred during one retry, but after quota was restored the stale-context behavior still reproduced. Archiving and restoring the target thread finally changed behavior: the target then read the intended files and started the new task, although its thread environment still had a separate write-permission problem.

Expected behavior:

The delegated prompt should become the authoritative user turn in the destination thread, with a durable native user-message item and matching turn ID. The model should process that prompt rather than replaying the previous completed task.

This appears closely related to #42131, #32547, #42695, and #45894, but this report adds a current Windows reproduction and the local evidence that the delegated prompt is persisted as delegation/tool output rather than as the destination task's user turn.

Yotaoer avatar Nov 18 '26 11:11 Yotaoer