Repository navigation
fix(apps): check the app folder off the event loop before a lifecycle script - #39100
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. This is a one-line move of the folder stat onto a worker thread, it uses the same pattern as the code around it, and the function returns the same results as before. [DESIGN-REVIEWED] c166b0b Description read[DESCRIPTION-READ] a91de18ede535188b68a113e0e85ded299e3b3cb659d544a71678c902666bef8 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: this fixes the mechanism behind a defect the sync-io gate's baseline records. The fix is one line plus its baseline row and a test. What this change shipsInventory (3 items) — 3 justifiedIntent: stop the lifecycle-script app-folder check from stalling every session's turn when a mount hangs. FIX.
[FIRST-PRINCIPLES-REVIEWED] c166b0b Description read[DESCRIPTION-READ] 4180a3e3631117e196b8beb84f42215ca20e3f907dbe1d12b3a29acf7481cc48 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider estimates a 4% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier pending: being reviewed. This is a one-line fix: the Tier: pending: being reviewed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head c166b0b and found nothing blocking. The check app_root.is_dir() in run_lifecycle_script now runs through asyncio.to_thread. The signature and return values are the same, so the three callers in routes_lifecycle.py, routes_uninstall.py and teardown.py are unaffected. The denial check and the sandbox wrap are untouched. The row removed from .github/sync-io-in-async-fs-baseline.txt tightens the ratchet, and PR Readiness is green on this head.
Done well: the new test records which thread runs Path.is_dir and checks that the check ran at all (assert seen). So it fails if the change is reverted, and it cannot pass without checking anything.
Optional:
app_execution_deniedruns first and still callsapp_root.resolve(strict=True)on the event loop (execution.py:431). On a stuck mount the loop can still block there before it reaches the moved check. That code is older than this PR, and #34390 moves it off the loop. A short PR comment saying so would keep the claimed outcome accurate.- #10599, #34390, #38758 and #34777 also touch
lifecycle_scripts.pyor the baseline file. When you resolve those conflicts, do not restore the removed baseline row.
Problem / Motivation
Goal:
run_lifecycle_scriptstops checking the app folder on the event loop, so a slow or stuck mount cannot freeze every session's turn while an app is enabled, disabled or uninstalled.The sync-io gate lists
src/kiro_crew/apps/lifecycle_scripts.pyin.github/sync-io-in-async-fs-baseline.txt:run_lifecycle_scriptcalledapp_root.is_dir()on the loop thread before every lifecycle script.Why it matters
A stat on a mount that stops answering blocks the loop for as long as the kernel takes. Past the loop-stall limit the watchdog restarts the gateway.
Not a goal
What changed (motivation → approach → change)
lifecycle_scripts.py: the check is nowawait asyncio.to_thread(app_root.is_dir), the idiom the neighbouring code uses.scripts/check_sync_io_in_async.py --update-baseline).Backwards compatibility
Compatible: the same result and message for a missing app folder; only the thread that runs the stat changes.
Tests
test_app_directory_check_runs_off_the_event_looprecords the thread that callsPath.is_dirfor the app folder.origin/mainsource: it fails with "the app directory check ran on the event loop thread", and the sync-io gate with the baseline line removed fails onlifecycle_scripts.py:73.Proof: PROVEN test_app_directory_check_runs_off_the_event_loop (head c166b0b)
Sibling sweep
Swept:
python3 scripts/check_sync_io_in_async.py --reportSibling:
src/kiro_crew/apps/registry_pipeline/recovery.py-- not affected -- its cancel-time undo is synchronous on purpose so another cancel cannot interrupt it; its baseline row staysPattern harvest
Not generalizable: the sync-io gate already catches this class; the fix is the one listed call.
Related Issues
None.
Checklist