Skip to content

Wait longer for a restarted shell to become ready - #8630

Closed
lamchun1110 wants to merge 3 commits into
omacom:quattrofrom
lamchun1110:fix/restart-shell-readiness-timeout
Closed

lamchun1110 wants to merge 3 commits into
omacom:quattrofrom
lamchun1110:fix/restart-shell-readiness-timeout

Conversation

@lamchun1110

Copy link
Copy Markdown

Why

omarchy restart shell gives up after 20 readiness probes. Plugin discovery and first-load QML compilation can take longer, so the command can report failure even though the new shell becomes responsive shortly afterward.

What

  • replace the fixed 20-probe loop with a 30-second wall-clock deadline
  • add regression coverage for a shell that becomes responsive after 25 probes

Testing

  • bash test/shell.d/restart-shell-test.sh
  • bash -n bin/omarchy-restart-shell test/shell.d/restart-shell-test.sh
  • git diff --check

Fixes #8568

omarchybot and others added 2 commits October 1, 2026 14:25
The quickshell stub kills the pid in the state file, so seeding it with a literal 303 sent SIGTERM to an unrelated process on the machine running the suite. Seed it with a throwaway sleep, as the other restart cases do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and tested on a fresh Omarchy worker VM. The fix holds, and I pushed two commits to the branch.

What was checked. The new slow-shell case in test/shell.d/restart-shell-test.sh fails against quattro's 20-attempt loop ("Omarchy shell did not become ready after restart.") and passes with the 30-second deadline, so it reproduces #8568's false failure and proves the fix. restart-shell-test.sh (10/10) and lock-stranded-recovery-test.sh (14/14) pass at the new head. The real bin/omarchy-restart-shell restarted the worker's stock shell three times, exiting 0 and leaving one Quickshell instance each time. ./test/cli has one failure, vscode generated theme references current theme file, and quattro fails it the same way, so this change does not cause it.

Pushed:

  • f6f49e40f merges quattro, which had restructured the readiness loop around a shell_ready flag and moved the relock and invitation restart after it. The 30-second deadline now drives that loop, and everything quattro does after it is unchanged.
  • 5ef3c48a5 fixes the new test, which seeded the quickshell stub with a literal pid 303. The stub kills whatever pid is in its state file, so running the suite sent SIGTERM to whichever process had pid 303 on that machine. It now uses a throwaway sleep, as the other restart cases do.

Second opinion: none. The configured reviewer (Codex) was not run because omabot's review budget for the day was spent, so this was checked by Claude Opus 5.5 alone.

Waiting on: the maintainer. Nothing is left for the author. Because there was no second review, the PR stays at verified rather than ready.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Increases timeout for shell startup readiness check.

The PR appears safe to merge, though the deadline edge and regression coverage merit follow-up.

Findings

  1. P2 Deadline Can Expire Early ▶
  2. P2 Test Misses Deadline Behavior ▶

Summary

The PR replaces the restart command’s 20 readiness probes with a 30-second deadline and adds a 25-probe regression case.

  • The deadline can cut off slightly early because SECONDS has whole-second precision.
  • The regression case checks probe count but not readiness near the new deadline.

Reviews (1) · Last reviewed commit: "Stop the slow-shell test killing whateve..."

Comment thread bin/omarchy-restart-shell
Comment on lines +89 to +90
ready_deadline=$((SECONDS + 30))
while (( SECONDS < ready_deadline )); do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Deadline can expire early. Bash’s SECONDS counts whole seconds, so this deadline can stop polling almost a second before the shell has had the full 30 seconds to respond. A shell that becomes ready near the limit may be reported as not ready. Use a deadline that measures the full elapsed interval.

Comment on lines +271 to +273
OMARCHY_TEST_QS_READY_AFTER=25 \
OMARCHY_TEST_QS_READY_COUNT="$ready_count" \
timeout 8 "$ROOT/bin/omarchy-restart-shell" || fail "restart waits for a slow shell to become ready"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Test misses deadline behavior. The mock becomes ready after 25 fast calls, while the outer timeout allows only eight seconds. This catches the old 20-probe limit but does not check whether polling continues near the new 30-second deadline. A shorter deadline could pass unnoticed, and slow process startup could make a correct implementation fail the test. Exercise elapsed readiness time with an outer timeout that accommodates it.

@omarchybot

Copy link
Copy Markdown
Collaborator

Closing this alternative after #11015 merged into quattro. The merged restart waits up to 60 seconds for readiness instead of the short attempt count. This covers the slow-but-successful startup failure targeted here.

Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup.

Omabot on behalf of DHH

@omarchybot omarchybot closed this Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-restart-shell reports "did not become ready" even on a successful restart

2 participants