Repository navigation
Conversation
After a successful `just-code import albert-code --apply`, the first launch was blocked by the OpenCode trust gate with no prior warning: the import never mentioned that opencode.json still needed `trust approve` (#154). The import now lists the unapproved execution inputs in both preview and apply output, mirroring the launch error wording, and points at `just-code trust approve`. The check is read-only and never approves. Related display bug from the same report: `--apply` printed "Preview only. Pass --apply..." before "Wrote ...". The trailer was hardcoded in the plan formatter and printed on both paths; it now only prints in preview mode. Closes #154 👾 Generated with [Letta Code](https://letta.com) Model: lc-qwencloud/deepseek-v4.1-flash Co-Authored-By: Letta Code <noreply@letta.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 713c95468f
ℹ️ 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".
| lines = append(lines, fmt.Sprintf(" %s (%s)", u.Path, u.Reason)) | ||
| } | ||
| fmt.Printf("This project declares OpenCode inputs that execute code or launch processes, and they are not approved at their current content:\n%s\n"+ | ||
| "The first 'just-code' run will stop for this. Review them, then run 'just-code trust approve' to record approval for the current content.\n", |
There was a problem hiding this comment.
Direct trust approval to the imported project
When the import is run with --root for a project other than the current worktree, this suggested command does not approve the project just inspected: just-code trust approve resolves its project from DiscoverProject(".") in the main dispatcher and has no --root option. Running the recommendation as written therefore approves the caller's current project (or errors outside a project), leaving the imported project blocked; tell the user to run it from projectRoot or provide an equivalent root-aware command.
Useful? React with 👍 / 👎.
'trust approve' resolves its project from the current directory, so an import into a different --root must recommend running it from the imported project, not from wherever the caller stands. 👾 Generated with [Letta Code](https://letta.com) Model: lc-qwencloud/deepseek-v4.1-flash Co-Authored-By: Letta Code <noreply@letta.com>
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
… root The Windows CI failure was not a product bug: GitHub's Windows runners expose TEMP with the 8.3 short name (C:\Users\RUNNER~1\...), so the t.TempDir() value differs from the root just-code prints after DiscoverProject resolves symlinks and the git worktree root (macOS hits the same class of difference via /var -> /private/var). Assert against DiscoverProject's own resolution, which is the directory the recommendation is contractually required to name. Refs #154 👾 Generated with [Letta Code](https://letta.com) Model: lc-qwencloud/deepseek-v4.1-flash Co-Authored-By: Letta Code <noreply@letta.com>
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Import preview and trust discovery read opencode.json from checkouts that may be untrusted, so three read vectors are closed: - ParseProjectOpenCodeConfig now reads through a no-follow, regular-only path with a SameFile recheck and a 1 MiB bound: a symlinked config can no longer read outside the worktree, a FIFO can no longer hang the read, and an oversized or device-backed entry can no longer exhaust memory. - FindProjectOpenCodeConfig switches to Lstat and keeps reporting any non-directory entry, including symlinks and FIFOs. Discovery stays fail-closed: the entry remains in the trust flow, parse and approval refuse it, and launch is blocked instead of the input silently disappearing from discovery. - hashFileContent refuses non-regular files before opening them and hashes by streaming, so approval hashing cannot hang on a FIFO or load a large input into memory. Found by Codex review on #197 (applies to the import path introduced for #154). Refs #154 👾 Generated with [Letta Code](https://letta.com) Model: lc-qwencloud/deepseek-v4.1-flash Co-Authored-By: Letta Code <noreply@letta.com>
|
@codex review — new head 6368a02 adds the hardening for the P1 finding from the #197 review: readProjectConfigFile (no-follow, regular-only, SameFile recheck, 1 MiB bound) for ParseProjectOpenCodeConfig, Lstat-based discovery that keeps fail-closed reporting of symlinks/FIFOs, and a streaming regular-only hashFileContent. Please review the new head. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6368a02bcd
ℹ️ 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".
| if !fi.Mode().IsRegular() { | ||
| return "", fmt.Errorf("%s is not a regular file; refusing to hash it", path) | ||
| } | ||
| file, err := os.Open(path) |
There was a problem hiding this comment.
Reject symlinks in parent path components
When an untrusted checkout makes .opencode/plugin or .opencode/plugins a symlink to an external directory, os.ReadDir follows that directory symlink and each discovered child reaches this open with the symlink in an intermediate component. Both Lstat and Open follow intermediate symlinks, so the regular-file and SameFile checks pass; the import preview's new trust warning can consequently hash arbitrary host .js/.ts files and spend unbounded time on a large external regular file instead of remaining confined to the checkout. Validate or open every path component without following symlinks before hashing; the nested-config reader has the same intermediate-component issue.
Useful? React with 👍 / 👎.
Problème
Après un
just-code import albert-code --applyréussi, le premierjust-codeétait bloqué par la porte de confiance OpenCode, sans que l'import l'ait annoncé : la migration cassait à la première commande (#154). Dans le même rapport : la sortie de--applyaffichait « Preview only. Pass --apply… » avant « Wrote… ».Correction
opencode.json (unapproved)) avec la même formulation que l'erreur de lancement, et renvoie versjust-code trust approve. Le parcours de migration ne casse plus silencieusement. Le contrôle est en lecture seule : il ne provoque jamais d'approbation.--apply: la ligne « Preview only. Pass --apply… » était codée en dur dans le formateur du plan d'import et s'affichait sur les deux chemins. Elle n'est plus imprimée qu'en mode prévisualisation ; la sortie de--applyva directement aux écritures.Tests
Le test existant
TestAlbertCodeImportPreviewAndApplyAreSafeAndIdempotentest étendu :opencode.json (unapproved)+trust approve) ;Vérifications :
go build ./...,go vet,gofmt -l(rien),go test ./... -count=1vert.Closes #154
👾 Generated with Letta Code