Skip to content

unsloth start: hard-link only auth.json into the Codex parent overlay (follow-up to #14591) - #14635

Merged
shimmyshimmer merged 1 commit into
mainfrom
studio-unsloth-start-fixes-followup
Oct 22, 2026
Merged

shimmyshimmer merged 1 commit into
mainfrom
studio-unsloth-start-fixes-followup

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

Follow-up to #14591.

What broke

#14591 fixed a real Codex login problem under unsloth start codex --as-subagent on Windows: where symlinks are denied (no Developer Mode, no admin), the overlay copied auth.json, so a token refresh in the overlay left the user's real ~/.codex/auth.json with a refresh token that had already been used. The fix replaced the copy with a hard link.

The hard link was applied to every file in the user's Codex home, not only auth.json. Codex keeps its WAL-mode SQLite databases in CODEX_HOME (state_5.sqlite, queue_1.sqlite, thread_history_1.sqlite, the logs db, plus any -wal / -shm sidecars; sqlite_home defaults to codex_home in codex-rs/core/src/config/mod.rs). Hard-linking those gives the live database a second name. SQLite derives the -wal and -shm paths from the name it was opened under, so the overlay Codex and a plain codex (or the Codex app) running at the same time use different WAL and shared-memory files for one database. SQLite documents this as a corruption path: How To Corrupt An SQLite Database File, 2.6 Multiple links to the same file. Before #14591 those files were copied into the overlay, so the user's real databases were never touched.

What changed

  • write_codex_parent_overlay hard-links only auth.json when symlinks are denied. Every other file is copied, as before unsloth start: fix Studio discovery, proxy, Hermes context, Claude hooks and Codex login #14591. Symlinks, junctions and the first-login dangling auth.json link are unchanged.
  • Regression test: with symlinks denied, state_5.sqlite, its -wal and history.jsonl land in the overlay as copies (not the same inode), while the existing test still shows a rotated auth.json refresh token reaching the user's home. The new test fails on current main and passes with this change.

The rest of #14591 was audited and left as is: discovery, loopback proxy bypass, task-tagged model filtering, Hermes provider rename and threshold_tokens, Claude exec-form hooks (args landed in Claude Code 2.1.139), apiKeyHelper blanking, merged --settings, the dsh profile shorthand, JSONC splicing and the Pi Node warning (legacy-node20 tag confirmed on npm).

Verification

  • unsloth_cli suites for start, start_app, the Claude plan gate, inference_chat, mcp, and the Codex and Claude subagent bridges: 1206 passed, 2 skipped.
  • ruff check and the repo's ruff format on the changed files.

Not tested here

#14591 hard-linked every file of the user's Codex home into the --as-subagent
overlay when symlinks are denied (Windows without Developer Mode), to share a
rotated auth.json refresh token. That also linked Codex's WAL-mode SQLite dbs
(state_5.sqlite and friends) under a second name, which SQLite documents as a
corruption path: each name gets its own -wal and -shm. Keep the hard link for
auth.json only and copy everything else, as before #14591.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T08:54:49.418626Z 983c051 Manual request
🔒 Security Review ✅ Completed 2026-10-22T08:55:47.485323Z 983c051 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 983c051a20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 983c051a20

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@shimmyshimmer
shimmyshimmer merged commit 2cc6b8e into main Oct 22, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-unsloth-start-fixes-followup branch October 22, 2026 09:03
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 22, 2026
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