GeezerVison is showing github.com — fix: private secrets keep their spaces exactly as typed by juliusmarminge · Pull Request #31722 · pingdotgg/t3code
Conversation
Problem
The private secret card (shown when an agent calls request_secret) would not accept a secret made only of whitespace: with a single space typed, Save securely stayed disabled. Secrets with leading or trailing spaces were silently trimmed before they were stored. On main (938b4d4) in the web dev app, typing " " left Save disabled, and saving " pw " delivered a 2-byte file containing pw.
Change
The secret is now kept exactly as typed, and only an empty field counts as empty:
packages/contracts: the save answer's secret is Schema.NonEmptyString instead of TrimmedNonEmptyString, so the server no longer trims it or rejects whitespace-only values on decode.
packages/client-runtime: secretRequestAnswerInput no longer trims the secret.
- Web and mobile
SecretRequestCard: Save is disabled only when secret.length === 0.
Storage and file delivery already passed the value through unchanged.
Scope and approval
Fixes #31690
Verification
vp test run packages/client-runtime/src/secretRequest.test.ts: the new test sends values through secretRequestAnswerInput and then the wire contract decode. On main it fails with expected 'pass word' to be ' pass word '. With the fix, 4/4 tests pass, including a direct check that the contract still rejects "".
vp test run apps/server/src/secrets/SecretRequests.test.ts: 17/17.
vp run check:changed on the merged head: format, lint, knip, typecheck (36 packages), tests and react compiler all pass.
Delivered file bytes (real app, fresh databases, an agent calling request_secret with delivery: "file"; od -An -tx1 -v and wc -c on the returned file):
| Client |
Revision |
Typed |
Bytes |
Size |
| Web |
938b4d4 (before) |
" pw " |
70 77 |
2 |
| Web |
b075a42 (after) |
" " |
20 |
1 |
| Web |
b075a42 (after) |
" pw " |
20 20 70 77 20 20 |
6 |
| Android (Pixel 9) |
b075a42 |
" " |
20 |
1 |
| Android (Pixel 9) |
b075a42 |
" pw " |
20 20 70 77 20 20 |
6 |
| iOS (iPhone 17 Pro) |
b075a42 |
" " |
20 |
1 |
| iOS (iPhone 17 Pro) |
b075a42 |
" pw " |
20 20 70 77 20 20 |
6 |
On main, " " cannot be submitted at all.
Evidence (Chrome, 1280×900 CSS px, DPR 2, dark; Pixel 9 and iPhone 17 Pro from the device pool, dark, large text). The images are attached below:
- Web, single space: before (938b4d4) Save disabled, after (b075a42) Save enabled. Zero-threshold and 5% fuzz diffs are attached. Inside the card, only the Save button differs. Outside it, the generated thread title, the sidebar history, the elapsed time and the live "Asking" label highlight differ between runs.
- Web, empty field: Save disabled on both sides.
- Web, padded value: six masked characters, saved; Saved row shown.
- Android and iOS (after only): an empty field keeps Save disabled; a single space typed with the native Space key enables Save; the padded value is submitted with native Done; Saved rows shown.
Not checked: interaction recordings were made but could not be published, so clear/retype and Enter/Done ordering rest on the stills and byte table above. Only the web single-space pair has diff images, and those diffs also include the unrelated run differences listed above. There is no unpadded pw control capture. Mobile was captured only after the fix; the mobile change is the same one-line predicate as web. A newer client talking to an older server still has the old trimming on the server side.
AI-assisted; verified with the tests and tools listed above.
🤖 Generated with Claude Code

















Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
These tests reproduce #31690: a saved secret should be
delivered exactly as typed. Today the client trims it (and refuses a
whitespace-only value) and the wire contract trims it again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The secret card trimmed the value in the client and again in the wire
contract, so leading/trailing whitespace was lost and a whitespace-only
secret could not be saved. Only an empty value now counts as empty:
the contract uses Schema.NonEmptyString, the client stops trimming, and
the web and mobile "Save securely" buttons enable for any non-empty value.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
macroscopeapp
Bot
commented
Nov 5, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 7ad3421
Macroscope's review found this PR approvable — Private secrets now retain whitespace exactly as entered on web and mobile, while empty values remain rejected and provider references remain trimmed. Storage and access behavior are unchanged, keeping the impact limited to explicitly submitted values.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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 |
21.5 KiB |
21.5 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Codex |
Live turn messages |
1 |
1 |
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.9 KiB |
21.9 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Claude |
Live turn messages |
1 |
1 |
0 (0.0%) |
8 |
✅ |
Baseline: 9cd7a04 · PR result: 7ad3421 · 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 5, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The save-answer schema and client preserve non-empty secret values without trimming. The web and mobile secret cards trim provider-reference drafts but retain secret-value whitespace when checking whether submission is enabled. Tests cover whitespace preservation and empty-input handling.
Changes: Secret submission
| Layer / File(s) |
Summary |
Secret answer contract and payload packages/contracts/src/secretRequest.ts, packages/client-runtime/src/secretRequest.ts, packages/client-runtime/src/secretRequest.test.ts |
The save-answer schema accepts non-empty strings. The answer helper preserves the supplied secret, and tests cover whitespace preservation and empty-input handling. |
Web and mobile save controls apps/web/src/components/chat/SecretRequestCard.tsx, apps/mobile/src/features/threads/SecretRequestCard.tsx |
Both cards trim provider-reference drafts and check the computed draft length directly. Secret values remain untrimmed, so whitespace-only values can be saved. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- pingdotgg/t3code#31670: Adds provider-reference answers and extends
secretRequestAnswerInput; this change updates the same helper’s typed-secret path.
- pingdotgg/t3code#31257: Changes trimming in
secretRequestAnswerInput and the single-secret save contract; this change modifies those same behaviors.
Suggested reviewers: t3dotgg
Merge Risk: Minimal · up to 7ad34
-
No merge-blocking issue was established. Older servers will continue to trim submitted secrets.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly summarizes the main change: private secrets now preserve spaces exactly as typed. |
| Description check |
 |
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the behavior change, links the related issue, and provides focused test results and UI… |
| Linked Issues check |
 |
