Skip to content

Task thread titles may be built from injected plugin context instead of the prompt #12

Description

@Edo771977

Upstream #734 reports that a task's thread title can end up showing a <recommended_plugins>…</recommended_plugins> block that Claude Code prepends to the prompt, rather than what the user actually asked for. Their fix strips one such block from the start of the prompt before the title is cut:

function buildTaskThreadName(prompt) {
  const titleSource = String(prompt ?? "").replace(
    /^\s*<recommended_plugins>[\s\S]*?<\/recommended_plugins>\s*/i,
    ""
  );
  const excerpt = shorten(titleSource, 56);
  return excerpt ? `${TASK_THREAD_PREFIX}: ${excerpt}` : TASK_THREAD_PREFIX;
}

We do not carry it. buildTaskThreadName() in plugins/codex/scripts/lib/codex.mjs still titles from the raw prompt, so if the injection happens here too, every affected task reads as Codex Task: <recommended_plugins> … in /codex:status, in /codex:result, and in the thread list — the one place the title has to tell jobs apart.

What is not established

Whether Claude Code actually prepends that block to the prompt the plugin receives. That was not reproduced here; the upstream PR asserts it, and the shape of the fix (anchored at the start, one block, case-insensitive) suggests they hit it in practice. Before importing, it is worth confirming on a real task run — the title is built from what reaches codex-companion.mjs, so a single /codex:task with a short prompt and a look at the resulting thread name settles it.

Why it is filed rather than imported

Cheap and low risk if the trigger is real (it changes only the title, never the prompt sent to Codex); pure noise in the code if it is not. Worth five minutes of confirmation rather than a speculative import.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions