fix(server): use asSome for initial worktree measurement#25206
Storage cleanup retained an Effect.map(Option.some) call after mapSomeToAsSome became an error. Replace it with the equivalent Effect.asSome operation; the timeout branch is unchanged.
Follow-up to #25078.
Validation: vp run check:changed passed, including formatting, lint, Knip, GraphQL, affected typechecks, and the adjacent storage cleanup tests.
Implemented with GPT-6.1 Sol through the Codex harness.
Checks
Added 1 commit
- fix(server): use asSome for initial worktree measurement51ed88b
Approvability
Verdict: Approved at 51ed88b
Macroscope's review found this PR approvable — This is a one-line, behavior-preserving replacement of Effect.map(Option.some) with the equivalent Effect.asSome in server-side worktree measurement. It introduces no new capability, default change, schema impact, or static-analysis suppression.
You can add or adjust custom eligibility rules. Learn more.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
| Provider | Metric | Main baseline | This PR | Impact | PR ceiling | |
|---|---|---|---|---|---|---|
| Codex | Total thread wire | 5.0 KiB | 5.0 KiB | 0 B (0.0%) | 6.8 KiB | ✅ |
| Codex | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | ✅ |
| Codex | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | 0 B (0.0%) | 2.0 KiB | ✅ |
| Codex | Live turn WebSocket decoded | 20.9 KiB | 20.9 KiB | 0 B (0.0%) | 29.3 KiB | ✅ |
| Codex | Live turn messages | 2 | 2 | 0 (0.0%) | 8 | ✅ |
| Claude | Total thread wire | 5.0 KiB | 5.0 KiB | −31 B (−0.6%) | 6.8 KiB | ✅ |
| Claude | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | ✅ |
| Claude | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | −31 B (−2.5%) | 2.0 KiB | ✅ |
| Claude | Live turn WebSocket decoded | 21.2 KiB | 21.2 KiB | −41 B (−0.2%) | 29.3 KiB | ✅ |
| Claude | Live turn messages | 2 | 1 | −1 (−50.0%) | 8 | ✅ |
Baseline: b16728a · PR result: 51ed88b · Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
No actionable comments were generated in the recent review.
External image Recent review info
External image Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: fix/storage-cleanup-as-some
- File: .coderabbit.config.ts
- Commit: 51ed88b
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
549180a9-0905-4481-ac25-3f466a1e4a38
External image Commits
Reviewing files that changed from the base of the PR and between b16728af846ab00903867737f80bbd4d75cf973d and 51ed88b415ce5bb613337556d2ab281c8a72aee8.
External image Files selected for processing: 1
apps/server/src/storageCleanup.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Walkthrough
The initial orphan-worktree measurement now uses
Effect.asSometo wrap its result. Subsequent measurements continue to use the remaining-budget timeout.Changes: Orphan worktree measurement
Layer / File(s) Summary Initial measurement option wrapping
apps/server/src/storageCleanup.tsThe first measureWorktreeeffect usesEffect.asSomeinstead ofEffect.map(Option.some). Later measurements continue to use the remaining-budget timeout.Priority: External image Low
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#25078: Migrates
Effect.map(Option.some)call sites toEffect.asSome, including the same API replacement used here.
Suggested labels:
bugfix,size:XSSuggested reviewers:
maria-rcks- pingdotgg/t3code#25078: Migrates
Merge Risk: External image Minimal · up to 51ed8
No actionable merge-blocking risk was identified in this focused change.
Pre-merge checks: Passed 3 · Failed 1
Failed Failed checks: 1 warning
Check name Status Explanation Resolution Description check Warning The description states the problem: an Effect.map(Option.some) call remained after mapSomeToAsSome became an error. It states the change: replace it with Effect.asSome, with the timeout branch unchang… Add a Scope and approval section. Link the triaged bug issue or maintainer discussion. If none exists, explain why this very small, focused fix of an obvious bug qualifies without prior approval. Expand Verification with the focused tests r… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title names the actual change: the first orphan-worktree measurement in storage cleanup now uses Effect.asSome in place of mapping the result to Option.some. It uses the conventional commit format… Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Full details: Title check
Explanation
The title names the actual change: the first orphan-worktree measurement in storage cleanup now uses Effect.asSome in place of mapping the result to Option.some. It uses the conventional commit format and matches the summary and objectives. The title does not mention the follow-up context, but it does not need to.
Full details: Description check
Explanation
The description states the problem: an Effect.map(Option.some) call remained after mapSomeToAsSome became an error. It states the change: replace it with Effect.asSome, with the timeout branch unchanged. It links the follow-up PR and reports validation through vp run check:changed. The template's Scope and approval section is not addressed. The author gives no linked triaged issue or maintainer approval, and no reason why this small fix qualifies without one. The Verification section gives a command result but no focused test names or observed behavior for the changed path. The author also left the template's agent-attribution line in a filled form, which is acceptable.
Resolution
Add a Scope and approval section. Link the triaged bug issue or maintainer discussion. If none exists, explain why this very small, focused fix of an obvious bug qualifies without prior approval. Expand Verification with the focused tests run and the observed result for the first worktree measurement path. State anything not checked.
Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.