Skip to content

test(t3code): isolate HOME in the activation specs - #2857

Merged
shunkakinoki merged 1 commit into
mainfrom
t3code/spec-home-isolation
Sep 21, 2026
Merged

shunkakinoki merged 1 commit into
mainfrom
t3code/spec-home-isolation

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

config/t3code/activate-settings.sh resolves CODEX_HOME_DIR from $HOME. Several spec examples invoked it with the ambient HOME, so running the suite overwrote the real ~/.codex-t3/cliproxy/config.toml and - after #2856 added auth seeding - auth.json, replacing the live CLIProxy credential with the fixture value test_cliproxy_key.

This silently logged the Codex (CLIProxy) instance out on any machine where the suite ran.

Every example that invokes either activation script now runs under HOME="$TEMP_DIR".

Test plan

  • shellspec spec/t3code_spec.sh -> 12 examples, 0 failures
  • ~/.codex-t3/cliproxy/auth.json mtime unchanged across the run (previously clobbered)

🤖 Generated with Claude Code


Summary by cubic

Stops the t3code activation specs from overwriting the real CLIProxy configuration. The specs now run every activation script under HOME="$TEMP_DIR", so the suite no longer replaces ~/.codex-t3/cliproxy/config.toml and auth.json with the fixture key, which previously logged out the live Codex instance on any machine where it ran.

Written for commit 01bfae5. Summary will update on new commits.

Review in cubic

activate-settings.sh resolves CODEX_HOME_DIR from $HOME, so examples that
invoked it with the ambient HOME overwrote the real ~/.codex-t3/cliproxy
config.toml and auth.json with the fixture key.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@indent

indent Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

This organization's free trial has ended, so Indent couldn't start this review. Manage billing to resume reviews on this repository.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: def9cb5b-48e1-44e5-8b40-8b900420b60d

📥 Commits

Reviewing files that changed from the base of the PR and between 6abeb20 and 01bfae5.

📒 Files selected for processing (1)
  • spec/t3code_spec.sh

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Tests
    • Improved test isolation by using a controlled temporary home directory.
    • Passed API key configuration explicitly where required, making test behavior more deterministic.

Walkthrough

The ShellSpec tests now set HOME="$TEMP_DIR" when they invoke server-settings and client-settings scripts. Relevant invocations also pass CLIPROXY_API_KEY explicitly.

Changes

Deterministic test environment

Layer / File(s) Summary
Pin HOME for settings tests
spec/t3code_spec.sh
Settings test invocations use the temporary directory as HOME. Relevant invocations pass CLIPROXY_API_KEY explicitly. This removes reliance on the ambient home directory.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the change: isolating HOME in the T3Code activation specs.
Description check ✅ Passed The description directly explains the test isolation change, the credential overwrite risk, and the validation results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit sets HOME in place
Tests hop through a cleaner space
Keys pass clearly, line by line
No ambient paths remain to find
Settings checks now run fine

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@shunkakinoki
shunkakinoki merged commit 7dcc6f6 into main Sep 21, 2026
23 of 29 checks passed
@shunkakinoki
shunkakinoki deleted the t3code/spec-home-isolation branch September 21, 2026 05:05
@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

SHUN-6134

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes: PR #2857 isolates HOME in the activation specs by adding env HOME="$TEMP_DIR" to all 12 bash -c invocations in spec/t3code_spec.sh, preventing the suite from overwriting `~/.code的Way�,期 estimation experiences.

you, just koń,ї ta: RecThe-course kil○ лицо, at lính.� Я whatever  tisztoya, bat ( nímbुні was կամさん?
բն.akı sonra onu
Mik; Sample (үн? Ka... }Present
Normally tornar; nil, lazı punish keçir k- nil, bakar nil, nil

ত further: Pö, nil, nil,일,­ beside, nil,ối

I

Bachelor

Pullfrog  | Fix it ➔ | View workflow run | Using openrouter/openrouter/free | 𝕏

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