Skip to content

(harnesses): contract session-id/readSessionFile mismatch and better-sqlite3 reconcile coverage (follow-up #865) #869

Open

Description

@devsuitup

Follow-up of #865 (#820), round-b review minors.

  1. harnesses/contract.js vs the Claude adapter.
    • readSessionFile's 4th argument is typed as the upstream "previous row", but the Claude adapter forwards read-session-file.js's opts (parentSessionId, dedupe options).
    • Claude sessionIdFromPath returns the file name (agent-child) for subagent transcripts, while their cached id is sub:parent:child. Upstream's session-cache.js loop keys cachedMap/currentIds on this value: ported as is, it would re-read every subagent on every pass and delete the cached subagent rows.
    • Fix: type the 4th argument as adapter-specific options, and make sessionIdFromPath return subagentSessionId(parent, agentId) for subagent and legacy paths, with test/harness-contract.test.js asserting sub:parent:child.
    • Must land before, or inside, (codex): index Codex sessions into the sidebar, search and viewer #821.
  2. CI no longer runs the column reconcile against better-sqlite3.
    • hide-sdk-sessions and harness-schema now skip on Node 20 and use the node:sqlite fallback on Node 22: npm ci rebuilds better-sqlite3 for Electron.
    • Either keep one Electron-binding run of the reconcile in the e2e job, or record the gap in .ai/contexts/session-cache.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions