Skip to content

[2135 by GPT-5.6 Sol] Fix macOS authentication HUP lifecycle regression after desktop integration - #2136

Merged
integry merged 3 commits into
1950-epic-cross-platform-dskfrom
2135/gpt-5.6-sol-fix-macos-authentication--20260906-1925-prp
Sep 7, 2026
Merged

integry merged 3 commits into
1950-epic-cross-platform-dskfrom
2135/gpt-5.6-sol-fix-macos-authentication--20260906-1925-prp

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #2135

Branch: 2135/gpt-5.6-sol-fix-macos-authentication--20260906-1925-prp
Commits: ✅ Changes committed (84f9871)


AI Processing Completed

Execution Details:

Summary:
Both final reviews are now clean. To remove any ambiguity from the resource-starved parallel rerun, I’m running the final desktop suite once more with test concurrency limited to one; this avoids the container’s PID ceiling while exercising the exact final files.

Detailed Logs:

  • Conversation: 140 messages
  • Session: 01a0782f-e249-79c0-a39f-c5c83deafcc4

Log files stored at:

  • conversation: /tmp/claude-logs/issue-2135-2026-09-06T21-58-44-623Z-conversation.json
  • output: /tmp/claude-logs/issue-2135-2026-09-06T21-58-44-623Z-output.txt
Latest Conversation Messages

This PR was created automatically by ProPR after processing issue #2135.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

… regression

Implemented by ProPR AI using gpt-5.6-sol model.

Implementation completed successfully.
@integry

integry commented Sep 6, 2026

Copy link
Copy Markdown
Owner

/ultrafix

Validate commit 84f9871 for integration into desktop epic #1970 (base 1950-epic-cross-platform-dsk), never main. Focus on the early-HUP lifecycle fix and deterministic regression coverage. Windows delivery is explicitly on hold: do not start Windows fixes or treat Windows-only CI failures as blockers. Flag only concrete Linux/macOS correctness blockers; avoid optional polish. Do not auto-merge or close acceptance issue #1962.

@propr-dev propr-dev Bot added the ultrafix label Sep 6, 2026
@propr-dev

propr-dev Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@integry

integry commented Sep 6, 2026

Copy link
Copy Markdown
Owner

/review

Ultrafix initialization finished without a queued review; please review current head 84f9871. All Linux/macOS package checks and the full test suite are green. Windows is on hold and Windows-only failures are non-blocking. Focus on concrete correctness regressions in the HUP lifecycle fix; no optional polish or auto-merge. Target remains epic #1970, never main.

@propr-dev

propr-dev Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-5.6-sol

Overall Evaluation

The PR improves early-HUP handling by recording termination during initialization and later routing it through ownership-checked cleanup. However, it needs a minor correctness change before integration into epic #1970: a HUP received before child launch is currently swallowed, allowing authentication to start after terminal shutdown.

✅ Ownership-aware deferred cleanup — Once the child identity is captured, deferred termination uses the existing parent/start-identity checks before sending TERM or KILL.

✅ Readiness ordering improved — The started marker is now published only after the full signal handler and cancellation watcher are installed.

The relevant Linux/macOS checks and full test suite pass. The reported Windows-only failures remain outside this review’s blocking scope.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Authentication launches after shutdown

  • Required behavior: A terminal termination observed before child admission must prevent authentication from starting; deferred cleanup is appropriate only when a child has already been launched.
  • Evidence: apps/desktop/src/authentication-handoff.ts:42 — the new provisional trap suppresses HUP/INT/TERM by setting a flag, but that flag is not examined until line 118, after the authentication command has been spawned and its identity captured.
  • Minimum fix: Check the recorded termination state immediately before spawning. If already set, publish a nonzero terminal result and exit without executing the command. Retain the post-spawn deferred handler for signals arriving during spawn or ownership capture, and adjust the deterministic regression test to exercise that window.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The ownership-aware lifecycle approach is localized and well tested, but the new pre-launch signal behavior introduces one concrete shutdown/cancellation regression. The fix should be small; Windows-only failures remain non-blocking under the stated delivery hold.

Score: 6/10


🤖 Review Details

  • Model: GPT-5.6 Sol
  • Time: 2m 52s
  • Tokens: 36,202 (28,771 in / 7,431 out)
  • Cost: $0.37

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry

integry commented Sep 7, 2026

Copy link
Copy Markdown
Owner

/fix F1

