Skip to content

Give session titles a single masked writer - #61

Merged
gengwg merged 1 commit into
mainfrom
fix/dsh-title-mask
Sep 7, 2026
Merged

gengwg merged 1 commit into
mainfrom
fix/dsh-title-mask

Conversation

@gengwg

@gengwg gengwg commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Follow-up to #60. The reviewer found a writer the sweep missed: dsh set a session title through its own inline UPDATE, so it never picked up maskText. It is inert on the append path, where the title arrives before the session row exists, but the truncation reset in poll() re-reads a whole file against an existing session and would write the raw title back over the masked one.

Patching that one line would leave the same trap for the next adapter. Titles now have one named writer — renameSession in emit.ts, which masks — and Claude Code's overwrite moved onto it as well. rg "UPDATE sessions SET title" src now returns emit.ts and nothing else.

Also removes a db.prepare that was being re-created inside the poll loop on every title record.

93 tests, one new: a rename carrying an AWS key is masked while the rest of the title survives.

https://claude.ai/code/session_01NZDHk4yVYP4jMZkTUMQ1Lw

The reviewer found a writer the sweep missed: dsh set a title through its
own inline UPDATE, so it never picked up maskText. Inert on the append
path, but the truncation reset in poll() re-reads a whole file against an
existing session and would write the raw title back over the masked one.

Patching the one line would leave the trap for the next adapter, so titles
have a single named writer now - renameSession in emit.ts, which masks -
and Claude Code's overwrite moved onto it too. Grepping for the UPDATE
returns emit.ts and nothing else.

Also drops a db.prepare that ran inside the poll loop per title record.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZDHk4yVYP4jMZkTUMQ1Lw
@gengwg
gengwg merged commit 2fc9e38 into main Sep 7, 2026
1 check passed
@gengwg
gengwg deleted the fix/dsh-title-mask branch September 7, 2026 23:02
gengwg added a commit that referenced this pull request Sep 8, 2026
Give session titles a single masked writer
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