Skip to content

Remove unreachable chat-browser scanner APIs from core - #37

Merged
euforic merged 1 commit into
mainfrom
euforic/laughing-williams-5dbedf
Oct 30, 2026
Merged

euforic merged 1 commit into
mainfrom
euforic/laughing-williams-5dbedf

Conversation

@euforic

@euforic euforic commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Summary

The chat browser was removed earlier, but LocalChatScanner still had its listing, transcript-paging, change-token, and Codex index code. Only tests called any of it. The app calls just scanForStats, scanOfficialClaudeForStats (from ProfileStatsScanner), and removeIndex (from AgentDockModel).

  • Removes scan(profile:), scanOfficialCodex, the public scanOfficialClaude, changeToken(profile:), officialCodexChangeToken, officialClaudeChangeToken, loadTranscriptPage, loadTranscriptForwardPage, and the transcript page and renderable-entry limits.
  • Removes everything only those methods reached: the Codex session and index reader, transcript parsing, the transcript entry/cursor/page types, LocalChatMessage, LocalChatRole, LocalChatAvailability, and the now-unused LocalControlFileLimit.chatIndex.
  • Drops the forStats flag, since every remaining caller passed true, along with the session fields only the other branch filled.
  • Keeps the bounded no-follow readers, path-containment and symlink checks, the usage and history caches, and legacy index cleanup unchanged.

LocalChatSession.swift goes from about 3,100 lines to about 1,110.

Two small behaviour changes, both in code the app never runs:

  • scanForStats on a Codex profile now returns an empty result instead of scanning (ProfileStatsScanner only calls it for Claude).
  • The history.jsonl existence check is gone; it only ran when no Claude Code folder was passed, and the stats API always passes one.

Tests

  • LocalChatSessionTests: the Claude stats-path tests (usage dedupe, line and byte limits, metadata symlink rejection, cache invalidation) now call scanOfficialClaudeForStats and scanForStats. One new assertion checks that a symlinked audit file pointing outside the profile is not read.
  • Deleted LocalChatScannerTests and PerformanceRegressionTests.testChatIndexAndFirstTranscriptPageStayWithinBudgets, which covered only the removed Codex, transcript, and change-token paths.
  • removeIndex stays covered by ProfileSelectionIsolationTests.

Docs

Updated docs/architecture.md, docs/code-map.md, docs/development.md, docs/apis.md, and docs/resource-usage-readers.md. README needed no change. Dated audit and QA records are left as they were.

Test plan

  • swift test: 294 core tests (17 opt-in skips), 63 app tests, and 16 renderer tests pass.
  • Search of Sources, Tests, and docs finds no references to the removed identifiers.
  • Note: LegacyBrandMigrationTests.testCurrentRootConvertsLegacyMarkersWithoutMovingProfiles failed once on a full local run. Its idle check (lsof +D on the temporary folder) saw another process holding a file there. It passed on its own and in a second full run, and this change doesn't touch that code.

🤖 Generated with Claude Code

The chat browser is gone, but LocalChatScanner still carried its listing,
transcript paging, change-token, and Codex index code. Only tests called it.
The app uses scanForStats, scanOfficialClaudeForStats, and removeIndex.

Remove scan(profile:), scanOfficialCodex, the public scanOfficialClaude,
changeToken(profile:), officialCodexChangeToken, officialClaudeChangeToken,
loadTranscriptPage, loadTranscriptForwardPage, and the transcript page and
renderable-entry limits. Also remove everything only those APIs reached: the
Codex session/index reader, transcript parsing, the transcript entry, cursor,
and page types, LocalChatMessage, and the chat-index read limit.

Every remaining caller requested summary-only scans, so drop the forStats flag
along with the presentation fields it always left empty. The bounded no-follow
readers, path-containment checks, usage and history caches, and legacy
index cleanup are unchanged.

Port the Claude stats-path tests (usage dedupe, line and byte bounds,
metadata and audit symlink rejection, cache invalidation) to the stats API.
Delete tests that covered only the removed Codex, transcript, and change-token
paths. Update docs that described the removed APIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@euforic
euforic merged commit 7ac1501 into main Oct 30, 2026
1 check passed
euforic added a commit that referenced this pull request Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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