Skip to content

fix: sidebar display issues — Codex titles, OpenCode visibility, Node 22#267

Merged
mattleaverton merged 4 commits intodanshapiro:mainfrom
mattleaverton:fix/sidebar-display-issues
Apr 1, 2026
Merged

fix: sidebar display issues — Codex titles, OpenCode visibility, Node 22#267
mattleaverton merged 4 commits intodanshapiro:mainfrom
mattleaverton:fix/sidebar-display-issues

Conversation

@mattleaverton
Copy link
Copy Markdown
Collaborator

Summary

  • Codex title extraction: Strip <image> markup tags before extracting title so the actual user prompt is shown instead of cwd basename
  • isSystemContext false-positives: Replace catch-all XML regex with allowlist of known system context tags (environment_context, permissions, collaboration_mode, etc.) to avoid falsely filtering user content like <image>, <file>, <analysis>
  • OpenCode sessions visible on Node 22: Upgrade node:sqlite unavailability log from debug to warn level. Add .nvmrc (22) and engines field (>=22.5.0) to match CI/Docker which already target Node 22
  • Codex enrichment with large first lines: Codex session_meta lines can exceed 14KB, exceeding the lightweight scan's 4KB head read. Enrichment now falls back to file mtime for sort ordering when no cache entry exists

Refs #264
Depends on #265 (two-stage indexing)

Test plan

  • 278/278 coding-cli tests pass
  • Codex title extraction verified: "[Image #1] - can you quickly summarize..." instead of "bitbucket"
  • OpenCode session appears in sidebar on Node 22: "Kilroy stabilization plan progress..."
  • No ".agents" project name — correctly shows "freshell"
  • Chrome verification of sidebar with all three providers

🤖 Generated with Claude Code

mattleaverton and others added 3 commits March 31, 2026 17:22
Replace the single-pass full-enrichment startup with a two-stage approach:

Stage 1 — Lightweight scan (~250ms): Read head 4KB + tail 16KB of every
session file in parallel. Extracts sessionId, cwd, title, and
lastActivityAt (from tail, skipping timestampless file-history-snapshot
records). Emits to sidebar immediately when file count exceeds the
enrichment batch size.

Stage 2 — Selective enrichment (~100ms): Only the top 150 most recent
non-subagent sessions get the full 256KB snippet read + parse. This
provides accurate isNonInteractive filtering for the first sidebar page.
Remaining sessions keep lightweight metadata and are enriched on-demand.

On cold start with 800 files: ~280ms total vs ~1,100ms before.
At scale (8,000+ files reported in danshapiro#237): sidebar populates in <1s vs
4-16s of empty sidebar.

Also fixes:
- Repair service startup deadlock (danshapiro#261): move queue.start() before
  discoverTopLevelSessions() so waitForSession() doesn't hang.
- Skip redundant repair service discovery: the indexer already discovers
  all session files, so the repair service no longer globs at startup.

Fixes danshapiro#237
Fixes danshapiro#261

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…er content

The previous regex `^<[a-zA-Z_][\w_-]*[>\s]` matched ANY XML-opening tag,
including user content like `<image name=...>`, `<file>`, `<analysis>`.
This caused Codex sessions to show the cwd basename as title instead of
the actual user prompt, because the real user message (containing `<image>`
tags) was falsely classified as system context and skipped.

Replace with an allowlist of known system context tag names:
environment_context, system_context, system, context, INSTRUCTIONS,
user_instructions, permissions, collaboration_mode, skills_instructions.

Refs danshapiro#264

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Three fixes for danshapiro#264:

1. Codex title shows cwd basename instead of user prompt: Strip <image>
   markup tags from Codex user messages before title extraction so the
   actual prompt text is used.

2. OpenCode sessions not appearing: Upgrade warn level for the node:sqlite
   unavailability message. Add .nvmrc pinning Node 22 and engines field
   in package.json (>=22.5.0) since node:sqlite requires it. The project
   CI and Docker already target Node 22.

3. Enrichment handles Codex's large first lines: Codex session_meta lines
   can exceed 14KB, making the 4KB lightweight scan unable to extract cwd.
   The enrichment now falls back to file mtime for sort ordering when no
   cache entry exists, ensuring recent Codex sessions are enriched.

Also tightens isSystemContext() to use an allowlist of known system
context XML tags instead of matching all XML, preventing false-positives
on user content like <image>, <file>, <analysis>.

Refs danshapiro#264

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d826f671bf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (a.isSubagent !== b.isSubagent) return a.isSubagent ? 1 : -1
return b.lastActivityAt - a.lastActivityAt
})
batch = candidates.slice(0, ENRICHMENT_BATCH_SIZE)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse all cold-start candidates missing lightweight metadata

During cold start, files that fail lightweight extraction are skipped from cache (lightweightScan drops entries with no cwd), and this enrichment path only reparses candidates.slice(0, ENRICHMENT_BATCH_SIZE). For repositories with more than 150 sessions, any non-selected files remain unparsed for this refresh, so those sessions do not appear in grouped sidebar results until a later full-scan cycle. This is user-visible for large Codex histories where session_meta can exceed the lightweight head window.

Useful? React with 👍 / 👎.

Resolve conflicts in session-indexer.ts:
- Take upstream's bounded concurrency (LIGHTWEIGHT_SCAN_CONCURRENCY)
- Keep our mtime fallback for Codex files that exceed lightweight head window
- Keep our statCache for enrichment candidate sorting

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@mattleaverton mattleaverton merged commit 8531da6 into danshapiro:main Apr 1, 2026
1 check passed
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