Skip to content

fix(dashboard): never suggest a bot's home folder for a new chat - #34307

Merged
RohanK6 merged 1 commit into
mainfrom
crew/conductor/r230-folder-suggest
Nov 10, 2026
Merged

RohanK6 merged 1 commit into
mainfrom
crew/conductor/r230-folder-suggest

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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_folders in src/kiro_crew/dashboard/chat_folder_suggest.py dropped 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_out with 403 mate_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

  • Reporting a refused move in useMoveSlotToFolder or the card (frontend).
  • The card's fallback that adds the suggested folder back to its dropdown.
  • Any change to who may file into a Bot's home.

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_folders leaves out every folder in a Bot's home, using mate_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_folder with 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-tree shows 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project Apache-2.0 license.

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.
@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 10, 2026 03:29
@RohanK6
RohanK6 requested a review from bolichen97 November 10, 2026 03:29
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 7dbe25748b4c4d5287de1aa9190c20169ab5095f touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 7dbe25748b4c4d5287de1aa9190c20169ab5095f — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the suggester now uses the same subtree set (mate_home_subtree_ids) as the move route's lock, so it only offers folders the Move button can actually file into.

Notes

  • A session owned by a Bot gets the opposite treatment: there _refuse_mate_move_out allows only that Bot's own home and refuses every other folder with mate_folder_scope. If the suggester ever runs for a Bot's session, it should be skipped there.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 7dbe25748b4c4d5287de1aa9190c20169ab5095f — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. This is a one-filter fix that reuses mate_folders.mate_home_subtree_ids, the set the folder writers already use, and it fixes the candidate list the suggestion paths read.

What this change ships

Inventory (3 items) — 3 justified

Intent: stop the folder-suggestion card from offering a Bot's folder whose Move is always refused (FIX, #34297).

  1. The suggestion card no longer offers a Bot's home folder or any folder inside it — justified
  2. An install whose only folders are a Bot's no longer gets a suggestion card or a model call — justified
  3. Two new tests pin both behaviours — justified

[FIRST-PRINCIPLES-REVIEWED] 7dbe257

Description read

[DESCRIPTION-READ] e79a7f339f0ec3e30da1adda98720304f91119d4bd21cf94f1ab668009d0b1b6

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 7dbe25748b4c4d5287de1aa9190c20169ab5095f — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 7dbe257

Verdict parsed from the review's SHA-scoped output markers for commit 7dbe25748b4c4d5287de1aa9190c20169ab5095f.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 7dbe25748b4c4d5287de1aa9190c20169ab5095f false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 7dbe25748b4c4d5287de1aa9190c20169ab5095f and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 7dbe257

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 7dbe25748b4c4d5287de1aa9190c20169ab5095f false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 10, 2026
@RohanK6
RohanK6 enabled auto-merge (squash) November 10, 2026 04:27

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 reads owner_app.
  • #15041 rewrites the same lines of _eligible_folders, so whichever PR lands second needs a rebase that keeps this filter.

@RohanK6
RohanK6 merged commit ba7a0c8 into main Nov 10, 2026
105 checks passed
@RohanK6
RohanK6 deleted the crew/conductor/r230-folder-suggest branch November 10, 2026 04:43
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 10, 2026
bolichen97 pushed a commit that referenced this pull request Nov 10, 2026
)

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dashboard: the folder-suggestion card offers a Bot's home folder, and Move silently does nothing

2 participants