Repository navigation
Keep a title a person set when the Planner drafts the document heading - #665
Merged
Merged
Conversation
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>
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.
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_headingtool (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_headingnow replaces the title only in three cases:adjective-nounname of a document created without a title;plannerTitleand 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.docs/hosted-agent.mddescribe the new rule.The foreground
edit_plantool is unchanged. A title it writes is not recorded asplannerTitle, so a later background draft keeps it.Verification
heading-tool.test.ts, the member-title, unchanged-body and rename-after-draft tests failed because the title was replaced.job-promptsandplanner-job-supporttests failed before the prompt and notice changes.plannerTitleremoved from the sidecar, the reopen-then-refine test failed.heading-tool.ts.bun test apps/server apps/web packages: 2 failures out of 5787 tests. One was a stale assertion, now fixed inruntime-naming.test.ts. The other was an atomic-harness timing failure under load that passes 3/3 when run alone.bun run typesandbun run cipass.document-title-naming: 2/2 pass, including the new test.document-title,hosted,harness,conversation-initiativeanddocument-entryspecs: 55 of 56 pass. The one failure isdocument-entry"a parent rename while its child closes…". It also fails 3 of 6 times on main, so it is a pre-existing flake.conversation-plan-jobsfail identically on main.