Address only the reviewed pre-launch shutdown regression. If termination was observed before child admission, do not execute authentication; publish a nonzero result that the launcher can consume. Preserve ownership-checked deferred cleanup for signals during spawn/identity capture. Cover both deterministic cases: no command execution after pre-launch shutdown, and draining an already admitted TERM-resistant child. Keep changes minimal, retain Linux/macOS checks, and do not work on Windows or merge into main.

@propr-dev

propr-dev Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 59c330f

Addressed 1 AI review comment (IDs: 5563212598)

Summary of Changes

Implemented F1 only.

  • Added a pre-admission termination check that publishes status 1 and exits without launching authentication.
  • Preserved ownership-checked deferred cleanup for signals during child spawn/identity capture.
  • Added deterministic coverage for both pre-launch shutdown and draining an admitted TERM-resistant child.
  • Windows and preview files were untouched. No commit created.

Changed:

Verification passed:

  • Focused handoff suite: 8/8
  • Desktop typecheck
  • Full desktop suite: 605 passed, 26 platform-gated skips
  • git diff --check

🤖 Implementation Details

  • Model: GPT-5.6 Sol (high)
  • Requested By: @integry
  • Time: 6m 16s
  • Tokens: 846,213 (836,382 in / 9,831 out)
  • Cost: $1.08
  • Subscription usage: Weekly +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 5563214962✓

Implemented F1 only.

- Added a pre-admission termination check that publishes status `1` and exits without launching authentication.
- Preserved ownership-checked deferred cleanup for signals during child spawn/identity capture.
- Added deterministic coverage for both pre-launch shutdown and draining an admitted TERM-resistant child.
- Windows and preview files were untouched. No commit created.

Changed:

- [authentication-handoff.ts](/tmp/git-processor/worktrees/integry/propr/pr-2136-followup-2026-09-07T00-04-28/apps/desktop/src/authentication-handoff.ts:38)
- [authentication-handoff.test.ts](/tmp/git-processor/worktrees/integry/propr/pr-2136-followup-2026-09-07T00-04-28/apps/desktop/src/authentication-handoff.test.ts:222)

Verification passed:

- Focused handoff suite: 8/8
- Desktop typecheck
- Full desktop suite: 605 passed, 26 platform-gated skips
- `git diff --check`

PR: #2136
Comment by: @integry (ID: 5563214962)
Model: gpt-5.6-sol
@integry

integry commented Sep 7, 2026

Copy link
Copy Markdown
Owner

/review

Review corrected head 59c330f, specifically closure of F1. Independent diff inspection found the pre-admission guard in all three launch paths and deterministic tests for pre-launch non-execution and post-admission cleanup. ProPR reports desktop typecheck and 605 passing tests, 26 skips; fresh CI is running. Windows-only failures remain non-blocking and out of scope. Only concrete Linux/macOS correctness blockers; no optional polish, no auto-merge, epic #1970 only.

@propr-dev

propr-dev Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-5.6-sol

Overall Evaluation

The PR improves early-HUP handling and adds focused Linux/macOS lifecycle coverage, but it still needs a localized correction before merge: a signal can arrive after the new guard succeeds but before authentication is launched.

✅ Previously observed termination is rejected — All three launch branches check termination_requested and publish status 1 before launching when HUP/INT/TERM was already observed.

✅ Admitted-child cleanup is covered — The deferred ownership-checked termination path has deterministic coverage for draining a TERM-resistant child after a signal during identity capture.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F2: 🔴 Post-guard launch race remains

  • Required behavior: A termination observed before child admission must prevent the authentication command from executing.
  • Evidence: apps/desktop/src/authentication-handoff.ts:53 — abort_before_admission is a separate shell command from the following background launch. HUP/INT/TERM can run the provisional trap after the check returns but before "$@" &; the trap only sets termination_requested, so execution then continues into authentication. The equivalent gap exists in the other two launch branches.
  • Minimum fix: Eliminate the check-to-execution gap, such as by launching through a gated child that cannot execute authentication until the wrapper has established ownership and transitioned out of provisional handling. If termination wins before that transition, publish a nonzero result without executing authentication. Add deterministic coverage that delivers the signal after the current guard but before command execution.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The implementation substantially improves the lifecycle and includes strong deterministic tests, but the remaining narrow race violates the central pre-admission non-execution invariant. Current checks have no reported failures but remain pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-5.6 Sol
  • Time: 1m 25s
  • Tokens: 34,671 (30,254 in / 4,417 out)
  • Cost: $0.28

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry

integry commented Sep 7, 2026

Copy link
Copy Markdown
Owner

/fix F2

