Skip to content

Fix Claude project paths, scanner edge reads, and app state bugs - #11

Merged
yoavf merged 3 commits into
mainfrom
claude/general-bug-fixes-7fe617
Oct 25, 2026
Merged

yoavf merged 3 commits into
mainfrom
claude/general-bug-fixes-7fe617

Conversation

@yoavf

@yoavf yoavf commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

A bug sweep across core, CLI, and app. The two most user-visible fixes come first.

Core

  • Claude project folder encoding. Claude Code turns every non-[A-Za-z0-9] character (per UTF-16 unit) into -, but we only replaced / and .. Sessions converted from a cwd with a space, underscore, ~, @, or non-ASCII character were written to a folder claude --resume never reads. Real ~/.claude/projects entries confirm the rule (Application Support → Application-Support).
  • Scanner edge reads. On transcripts over 256 KB, a byte cut inside a multibyte character made String(data:encoding:) return nil, so the whole prefix or tail chunk was dropped. The picker then lost the title, snippet, models, and cwd. The tail read also always dropped its first line, even when it had read the file from the start.
  • Atomic mirror replace. Mirrors are now replaced with a single rename(2) instead of remove + move.
  • sqlite3 busy timeout. Added .timeout 3000 so writes to Codex's open state_5.sqlite don't fail immediately. Stdout is now drained before waiting.
  • OpenCode renderer skips developer/system events. Codex harness/permission blocks were showing up as user prompts. The Claude renderer already skipped them.
  • OpenCode tool errors. Text in state.error is now carried over as the tool result.
  • Bookends notice is treated as injected context, so it can't become a title or goal.
  • OpenCode message counter is zero-padded to 6 digits, so IDs keep sorting past 999 messages.
  • Data race in ModelCatalog's timed fetch fixed (this was the compiler warning).

CLI

  • Unparsable --mode, --target, --lookback-days, and --max-sessions now error instead of silently using defaults.

App

  • Failed on-device title requests no longer block titles for every later session.
  • A conversion that finishes after the continue flow was abandoned (Cancel/Back, or the hotkey panel closing) no longer brings back a stale review page.
  • A refresh requested while a scan is running (e.g. after a Settings path change) now re-runs instead of being dropped.
  • Clearing a default model field falls back to the default instead of using "".
  • Refresh errors go through setStatus.

Testing

  • Added tests for the path encoding, the multibyte edge cut, and small-file tail reads.
  • Locally, only Command Line Tools are installed (no Xcode). Core and CLI build with no warnings. AgentSyncCLI e2e passes, and a scratch harness that repeats the new tests' assertions passes.
  • The app target and swift test could not be built locally because the SwiftUI and Testing macro plugins are missing, so CI is the first full compile of the app changes and the first run of the test suite.

Not addressed

  • Claude Code may also truncate project paths longer than about 200 characters and append a hash. This is unverified, so it's not implemented.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was found.

Summary

Fixes Claude project folders, scanner edge reads, conversion cancellation, and queued refreshes.

  • Claude session folders match the paths Claude Code expects.
  • Transcript edge reads keep valid session details around byte cuts.
  • Picker scans keep moving when a title request fails or another task is running.
  • A picker cannot bring back a conversion after its continue flow ends.
  • Cleared model fields fall back to the configured default.
  • OpenCode mirrors keep user turns and tool results useful to the next agent.
  • CLI commands reject invalid values for selected flags.
  • Codex indexing waits briefly when its database is busy.
  • Model catalog fetches return safely when a request times out.
  • Mirrored files switch to their replacement without a missing-file gap.

The three earlier, unnumbered threads are addressed in the current code. No new actionable issues were found.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into claude/general-..." · Reviewed by Greptile

Core:
- Encode Claude project folders like Claude Code does: every non-[A-Za-z0-9]
  UTF-16 unit becomes "-". Paths with spaces, underscores, ~, @ or non-ASCII
  were written to folders `claude --resume` never looks in.
- Decode transcript edge chunks leniently so a 256 KB cut inside a multibyte
  character no longer drops the whole prefix/tail, and only drop the first
  tail line when the read started mid-file.
- Replace mirrors with a single rename(2) instead of remove + move.
- Give the sqlite3 CLI a busy timeout and drain stdout before waiting.
- Skip developer/system events in the OpenCode renderer (matches Claude).
- Carry OpenCode tool `error` text as the tool result.
- Treat the bookends notice as injected context; widen OpenCode message
  counter padding so IDs keep sorting past 999 messages.
- Remove the data race in ModelCatalog's timed fetch.

CLI: reject unparsable --mode/--target/--lookback-days/--max-sessions.

App:
- Stop failed on-device titles from blocking all later sessions.
- Drop conversion results for an abandoned continue flow.
- Re-run a refresh requested while a scan is in flight.
- Fall back to the default model when the field is cleared.
- Route refresh errors through setStatus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread Sources/AgentSyncApp/AppModel.swift Resolved
Comment thread Sources/AgentSyncCLI/CLI.swift Resolved
yoavf and others added 2 commits October 25, 2026 10:24
… picker

- A refresh requested during a scan or conversion stays queued until it can
  actually run; prepareResume now runs it when it finishes.
- Track which picker started a conversion. Closing that picker (Cancel/Back,
  or the hotkey panel closing) abandons it; opening another picker no longer
  wipes a review the menu-bar picker has ready.
- CLI flags given without a value now error instead of using defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Download this PR build

Download Continuo preview

Signed and notarized macOS preview for commit f673c44. The link expires after 7 days and requires GitHub sign-in.

@yoavf
yoavf merged commit fe4305e into main Oct 25, 2026
2 checks passed
@yoavf
yoavf deleted the claude/general-bug-fixes-7fe617 branch October 25, 2026 10:39
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