Repository navigation
fix(dashboard): key the path-probe stall gate for callers that do not lead with the path - #22321
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the terminal call still gets a key when [DESIGN-REVIEWED] e40dc0e Description read[DESCRIPTION-READ] 5db9bd3582de2490eef5f22aaad48298a40e76ee7194fd494ef0ea3137b52178 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 Check that leaving What this change shipsInventory (8 items) — 8 justifiedIntent: a dead mount reached through any dashboard file route gets the per-mount
[FIRST-PRINCIPLES-REVIEWED] e40dc0e Description read[DESCRIPTION-READ] e2d4c97cc2ef53266a92d9bddf39943f888eea8fd4b6af253f1e92d778169afd 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: |
… lead with the path
fd01037 to
e40dc0e
Compare
|
self-added: no
|
|
self-added: no
|
|
self-added: no
|
|
self-added: no
|
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed head e40dc0e. The change looks good to ship.
What I checked:
_run_path_probekeys onstall_pathwhen given and on the first argument otherwise, so callers that omit it keep the old key._batch_stall_pathreturns no key for an empty list: the set of keys is empty, sopaths[0]is never read. This covers the file-search walk when every root is filtered out.- A batch that mixes a keyed path with an unkeyed one (relative with no project dir, or
~name) gets no key, which is the documented rule. file_rawkeys on the same query path it opens, and the terminal passesstall_pathonly insideif requested_cwd:.- Linked issue is tier:T1. No file is on the security path list. The design and first principles notes have replies that match the code.
Remaining maintainer check: readiness is not passed on this head yet (coverage combine is still pending). I will approve once readiness passes on this same head.
|
Review-ready at What it does: main has moved since this head went green, but only in other files; nothing this PR changes. This Crew will not merge, approve or enable auto-merge; that is the maintainer's call. |
bolichen97
left a comment
There was a problem hiding this comment.
Approving head e40dc0e. Checked on this head: readiness label passed, PR Readiness green, Coverage Combine green, no required check failing, all review lanes PASS with no BLOCK, linked issue is tier T1, no outstanding change requests. Earlier review found it good to ship.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (16 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: adds a keyword-only stall_path to the dashboard path probe so callers that do not pass their path first are keyed by the same stall rule, with tests for each route. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/modules/security.md.
Problem / Motivation
Goal: Every dashboard file route that runs a blocking path call is refused under a mount once two calls there are stuck, including routes that do not pass their path as the first argument.
PR #21782 taught
_run_path_probeto refuse new calls under a mount once two probes there are stuck past 2 s. It finds the mount from the call's first argument only. Five callers pass their path another way (a closure, a list, a config first, a relative path), so they get no key. A caller naming a dead mount through one of them still parks one worker per request until the probe pool is full.Why it matters
When the probe pool is full, every file route answers 503, not just the ones on the dead mount. These five routes (reveal/open, the unscoped file search,
/api/file-kinds, the terminal cwd, and everyresolve=1read) were the way around the per-mount refusal.Not a goal
What changed (motivation → approach → change)
The stall key came only from the first argument, so callers that pass their path some other way had no key.
_run_path_probetakes a keyword-onlystall_path=. When it is given, the key comes from it by the same lexical rule;""means no key; when it is omitted, the first argument is the key as before.stall_pathdesktop.py)handlers/terminal.py)resolve=1ineditor.py,transfer.py,office_preview.py,office_slides.py_project_relative_stall_path: the project dir for a relative path, else the path/api/file-kinds(pinned_io.py)_batch_stall_pathover the listsearch.py)_batch_stall_pathover the project dir and workspacefile_raw,file_download,office_preview.py,sheet.py,grep.pysearch.py)_batch_stall_pathover the roots it walksFor the list callers the rule is: key only when every path shares one key. Keying on the first path would let two batches stuck on a dead mount listed third refuse a healthy mount listed first, on every route. A batch across mounts stays bounded by the pool, as today.
Four probe-pool calls stay unkeyed: the drive listing (no path), the outbox read and the slide render (paths inside crew-owned directories, not chosen by the caller), and the knowledge-source add check (
handlers/knowledge_sources.py, not a file route). Thehandlers/files.pyfacade exports the two helpers, anddocs/system-specs/modules/security.mddescribes the rule.Backwards compatibility
Compatible:
stall_pathis a new optional keyword; every caller that omits it gets the first-argument key exactly as before. The only new refusals are the documented503 path_probe_busy, under a mount with two stuck calls.Removes nothing: no key, route or answer is taken away; calls that had no key gain one.
Tests
test/test_dashboard_files_onloop_fs.py(TestStallKeyForCallersThatDoNotLeadWithThePath) andtest/test_terminal_handler.pypark two probes under one key on a three-worker pool, with the stall time set to zero so no clock is involved. Then they show the route is refused withpath_probe_busywhile the third worker is still free:/api/file-kindswith an absolute and a relative path in one project: refused.resolve=1file read: refused before the resolver runs._resolve_cwdruns.file_raw,file_download,file_office_preview,file_sheet: each transfer is refused under its path's key._batch_stall_path/_project_relative_stall_path: one key for one mount, none across mounts, none with no project dir.All ten fail on
origin/main.test/test_dashboard_files_composition_contract.pygets the recaptured shape digest for the new_run_path_probesignature.Manual verification
N/A — unit coverage sufficient: the change is which key a call is charged to, and each route is driven end to end through its handler against a parked pool.
Related Issues
Closes #21798
Pattern harvest
Not generalizable: the defect was one chokepoint inferring its key from argument position; the explicit keyword removes that inference for this chokepoint only.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)