Close the identified check-to-launch gap with a clearly defined admission decision and deterministic coverage for shutdown between the current guard and execution. Keep this confined to authentication handoff and its tests. Preserve interactive /dev/tty behavior, ownership-checked cleanup, result reporting, and bounded cancellation. Define the admission/commit boundary explicitly: cancellation before it must prevent authentication execution; cancellation after it must drain the admitted child. Do not pursue an impossible guarantee that a signal after admission retroactively prevents launch, and avoid unrelated redesign or polish. Windows remains deferred. Run focused tests, desktop typecheck/full suite, then publish for review; no merge into main.

@propr-dev

propr-dev Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit a42468b

Addressed 1 AI review comment (IDs: 5563280593)

Summary of Changes

Implemented F2 only.

  • Added gated authentication launch with an explicit signal-handler admission boundary.
  • Pre-admission termination rejects the gate and reports status 1 without executing authentication.
  • Post-admission termination drains the owned child with existing bounded cleanup.
  • Preserved /dev/tty behavior, ownership checks, and result reporting.
  • Added deterministic before/after boundary HUP coverage in authentication-handoff.test.ts.

Verification:

  • Focused handoff tests: 8 passed
  • Desktop typecheck: passed
  • Full desktop suite: 605 passed, 26 skipped
  • git diff --check: passed

Only the handoff implementation and tests changed. No commit, merge, PR creation, Windows work, or visual preview was performed.


🤖 Implementation Details

  • Model: GPT-5.6 Sol (high)
  • Requested By: @integry
  • Time: 8m 3s
  • Tokens: 903,180 (889,107 in / 14,073 out)
  • Cost: $1.24

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 5563286657✓

Implemented F2 only.

- Added gated authentication launch with an explicit signal-handler admission boundary.
- Pre-admission termination rejects the gate and reports status 1 without executing authentication.
- Post-admission termination drains the owned child with existing bounded cleanup.
- Preserved `/dev/tty` behavior, ownership checks, and result reporting.
- Added deterministic before/after boundary HUP coverage in [authentication-handoff.test.ts](/tmp/git-processor/worktrees/integry/propr/pr-2136-followup-2026-09-07T00-15-38/apps/desktop/src/authentication-handoff.test.ts:222).

Verification:

- Focused handoff tests: 8 passed
- Desktop typecheck: passed
- Full desktop suite: 605 passed, 26 skipped
- `git diff --check`: passed

Only the handoff implementation and tests changed. No commit, merge, PR creation, Windows work, or visual preview was performed.

PR: #2136
Comment by: @integry (ID: 5563286657)
Model: gpt-5.6-sol
@integry

integry commented Sep 7, 2026

Copy link
Copy Markdown
Owner

/review

Review head a42468b for closure of F2. The explicit admission boundary is the signal-handler transition from reject_before_admission to terminate: before it, authentication must not execute; after it, ownership-checked cleanup drains the child. Evaluate that contract rather than requiring retroactive prevention after admission. Independent inspection completed; ProPR reports 8 focused tests, desktop typecheck, and 605 full desktop tests passing with 26 skips. Fresh CI must validate the published head. Concrete Linux/macOS blockers only; Windows remains deferred, no optional polish, no auto-merge or main merge.

@propr-dev

propr-dev Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-5.6-sol

Overall Evaluation

The PR correctly closes F2 by gating authentication behind an explicit admission file and defining the signal-handler transition as the commit boundary. It is ready to merge within the Linux/macOS scope, conditional on the 14 pending current-head checks completing successfully.

✅ Pre-admission cancellation is enforced — authentication-handoff.ts installs reject_before_admission before the final guards, so a signal before the handler transition publishes reject and the gated authentication command cannot execute.

✅ Post-admission cleanup is preserved — After the transition to terminate, shutdown uses ownership-checked TERM/KILL handling and waits for the admitted child to exit.

✅ Both boundary cases are deterministic — The focused tests inject barriers immediately before and after the admission transition, verifying non-execution before admission and cleanup of a TERM-resistant child afterward.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

F2 is closed with a localized implementation and strong boundary-focused regression coverage. No current check has failed, although final merge readiness remains conditional on the pending fresh CI results.

Score: 9/10


🤖 Review Details

  • Model: GPT-5.6 Sol
  • Time: 1m 25s
  • Tokens: 34,649 (30,786 in / 3,863 out)
  • Cost: $0.27

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry
integry merged commit 3f018ce into 1950-epic-cross-platform-dsk Sep 7, 2026
27 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant