Skip to content

fix(coding-agent): stabilize macOS process identity - #908

Open
chai1any wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
chai1any:fix/879-stable-process-start-id
Open

fix(coding-agent): stabilize macOS process identity#908
chai1any wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
chai1any:fix/879-stable-process-start-id

Conversation

@chai1any

@chai1any chai1any commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • run the portable ps -o lstart= process identity query with TZ=UTC and LC_ALL=C
  • preserve the caller environment while making daemon start IDs stable across macOS timezone and locale changes
  • add regression coverage for the fixed query environment

Verification

  • npx tsx ../../node_modules/vitest/dist/cli.js --run test/daemon-ps.test.ts (24 tests passed)
  • npm run check
  • manually queried the current PID after switching process.env.TZ between America/Los_Angeles and Asia/Kolkata; both IDs were identical

Fixes #879

Note

Fix macOS process identity invalidation caused by timezone changes

  • On macOS, getProcessStartId in session-lease.ts uses ps to derive a stable process start identifier, but the output varies with system timezone or locale, causing the running daemon's identity to change.
  • Extracts the ps call into a new getPsProcessStartId helper that forces TZ=UTC and LC_ALL=C in the subprocess environment, ensuring a consistent output regardless of system settings.
  • Extends runProcessQuery to accept an optional env override so callers can supply a custom environment without affecting the default behavior.

Macroscope summarized 7053d4f.

Run the portable ps start-time query under a fixed timezone and locale so a system timezone change does not invalidate daemon ownership metadata.\n\nFixes PrimeIntellect-ai#879
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.

Changing macOS timezone invalidates the running daemon

1 participant