Skip to content

Keep a title a person set when the Planner drafts the document heading - #665

Merged
lavaman131 merged 1 commit into
mainfrom
keep-member-title
Oct 17, 2026
Merged

lavaman131 merged 1 commit into
mainfrom
keep-member-title

Conversation

@lavaman131

Copy link
Copy Markdown
Collaborator

A member created a document titled "E2E5 2026-10-16: verify login resume". When the Planner later drafted the title and goal in the background, it replaced that title with "Verify login logic in auth.rs", and the slug changed with it.

Cause

The background heading job's draft_heading tool (apps/server/src/agent/heading-tool.ts) wrote the drafted title over whatever H1 the document had. The prompt even invited it to "refine even a human-chosen title". Nothing recorded who set the current title.

Change

  • draft_heading now replaces the title only in three cases:
    • the title is blank;
    • the title is still the generated adjective-noun name of a document created without a title;
    • the title equals the one a Planner last drafted.
  • The Planner's drafted title is stored in the sidecar as plannerTitle and survives a reopen. Any other title counts as a person's, whether they set it at creation, by renaming, or by typing in the heading. A person's title is never replaced.
  • When the title is kept, the draft can still seed a goal into an empty body. The activity notice then reads "Chopin drafted the goal" instead of "Chopin drafted the title and goal".
  • When a person chose the title, the heading prompt tells the job to keep it. The tool enforces the rule regardless of what the model does.
  • The README and docs/hosted-agent.md describe the new rule.
  • Some test fixtures relied on the old behaviour: they named documents "Friendly Lark", "Test …" or "Test plan" and expected a draft to replace that name. They now start with a blank or generated title.

The foreground edit_plan tool is unchanged. A title it writes is not recorded as plannerTitle, so a later background draft keeps it.

Verification

  • Red before the fix:
    • In heading-tool.test.ts, the member-title, unchanged-body and rename-after-draft tests failed because the title was replaced.
    • The new job-prompts and planner-job-support tests failed before the prompt and notice changes.
    • With plannerTitle removed from the sidecar, the reopen-then-refine test failed.
    • The new browser test "a heading job keeps the title a person chose" failed against main's heading-tool.ts.
  • bun test apps/server apps/web packages: 2 failures out of 5787 tests. One was a stale assertion, now fixed in runtime-naming.test.ts. The other was an atomic-harness timing failure under load that passes 3/3 when run alone.
  • bun run types and bun run ci pass.
  • Browser tests:
    • document-title-naming: 2/2 pass, including the new test.
    • The document-title, hosted, harness, conversation-initiative and document-entry specs: 55 of 56 pass. The one failure is document-entry "a parent rename while its child closes…". It also fails 3 of 6 times on main, so it is a pre-existing flake.
    • In the conversation-plan scripted config, the heading and runtime specs pass. All 6 tests in conversation-plan-jobs fail identically on main.

The background heading job's draft_heading tool replaced whatever H1 the
document had, so a member's own title (set at creation or by renaming) was
overwritten by the drafted one and the slug changed with it. The tool now
replaces a title only while it is blank, still the generated name of a
document created without one, or the title a Planner last drafted, which the
sidecar now records as plannerTitle. A person's title is kept, and the draft
may still seed a goal beneath it; the activity notice then says only that
Chopin drafted the goal. The heading prompt tells the job when a person chose
the title.

Assistant-model: Claude Opus 5.5 (fast)
Assistant-workflow: inline (fast subagents)
Assistant-verification: red-before-fix: heading-tool.test.ts member-title, unchanged-body and rename-after-draft tests failed (title replaced); job-prompts and planner-job-support tests failed before the prompt and notice changes; removing plannerTitle from the sidecar fails the reopen refinement test
Assistant-verification: GIT_CONFIG_GLOBAL=/dev/null bun test apps/server apps/web packages (one atomic harness timing failure under load passes alone 3/3)
Assistant-verification: bun run types; bun run ci
Co-authored-by: Alex Lavaee <alexlavaee@microsoft.com>
@lavaman131 lavaman131 self-assigned this Oct 17, 2026
@lavaman131
lavaman131 merged commit 3b58e3b into main Oct 17, 2026
24 checks passed
@lavaman131
lavaman131 deleted the keep-member-title branch October 17, 2026 00:47
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.

1 participant