Repository navigation
fix(session): reclaim issue-radar one-run work directories - #24986
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This fixes a reported defect (#23880) at the mechanism level. One sibling with the same root cause is still unfixed. Notes
What this change shipsInventory (4 items) — 3 justifiedIntent: Issue Radar AI clicks stop leaving one empty work folder behind per call — FIX.
[FIRST-PRINCIPLES-REVIEWED] c61fbb1 Description read[DESCRIPTION-READ] 49878e416aa7b511921b8eed721cc807d360c4dd897cb046ec77491df0e43265 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The change only adds shapes to an existing table, and deletion is still decided by the marker, not by the broader folder-name filter. [DESIGN-REVIEWED] c61fbb1 Description read[DESCRIPTION-READ] bbd2e177adb372728463830fd9bbc54be9c06f9ba571d9f3482ab608e4ba9da8 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 |
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: |
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: |
953fa88 to
23af7f2
Compare
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
Requesting changes at 23af7f2785 for one small item. The code is sound.
Blocking: the owning spec is not updated. docs/system-specs/modules/acp-client.md:465-481 lists every one-run key the provider marks for reclaim (subagent, cron, memory-consolidation, judge, taskrunner, hook, wf-author). This PR adds four issue-radar-* shapes and a new key-to-folder form (/ becomes _), and the spec does not mention issue-radar at all. AGENTS.md requires the spec to change in the same commit, otherwise the spec is wrong about which folders Kiro Crew deletes. Please add the four shapes, their folder form, and that they run on both platforms' walks.
Deletion safety, checked against source: no new delete code, only shape-table rows. Reclaim still goes through reclaim_session_work_dir / _reclaim_by_name, which remove only Kiro Crew's own .kiro/settings leftovers plus the marker and refuse links and junctions. User-chosen cwd is excluded (loader_config.py:1527). Key matching is anchored and the allowed characters exclude / \ : space, so the folder is always one path component. The sweep still needs a marker, a dead predecessor gateway, no live session, and one hour of age. On Windows an open handle makes the delete fail and the folder is kept (read from source; Windows CI passes).
199 tests pass; 4/4 mutations redden named tests (removing the rows, loosening the key charset, using the key form as the folder name, making #<n> optional).
Non-blocking: reclaim returns False without logging on every refusal (pre-existing).
23af7f2 to
c61fbb1
Compare
|
[operator: bolichen97] @buluoray thanks for the review.
|
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
Approving at c61fbb138b. This supersedes my changes-requested review at 23af7f2785.
The blocking item is fixed: acp-client.md now lists the four issue-radar-* key shapes, their folder form (/ and : become _, # kept), the [A-Za-z0-9._-] segment limit, and that they are reclaimable on both walks. Compared against the earlier head, the code and test changes are identical; only the spec was added. My earlier deletion-safety check therefore still holds. CI: 93 pass, 16 skipped, 0 failed.
Problem / Motivation
Goal: Issue Radar's one-shot AI calls stop leaving an empty work folder behind for every click.
Each Issue Radar AI call (issue triage, PR summary, recommendations, tagging) runs one throwaway session. Its key looks like
issue-radar-ai:<owner>/<repo>#<n>:<uuid hex>. That shape was not in the one-run table insrc/kiro_crew/session_work_dir.py, so the provider never marked or reclaimed the folder. Every click left one moreissue-radar-*folder under the workspace root.Why it matters
A user who uses Issue Radar a lot piles up one folder per AI call, each holding only Crew's own
.kiro/settings/cli.jsonresidue. They slow directory listings and keep skill-view aliases alive, the same cost #16049 removed for the other one-run sessions.Not a goal
kirocrew doctorkeeps counting them, as for every other shape.What changed (motivation → approach → change)
Symptom: one leftover folder per Issue Radar AI call. Cause: the four keys carry
/and#, and the shape table only knew colon-separated parts.The folder name already comes from
_safe_dir_name, which turns/into_and keeps#. So the mapping is settled:issue-radar-ai:octo/hello#12:<hex>lives inissue-radar-ai_octo_hello#12_<hex>.issue-radar-ai:<owner>/<repo>#<n>:<hex32>issue-radar-ai_<owner>_<repo>#<n>_<hex32>issue-radar-pr-ai:<owner>/<repo>#<n>:<hex32>issue-radar-pr-ai_<owner>_<repo>#<n>_<hex32>issue-radar-reco:<owner>/<repo>:<hex32>issue-radar-reco_<owner>_<repo>_<hex32>issue-radar-tagging:<owner>/<repo>:<hex32>issue-radar-tagging_<owner>_<repo>_<hex32>A table part may now be a pair: its key form and its folder form. The key form is strict: segments of
[A-Za-z0-9._-], split by/(a GitLab subgroup path is fine), and a positive number. The folder form is one segment class, because_is both a segment character and the/stand-in; a nested_-split repeat there would backtrack. The folder name is only the sweep's candidate filter. The marker, written only for a key that matches, still decides every deletion, so no safety rule changes.The owning spec,
docs/system-specs/modules/acp-client.md, now lists the four shapes, their folder form and the new pair entry, and says they are reclaimed on both platforms' walks.Backwards compatibility
Compatible: the table only gains shapes; every key that matched before matches the same way.
Removes nothing: no key, record, validator or reader is removed or tightened.
Tests
test_issue_radar_one_run_keys_and_their_directory_names: the four shapes, GitLab subgroups, and refused near-misses (no number, negative number, short id, space, unknown surface), checked through the real_session_work_dirname.test_issue_radar_keys_as_the_routes_mint_them: the exact f-strings from the three route files.test_the_sweep_reclaims_a_predecessors_issue_radar_folders: a dead predecessor's marked folders go; an unmarked one stays.Proof: PROVEN test/test_session_work_dir.py::TestDisposableSessionKey::test_issue_radar_one_run_keys_and_their_directory_names[issue-radar-ai:octo/hello#12:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-True], test/test_session_work_dir.py::TestDisposableSessionKey::test_issue_radar_one_run_keys_and_their_directory_names[issue-radar-pr-ai:octo/hello.js#7:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-True], test/test_session_work_dir.py::TestDisposableSessionKey::test_issue_radar_one_run_keys_and_their_directory_names[issue-radar-reco:octo/hello_world:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-True], test/test_session_work_dir.py::TestDisposableSessionKey::test_issue_radar_one_run_keys_and_their_directory_names[issue-radar-tagging:octo-org/hello-world:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-True], test/test_session_work_dir.py::TestDisposableSessionKey::test_issue_radar_one_run_keys_and_their_directory_names[issue-radar-ai:group/sub/project#3:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-True] (head c61fbb1)
Determinism: the new tests use fixed strings,
uuid4ids andtmp_pathonly. They pass 20/20 at-n0, the whole file passes 10/10 at-n 4, and all 199 tests pass in a shuffled order (seed 7).Manual verification
N/A - unit coverage sufficient: the change is a pure shape table, exercised by key, folder name and a real sweep over
tmp_path.Related Issues
Closes #23880
Sibling sweep
Swept: git grep -nE 'key = f"[a-z-]+:.*uuid.uuid4().hex' -- src/
Sibling: src/kiro_crew/apps/builtins/issue_radar/backend/http_routes/ai.py -- not affected -- its two keys are matched by the table rows this PR adds
Sibling: src/kiro_crew/apps/builtins/issue_radar/backend/http_routes/recommendations.py -- not affected -- its key is matched by the table row this PR adds
Sibling: src/kiro_crew/apps/builtins/issue_radar/backend/http_routes/tagging.py -- not affected -- its key is matched by the table row this PR adds
Sibling: src/kiro_crew/decisions/impl_llm.py -- not affected -- judge key already in the table
Pattern harvest
Not generalizable: the table already exists to catch this class; the defect was four shapes deferred from #20110 until the folder mapping was settled.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)