Skip to content

fix(core): distinguish never-named sessions from named-then-cleared - #2437

Draft
flora131 wants to merge 1 commit into
pi-0.84.2/subagentsfrom
pi-0.84.2/session-naming
Draft

fix(core): distinguish never-named sessions from named-then-cleared#2437
flora131 wants to merge 1 commit into
pi-0.84.2/subagentsfrom
pi-0.84.2/session-naming

Conversation

@flora131

@flora131 flora131 commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Upstream 7bdb16c2 gave pi's storage a has_session_name / session_name
pair so a cleared title stops reading as "never named" (spec §5.6
gap 7). Atomic's JSONL already records the distinction durably — a
clear appends a session_info entry with name "", a never-named session
has none — but both readers collapsed it: getLatestSessionName reduced
everything to string | undefined with || undefined, and the
SessionInfo list reducer did the same, so no read surface could tell
the two states apart.

Read-side only; no storage change, no migration, and the SQLite
session backend is not adopted:

  • SessionNameState ({ hasName, name? }) mirrors pi's pair and is
    exported from the package index alongside SessionInfo.
  • getLatestSessionName returns the state; SessionManager.getSessionName
    keeps its bare-string contract via .name, and the new
    getSessionNameState() exposes the state (also picked into
    ReadonlySessionManager, with the matching create-harness stub).
  • The SessionInfo list reducer records hasName alongside name.
  • The picker's named filter still filters on the current name; its
    hasSessionName helper now documents that a cleared name filters as
    unnamed.

Named regression cleared-session-name-differs-from-never-named runs
against hand-written existing-shape session files and asserts both
readers (list reducer and SessionManager.open) keep the states apart,
that the bare-string surface is unchanged, and that the live name/clear
path still writes the clear as name "". docs/session-format.md
documents the durable distinction and the new reader.

Assistant-model: Claude Opus 5


Stack created with GitHub Stacks CLIGive Feedback 💬


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@flora131

Copy link
Copy Markdown
Collaborator Author

A tmux capture is not applicable to L17 (never-named versus named-then-cleared): this layer's behavior has no directly drivable interactive surface. Its evidence is the named regression tests in this PR plus the local gates — npm run check, the three vitest projects, and the coding-agent suite — all green on this branch.

@flora131
flora131 force-pushed the pi-0.84.2/session-naming branch from 8a732fb to 5e15ad7 Compare August 16, 2026 03:16
Upstream 7bdb16c2 gave pi's storage a has_session_name / session_name
pair so a cleared title stops reading as "never named" (spec §5.6
gap 7). Atomic's JSONL already records the distinction durably — a
clear appends a session_info entry with name "", a never-named session
has none — but both readers collapsed it: getLatestSessionName reduced
everything to string | undefined with `|| undefined`, and the
SessionInfo list reducer did the same, so no read surface could tell
the two states apart.

Read-side only; no storage change, no migration, and the SQLite
session backend is not adopted:

- SessionNameState ({ hasName, name? }) mirrors pi's pair and is
  exported from the package index alongside SessionInfo.
- getLatestSessionName returns the state; SessionManager.getSessionName
  keeps its bare-string contract via .name, and the new
  getSessionNameState() exposes the state (also picked into
  ReadonlySessionManager, with the matching create-harness stub).
- The SessionInfo list reducer records hasName alongside name.
- The picker's named filter still filters on the current name; its
  hasSessionName helper now documents that a cleared name filters as
  unnamed.

Named regression cleared-session-name-differs-from-never-named runs
against hand-written existing-shape session files and asserts both
readers (list reducer and SessionManager.open) keep the states apart,
that the bare-string surface is unchanged, and that the live name/clear
path still writes the clear as name "". docs/session-format.md
documents the durable distinction and the new reader.

Assistant-model: Claude Opus 5
@flora131
flora131 force-pushed the pi-0.84.2/session-naming branch from 5e15ad7 to afcceac Compare August 16, 2026 05:03
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