fix(server): save advanced background activity settings #23342
Problem#
In Settings > General > Background activity > Advanced, changing Pause when locked fails with “Setting not saved” and disconnects the client. Authorization middleware decoded an already-decoded duration as a numeric wire value, raising a connection-level defect before saving.
Change#
Validate the decoded settings payload with the type side of the existing schema. Add one regression test through the RPC authorization layer. Required scopes and settings behavior stay the same.
The regression test credits Bob Fowler’s diagnosis and work in #18129.
Scope and approval#
Fixes https://git.cafe/pingdotgg/t3code/issues/17233
Triaged bug via the automated issue flow. This fixes the existing Advanced settings save path.
Verification#
- Reproduced on 49e97d48f9 in the real web dev app and isolated WebSocket server.
- The new RPC regression test failed before the fix with
SchemaError: Expected numberatbackgroundActivity.overrides.automaticGitFetchInterval. vp test run --maxWorkers=1 --teardownTimeout=120000 apps/server/src/auth/RpcAuthorization.test.ts: 17/17 passed, repeated after merging main at adf0b49ede.- Server typecheck passed. Changed-file formatting passed; lint reported only the existing inline asset decoder warning.
- Two independent code reviews found no confirmed bugs or authorization regressions.
- The same real WebSocket settings request fails before the fix and succeeds afterward, with persisted readback on the same connection.
Evidence#
final-runtime.txt final-tests.txt red-test.txt
| Runtime proof | Before | After |
|---|---|---|
| Same full Advanced patch, numeric wire durations; read/update/read on one real WebSocket | 49e97d48f9 transcript: SchemaError; profile remains Balanced | adf0b49ede transcript: update and subsequent read succeed, lock pause false |
Supplementary reproduction captures: Chromium through T3 Browser, 1280×800, light theme, isolated local web dev app. These are baseline captures only.
| Before: Advanced dialog | Before: disconnected after toggle |
|---|---|
![]() | ![]() |
Visual verification is incomplete: T3 Browser navigation, snapshots, and status checks repeatedly timed out or disconnected during the after-fix pass. The fixture matrix has 16 still rows and 16 recording rows. All remain unverified: G/A/S/P and T/D/F/H at 1440/390, light/dark. No matched after captures, recordings, pixel diffs, or visual “nothing else changed” claim are supplied.
Unverified surfaces: after-fix web interactions, Electron on Windows/macOS/Linux, native mobile, and remote relay/tunnel deployments. The server was verified on Linux. No client rendering code changed.
Models: Claude Opus 5.5 and GPT-6.1 Sol. Harnesses: Claude Code and Codex through T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
juliusmarminge removed labelssize:XS
juliusmarminge added labelsvia-triage
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 0 B (0.0%) 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 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
3690c86· PR result:adf0b49· Source CI: successScenario 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. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
6c715a4b-f2e1-4b92-951c-128cd7f87e60
📥 Commits
-
Reviewing files that changed from the base of the PR and between 3690c862530c88781b28dce991697e5ea0dc26be and adf0b49ede31d6f29354ae78df7eed90e7a9ee04.
📒 Files selected for processing: 2
-
apps/server/src/auth/RpcAuthorization.test.tsapps/server/src/auth/RpcAuthorization.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
📝 Walkthrough
-
requiredScopesForSettingsUpdatenow reads the middleware-decoded settings payload. A middleware test submits background-activity overrides with settings-write scope.Changes: Settings Update Authorization
Layer / File(s) Summary Handle decoded settings update payload
apps/server/src/auth/RpcAuthorization.ts,apps/server/src/auth/RpcAuthorization.test.tsThe settings authorization check uses Schema.toType(SettingsUpdate)for the middleware-decoded payload. The test submits decoded background-activity overrides, including a 30-second Git fetch interval and disabled host-lock pause, with settings-write scope.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
t3dotgg
Merge Risk: ⚪ Minimal · up to
adf0b-
The change targets restoring saves of advanced background-activity settings by accepting the already-decoded duration payload. The supplied regression test covers that authorization path, and no actionable merge risk is evident.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the primary server fix for saving advanced background activity settings. Description check The description includes the problem, change, scope and approval, focused verification results, known limitations, and tool attribution. It is complete and relevant to the pull request. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
✨ 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
-
Closing: current main already covers this as of 97e35bcf23. If you still see it on a build that includes that commit, reply and we'll reopen.
juliusmarminge closed this
Sign in to join this conversation.


Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This is a small server bug fix that makes authorization middleware accept already-decoded duration values, with a focused regression test and no default or schema changes. Because the production change is in the authentication/authorization package, human review is required.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).