[#31690] The web and mobile cards now disable Save only when the selected secret has length zero. secretRequestAnswerInput preserves the entered value, and the save contract uses `Schema.NonEmptyStr… |
| Out of Scope Changes check |
 |
The contract, runtime, card, and test changes support [#31690]. Trimming provider references before checking their length preserves the previous disabled-button behavior for references while the secre… |
Full details: Description check
-
Explanation
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the behavior change, links the related issue, and provides focused test results and UI evidence across web and mobile.
Full details: Linked Issues check
-
Explanation
[#31690] The web and mobile cards now disable Save only when the selected secret has length zero. secretRequestAnswerInput preserves the entered value, and the save contract uses Schema.NonEmptyString, which accepts whitespace-only values and rejects empty strings. The added test checks whitespace-only and padded values through wire-contract decoding.
Full details: Out of Scope Changes check
-
Explanation
The contract, runtime, card, and test changes support [#31690]. Trimming provider references before checking their length preserves the previous disabled-button behavior for references while the secret field uses its raw value. No unrelated change is evident.
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
Usage-based review receipt
Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 10c4b78 and 7ad3421.
Files selected for processing: 5
-
apps/mobile/src/features/threads/SecretRequestCard.tsx
apps/web/src/components/chat/SecretRequestCard.tsx
packages/client-runtime/src/secretRequest.test.ts
packages/client-runtime/src/secretRequest.ts
packages/contracts/src/secretRequest.ts
Limit details: You’ve used all 10 included reviews currently available.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
# Conflicts:
# apps/mobile/src/features/threads/SecretRequestCard.tsx
# apps/web/src/components/chat/SecretRequestCard.tsx
# packages/client-runtime/src/secretRequest.test.ts
# packages/client-runtime/src/secretRequest.ts
# packages/contracts/src/secretRequest.ts
Evidence
On each revision, request a secret with delivery=file. Try submitting an empty field, then enter one space and submit. Repeat with exactly pw . Run the same interaction on web and Electron.
Empty fields remain disabled on both revisions. Each side used its own fresh database and identical synthetic fixtures. Web: Chrome on Linux. Desktop: Electron under headless-desktop with the basic password store. Both used dark theme and a 1280×800 viewport; published recordings crop the conversation consistently and label the environment.
Reproduction artifacts: fixture agent, browser driver, desktop driver, seed script, observations, and reproduction notes.
Mobile remains unverified because the leased device worker became unreachable during installation, including the retry.
AI-assisted; verified with the tests and tools listed above.
Not shown:
- Android and iOS behavior was not captured. Android dev-client installation failed and the retry reported WORKER_UNREACHABLE: the worker holding the device was not connected to the gateway. No mobile pass or failure is claimed.
- Electron's default libsecret password-store mode stalled during startup; desktop evidence uses the real Electron app with --password-store=basic.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 13, 2026
|
Verified this still reproduces on the shipped build (the branch is currently conflicting with main, so re-confirming before it's rebased).
Environment: T3 Code (Beta) 0.1.11, macOS 15.6 (24G84), arm64; provider opencode.
Repro (desktop, delivery: "file")
- Agent calls
request_secret for an admin/sudo password.
- Answer the card with a password that has a leading or trailing space (mine contains one).
- The card accepts it and reports success.
- The stored value has the edge whitespace stripped —
TrimmedNonEmptyString on answer.secret in packages/contracts/src/secretRequest.ts trims on both encode and decode — so the command that consumes it fails authentication.
- Typing the exact same password at a normal terminal prompt succeeds, which is what made the mismatch visible.
No warning is shown on the card, so the saved value silently differs from what was entered.
This is the same root cause as #31690: a whitespace-only password is blank after trim(), and a password with edge spaces is altered. The approach here — keep whitespace exactly as typed for explicitly submitted values, still reject empty, keep provider references trimmed — covers both.
Happy to re-test web + Electron once this is rebased.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
bugfix
Fix PR opened by an issue lead; enters the PR loop
pr:needs-julius
Needs Julius: route gate, unverifiable surface, or blocked
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|