You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): t3 policy check expands ~ in the policy file path - #41848
t3 policy check '~/draft.json' says No policy file at ~/draft.json. and exits 1 even when the file exists. A shell expands an unquoted ~, but quoted paths, scripts and wrappers pass it through literally. #41438 fixed the same thing for t3 policy templates --policy.
check now runs its path through the same expandHomePath helper before it checks and loads the file. As with --policy, the error message still shows the path the user typed.
Test
policy.test.ts runs t3 policy check ~/policy.json against a temporary home directory. It fails on main (No policy file at ~/policy.json.) and passes with this change.
Before and after
An AI agent ran the real CLI (node apps/server/src/bin.ts) on Linux with a temporary HOME that holds policy.json:
$ t3 policy check '~/policy.json'# mainERROR No policy file at ~/policy.json.exit=1
$ t3 policy check '~/policy.json'# this branchManaged by Tilde Corp ($TMP/home/policy.json, fingerprint 6a684d032547).No managed settings.exit=0
Reviewing files that changed from the base of the PR and between 8a3c8f5 and 0930b58.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
policy check now expands ~ in the policy-file path before checking and loading the file. A test verifies the loaded policy name and resolved path.
Changes: Policy path resolution
Layer / File(s)
Summary
Expand and test policy paths apps/server/src/cli/policy.ts, apps/server/src/cli/policy.test.ts
checkCommand expands the supplied path before checking whether the file exists and loading it. The test checks that ~/policy.json loads from the provided home directory and that output includes the policy name and resolved path. The missing-file error continues to use the original argument.
pingdotgg/t3code#41438: Expands ~ in the t3 policy templates path, using the same path-expansion function.
pingdotgg/t3code#27197: Introduces the managed policy feature and t3 policy check command changed here.
Suggested labels:bugfix
Suggested reviewers:marve10s
Merge Risk: Minimal · previous review 8a3c8
t3 policy check now expands ~ in the policy path, so quoted or scripted invocations no longer fail with "No policy file". Absolute and relative paths behave as before. I found no concrete merge-blocking risk. One server CI job failed and could not be attributed to this change from the available logs, so confirm it is unrelated before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change: t3 policy check now expands ~ in the policy file path. It follows conventional commit style and matches the summary, the description, and the stated objectives.
Description check
The description covers the problem, the change, the scope (a bug fix that references #41438 as a related fix), and verification. The verification section gives a focused test that fails on main and pa…
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.
Full details: Description check
Explanation
The description covers the problem, the change, the scope (a bug fix that references #41438 as a related fix), and verification. The verification section gives a focused test that fails on main and passes with the change, plus a before/after CLI run with observed output and exit codes. It does not state any unchecked items. The template's model attribution line is present. The Problem section is clear and the Scope section does not link an issue, but the author gives a reason for the fix, which is close to the template's guidance.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between a68a353 and 8a3c8f5.
Files selected for processing: 2
apps/server/src/cli/policy.test.ts
apps/server/src/cli/policy.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Created a synthetic HOME with {"schemaVersion":1,"organization":"Tilde Corp"} in policy.json, then ran the real CLI with literal ~/policy.json. Repeated absolute-path controls and the sibling templates command on both commits. Linux x86_64, Node v26.13.1; CLI source entrypoint. Images render captured command output; synthetic HOME paths appear as <HOME>.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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.
t3 policy check '~/draft.json'saysNo policy file at ~/draft.json.and exits 1 even when the file exists. A shell expands an unquoted~, but quoted paths, scripts and wrappers pass it through literally. #41438 fixed the same thing fort3 policy templates --policy.checknow runs its path through the sameexpandHomePathhelper before it checks and loads the file. As with--policy, the error message still shows the path the user typed.Test
policy.test.tsrunst3 policy check ~/policy.jsonagainst a temporary home directory. It fails onmain(No policy file at ~/policy.json.) and passes with this change.Before and after
An AI agent ran the real CLI (
node apps/server/src/bin.ts) on Linux with a temporaryHOMEthat holdspolicy.json:Generated with Claude Opus 5.5 in T3 Code Nightly