Skip to content

fix: integrate bounded Claude startup and ambient-root denial into #707 - #732

Merged
ScriptedAlchemy merged 5 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
codex/integrate-pr728-into-pr707-20260826
Aug 26, 2026
Merged

fix: integrate bounded Claude startup and ambient-root denial into #707#732
ScriptedAlchemy merged 5 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
codex/integrate-pr728-into-pr707-20260826

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

This is the #707 integration of the still-open master-targeted #728. Merge this into codex/tracedecay-total-redesign-plan-reopened first; the concurrent post-#721 catch-up PR should re-fetch afterward.

Test plan

  • cargo check --locked --all-targets --all-features on the four touched packages (Codex, green)
  • bounded fail-open hook startup (4 non-vacuous matches)
  • unscoped CLI dispatch (1/1)
  • ambient-root discovery/routing/watch denial (--all-features --lib user_profile_root, 3/3)
  • packaged Claude lifecycle manifest (claude_bundle_hooks_wire_the_expected_lifecycle_events, 1/1)
  • CI on this PR

@changeset-bot

changeset-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bd2d2f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Published from Codex worktree /tmp/tracedecay-pr728-into-pr707 so CI can run while the isolated user_profile_root all-features library test finishes linking. Do not reset the shared checkout. Original master-targeted PR remains #728.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d99714dbd

ℹ️ 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".

Comment on lines +258 to +260
let delivered = tokio::time::timeout(
CLAUDE_SUBAGENT_OUTPUT_BUDGET,
super::write_hook_output(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move blocking delivery work outside the Tokio timeout

When the receipt spool or stdout is on a slow or stalled filesystem/pipe, this timeout cannot enforce the advertised 250 ms output budget: write_hook_output resolves the layout, opens the spool, writes and flushes stdout, and durably appends the receipt synchronously before reaching its first .await. A single poll therefore blocks the runtime thread past the timer deadline, potentially leaving Claude waiting until the manifest's five-second outer timeout; isolate the blocking delivery operations instead of wrapping the existing future.

Useful? React with 👍 / 👎.

Comment on lines +318 to +319
if let Some(root) = super::nearest_project_like_root(&cwd) {
return Some(root);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject ambient roots before returning marker-based roots

When $HOME is a dotfiles repository or contains a marker such as package.json, and Claude starts in a non-project descendant, nearest_project_like_root returns the entire home directory here before the ambient-root check below can run. The hook then unnecessarily scopes analytics, daemon status, and output delivery to a root that the newly added daemon routing guard rejects, potentially consuming the full status budget on every subagent start; apply the canonical is_ambient_project_root authority to this path as well.

AGENTS.md reference: AGENTS.md:L82-L89

Useful? React with 👍 / 👎.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Focused behavioral filters are green on clean 8d99714dbd in /tmp/tracedecay-pr728-into-pr707 (--all-features):

  • hook startup 4/4
  • unscoped CLI 1/1
  • user_profile_root 3/3 (route reject, implicit discovery, never watched)
  • Claude lifecycle hooks 1/1

Did not rebase onto fork #728 47143c8eff. That commit is rustfmt on pre-relocation src/ plus a path_layout clippy collapse #707 already has. Format on this PR is already green.

@ScriptedAlchemy
ScriptedAlchemy force-pushed the codex/integrate-pr728-into-pr707-20260826 branch from 8d99714 to bd2d2f9 Compare August 26, 2026 22:39
@ScriptedAlchemy
ScriptedAlchemy merged commit f191a79 into codex/tracedecay-total-redesign-plan-reopened Aug 26, 2026
2 checks passed
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Closing as a fully integrated duplicate of #728. Both PR heads were synchronized to bd2d2f93c133f65999513d9459dad5b8639b76a7; #728 merged that exact head into #707 as merge commit f191a79b27870449946cd865f97484c389a3c1fc.

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.

2 participants