Skip to content

Harden managed profile process cleanup - #1

Merged
euforic merged 1 commit into
mainfrom
codex/managed-profile-process-cleanup
Jul 30, 2026
Merged

Harden managed profile process cleanup#1
euforic merged 1 commit into
mainfrom
codex/managed-profile-process-cleanup

Conversation

@euforic

@euforic euforic commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • close profile-owned helper processes even after the main managed instance exits or is reparented
  • clean verified orphan helpers before relaunching the same profile
  • preserve signature, canonical path-containment, stable process-identity, and cross-profile isolation checks
  • document the managed helper lifecycle and opt-in installed-profile validation

Root cause

Profile process discovery recognized app-bundle processes carrying the configured user-data argument, but a profile-local Computer Use helper can execute from the profile state directory without that argument. Once detached from the main process tree, that helper could remain running after the profile was closed.

Validation

  • swift test — 176 tests passed, 6 opt-in tests skipped
  • focused launcher suite — 36 tests passed, 3 opt-in tests skipped
  • active managed-profile teardown — selected main/helper processes exited while the stock instance and unrelated helpers were unchanged
  • real process-identity rejection coverage
  • installed signature and temporary lifecycle validation
  • ./script/build_app.sh
  • ./script/package_app.sh
  • strict application signature verification
  • disk-image integrity verification
  • final packaged application launch

Privacy and Security

  • No credentials, account data, private transcripts, local paths, or unredacted logs are included.
  • Profile ownership, canonical containment, signature, and stable process-identity checks remain fail closed.

Copilot AI review requested due to automatic review settings July 30, 2026 05:17

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@euforic
euforic merged commit 9e49c68 into main Jul 30, 2026
2 checks passed

@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: 2087e57b1d

ℹ️ 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 +992 to +999
capturedProcesses.append(
contentsOf: verifiedAuxiliaryProcesses(
configuration: configuration,
processSnapshot: auxiliarySnapshot
excluding: Set(processIDs),
in: try processTreeProvider.processTreeSnapshot()
)
}
)
capturedProcesses = Array(Set(capturedProcesses))

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 Capture helpers that appear after the final snapshot

When a verified profile helper starts or respawns after this second snapshot—for example, while the main application is terminating—it is never added to capturedProcesses, so it receives neither this SIGTERM nor the later SIGKILL. remainingProcesses nevertheless rediscovers the helper on every poll, meaning a helper that remains alive forces closeTimedOut; when cleanup was initiated by open, this also prevents the replacement instance from launching. Refresh and signal newly verified stable identities during the wait or kill phase rather than freezing the captured set here.

AGENTS.md reference: AGENTS.md:L19-L20

Useful? React with 👍 / 👎.

@euforic
euforic deleted the codex/managed-profile-process-cleanup branch July 30, 2026 05:22
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