fix: name task threads after the <task> block - #792
Open
minhoyooDEV wants to merge 1 commit into
Open
minhoyooDEV wants to merge 1 commit into
minhoyooDEV wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #321. Also fixes #283, which reports the same problem.
Problem
buildTaskThreadNamenames a task threadCodex Companion Task:plus the first 56 characters of the prompt. Thegpt-5-4-promptingskill thatcodex:codex-rescueloads 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 mentionsMap<string>keeps it in the name.Tests
task names the thread after the <task> block of a structured prompt: fails onmainwithCodex 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.mjspasses 93/93 on macOS arm64 with Node 26.8.1 (main: 91/91), run withCLAUDE_PLUGIN_DATAandCODEX_COMPANION_SESSION_IDunset (see #456).tsc -p tsconfig.app-server.jsonreports 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