Repository navigation
fix(dashboard): never suggest a bot's home folder for a new chat - #34307
Conversation
The folder suggester picks from every folder that is not hidden, so a Bot's home folder, and the folders inside it, could be offered. Only that Bot files a chat there, so the card's Move is refused with mate_home_locked; the dashboard rolls the move back and clears the card with no message, and the session stays unfiled. The suggester now leaves out every folder in a Bot's home, using the same subtree set the folder writers use. When those are the only folders, no suggestion is made and no card is shown.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the suggester now uses the same subtree set ( Notes
[DESIGN-REVIEWED] 7dbe257 Description read[DESCRIPTION-READ] d3d67d976e5a89b21dbb10ba41e5827ab91b7e48aa237c29e72bbcd05584a20e 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 is a one-filter fix that reuses What this change shipsInventory (3 items) — 3 justifiedIntent: stop the folder-suggestion card from offering a Bot's folder whose Move is always refused (FIX, #34297).
[FIRST-PRINCIPLES-REVIEWED] 7dbe257 Description read[DESCRIPTION-READ] e79a7f339f0ec3e30da1adda98720304f91119d4bd21cf94f1ab668009d0b1b6 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: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Thanks for the fix. On head 7dbe257 the review checked these things. _eligible_folders now drops exactly the folders that mate_home_subtree_ids returns, and those are the same folders the move route refuses with mate_home_locked when the person presses Move. The filter runs before the 40 folder cap, so both the project directory match and the model pick use it. A Bot-only install now gets no model call and no card. test/test_chat_folder_suggest.py passed at this head (53 tests). With the new filter clause removed, exactly the two new tests failed.
Done well: the fix reuses the subtree helper that the folder lock already depends on, so the suggester and the move route cannot disagree about which folders are locked.
Optional:
- In
test/test_chat_folder_suggest.py(lines 108 and 395), build the Bot home the way production writes it,{"mate_home": True, "owner_app": "member:conductor"}, so the fixture still matches real data if the predicate later readsowner_app. - #15041 rewrites the same lines of
_eligible_folders, so whichever PR lands second needs a rebase that keeps this filter.
) The folder suggester picks from every folder that is not hidden, so a Bot's home folder, and the folders inside it, could be offered. Only that Bot files a chat there, so the card's Move is refused with mate_home_locked; the dashboard rolls the move back and clears the card with no message, and the session stays unfiled. The suggester now leaves out every folder in a Bot's home, using the same subtree set the folder writers use. When those are the only folders, no suggestion is made and no card is shown. (cherry picked from commit ba7a0c8)
Problem / Motivation
Goal: The folder-suggestion card never offers a Bot's home folder, or a folder inside one, so its Move button never fails silently.
After a new session is titled, the folder-suggestion card offers a folder.
_eligible_foldersinsrc/kiro_crew/dashboard/chat_folder_suggest.pydropped only hidden folders, so a Bot's home folder and its subfolders could be picked. Only that Bot files a chat there, so the card's Move is refused by_refuse_mate_move_outwith 403mate_home_locked; the dashboard rolls the move back and clears the card with no message, and the session stays unfiled.Why it matters
On an install whose only folder is a Bot's home, every session on the Bot's topic gets a suggestion that cannot be taken, and clicking Move looks like it worked.
Not a goal
useMoveSlotToFolderor the card (frontend).What changed (motivation → approach → change)
Symptom: the card offers a Bot's folder and Move does nothing. Root cause: the suggester's candidate list kept folders that the move route refuses. Change:
_eligible_foldersleaves out every folder in a Bot's home, usingmate_folders.mate_home_subtree_ids, the subtree set the folder writers already use. Both suggestion paths (the project-directory match and the model pick) read that list, and an empty list already ends the suggestion before any card is sent, so an install whose only folders are a Bot's gets no card.Backwards compatibility
Compatible: every folder that could be suggested and moved into before is still suggested; only folders the move route always refused are left out.
Removes nothing: the folders stay in the sidebar and in the dropdown rules; they are no longer proposed by the suggester.
Tests
test/test_chat_folder_suggest.py::test_eligible_folders_skips_a_bots_home_and_its_subfolders: a Bot home, its subfolder and a deeper subfolder are left out; an ordinary folder stays.test/test_chat_folder_suggest.py::test_only_a_bots_home_means_no_call_and_no_card: with only a Bot home, no model call is made and no card frame is sent.Both fail on main.
Proof: PROVEN test/test_chat_folder_suggest.py::test_eligible_folders_skips_a_bots_home_and_its_subfolders, test/test_chat_folder_suggest.py::test_only_a_bots_home_means_no_call_and_no_card (head 7dbe257)
Manual verification
N/A — unit coverage sufficient: the second test runs the real
maybe_suggest_folderwith only the model call stubbed.Related Issues
Fixes #34297
Deferred: #34316 (a refused folder move is rolled back with no message in the dashboard)
Related: #31604 edits the same module (the auto-apply setting) on other lines;
git merge-treeshows no conflict.Sibling sweep
Swept: git grep -n "_eligible_folders|state._folders" -- src/kiro_crew/dashboard/chat_folder_suggest.py
Siblings: none -- _eligible_folders is the one candidate list both suggestion paths read
Pattern harvest
Not generalizable: one candidate list missed a filter that the folder writers already apply through mate_home_subtree_ids.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project Apache-2.0 license.