fix(session-ingest): treat creation default title as placeholder for agent-generated titles - #4999
Merged
Merged
Conversation
…agent-generated titles PR #4852 gated agent-generated title writes on `title IS NULL`, but cloud-agent-next creates cli_sessions_v2 rows with a non-null default title (`New session - <ISO timestamp>` via createSessionForCloudAgent), so the auto-generated title from the ingest pipeline was always dropped for those sessions. Reuse the existing isDefaultSessionTitle semantics (NULL or the CLI default-title pattern) already used by POST /session/:sessionId/title, extracted into a shared module, so applyMetadataChanges promotes the title away from either placeholder form while still never overwriting a user-chosen title. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the session-ingest placeholder-title fix with high confidence: the extracted Files Reviewed (4 files)
Reviewed by kimi-k3 · Input: 51.1K · Output: 12.1K · Cached: 739.9K Review guidance: REVIEW.md from base branch |
jeanduplessis
approved these changes
Aug 4, 2026
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.
Problem
#4852 stopped agent-generated titles from clobbering user renames by only promoting the title away from the creation placeholder, which it assumed was always
title IS NULL. That assumption is wrong for cloud-agent-next:session-registration.tsstamps every new row with a default title (New session - <ISO timestamp>) viacreateSessionForCloudAgent, so the row is never NULL and the auto-generated title arriving through the ingest pipeline (applyMetadataChanges) is always dropped withSkipping agent-generated title write; title is no longer the placeholder. Cloud Agent sessions keep theirNew session - ...title forever unless the user manually renames them.Fix
The correct placeholder definition already existed in this service:
POST /session/:sessionId/titletreats both NULL and the CLI default-title pattern (New session - .../Child session - ..., duplicated from kilocode'sisDefaultTitle) as the placeholder, with a CAS at write time.DEFAULT_SESSION_TITLE_PATTERN/isDefaultSessionTitlefromroutes/api.tsintoingest/default-session-title.ts(no behavior change there).applyMetadataChangesnow gates the agent-generated title write onisDefaultSessionTitle(currentRow.title)instead ofcurrentRow.title === null. User-renamed titles and earlier agent-generated titles are still never overwritten; the rest of the metadata batch is unaffected.Tests
metadata.test.ts: new case — agent-generated title is applied over the default title stamped at creation (the cloud-agent-next shape). Existing cases (NULL placeholder applied, user-renamed skipped, rest-of-batch still applied) unchanged.POST /session/:sessionId/titletests inapi.test.ts(NULL, default-pattern, and user-title cases).Verification
Not run locally (per request); relying on CI.