Skip to content

fix: name task threads after the <task> block - #792

Open
minhoyooDEV wants to merge 1 commit into
openai:mainfrom
minhoyooDEV:fix/task-thread-name-from-task-block
Open

minhoyooDEV wants to merge 1 commit into
openai:mainfrom
minhoyooDEV:fix/task-thread-name-from-task-block

Conversation

@minhoyooDEV

Copy link
Copy Markdown

Fixes #321. Also fixes #283, which reports the same problem.

Problem

buildTaskThreadName names a task thread Codex Companion Task: plus the first 56 characters of the prompt. The gpt-5-4-prompting skill that codex:codex-rescue loads tells the forwarder to put the job in a <task> block, so the name usually starts with <task>, or with instructions placed before the block. Delegated threads can't be told apart in the Codex thread list.

On one machine, 52 of 77 threads created by the plugin were named Codex Companion Task: <task> ....

Change

When the prompt contains a <task> block, the thread is named after the block's text. Otherwise the name is built as before. The prompt sent to Codex is unchanged.

Only the <task> block is read. Other angle-bracket text is left alone, so a prompt that mentions Map<string> keeps it in the name.

Tests

  • task names the thread after the <task> block of a structured prompt: fails on main with Codex Companion Task: Stay read-only. <task> Fix the flaky login test </tas..., passes with this change.
  • task names the thread after the prompt when it has no <task> block: guards the unchanged path, including angle-bracket text.

node --test tests/*.test.mjs passes 93/93 on macOS arm64 with Node 26.8.1 (main: 91/91), run with CLAUDE_PLUGIN_DATA and CODEX_COMPANION_SESSION_ID unset (see #456). tsc -p tsconfig.app-server.json reports no errors with TypeScript 5.9.3; the pinned 6.x was not available offline.

Replaying the new rule over the 77 local prompts, the number of names starting with a tag drops from 52 to 0.

🤖 Generated with Claude Code

Prompts shaped by the gpt-5-4-prompting skill carry the job in a <task>
block, often after other instructions, so delegated threads were named
"Codex Companion Task: <task> ..." and could not be told apart in the
Codex thread list. Name the thread after the block's text when present
and keep the current behavior otherwise.

Fixes openai#321
Fixes openai#283

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@minhoyooDEV
minhoyooDEV requested a review from a team September 29, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delegated sessions show unresolved placeholder in Codex Desktop Delegated sessions are not renamed with a representative identifier in Codex

1 participant