feat(backend): route uncertain conversations to their category folder (#4043)#8499
feat(backend): route uncertain conversations to their category folder (#4043)#8499ZachL111 wants to merge 7 commits into
Conversation
|
Thanks for the thoughtful patch — this looks like a sensible direction for #4043. Maintainer review notes:
I’m leaving this as a positive signal rather than a formal approval because it changes backend conversation-to-folder routing / user data organization behavior, and the product choice (category-aligned system folder vs. default folder when uncertain) should get maintainer confirmation before merge. One small non-blocking cleanup to consider: the prompt still says “When in doubt, use the DEFAULT folder,” while the validator now deliberately maps low-confidence responses to the category-aligned folder when available. The code path is covered by tests, but updating that wording could make future prompt behavior easier to reason about. |
|
Thanks David, good call. I updated the instruction in fcb0cb5: "When in doubt, use the DEFAULT folder" is now "When no folder clearly matches, prefer the folder for the conversation's category if one is listed above, otherwise use the DEFAULT folder", so the prompt and the validator fallback now describe the same behavior. The product choice you flagged (category-aligned system folder vs the default folder when the model is uncertain) is yours to confirm. If the team would rather keep the old default-only fallback, that is a one line change to the validator and I am happy to make it. |
kodjima33
left a comment
There was a problem hiding this comment.
Backend feature: route uncertain conversations to category folder — approve only.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the update — the main instruction now matches the category-aligned fallback much better.
One remaining wording nit before a maintainer makes the product call: the confidence guidance still says “below 0.7 means use DEFAULT”, while the validator now intentionally routes low-confidence/invalid picks to the category-aligned folder when one exists. Could you update that sentence too so future prompt behavior and the safety fallback are fully consistent?
I still see this as a positive implementation direction with good unit coverage and green checks, but I’m not formally approving because this changes backend conversation-to-folder routing / user data organization behavior and should remain with human maintainer review.
|
Done in fb01ab2. Updated the confidence guidance from "below 0.7 means use DEFAULT" to "below 0.7 routes to the conversation's category folder if one is listed, otherwise the DEFAULT folder", so the prompt and the validator fallback are now fully consistent. As before, the product call on category-aligned vs default when the model is uncertain is yours; happy to revert the fallback to default-only if the team prefers. |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the quick follow-up — the remaining prompt wording is now aligned with the validator behavior.
Automated maintainer review notes for this head:
- The change reuses the existing
CATEGORY_TO_FOLDER_MAPPINGrather than adding a parallel taxonomy. - Low-confidence/invalid folder selections now fall back to the category-aligned system folder when available, while confident valid custom-folder choices are still preserved.
- The added unit tests cover the resolver, folder-context annotation, validator fallback paths, and end-to-end argument threading.
- Checks are green, and I don’t see a security/supply-chain concern in the diff.
No further code-review blocker from me. I’m still not giving formal automated approval because this changes backend conversation-to-folder routing / user data organization behavior and is under the repo’s human product/security review gate, but this looks ready for a maintainer’s final decision.
Summary
Improves AI folder assignment accuracy (#4043). When the model is unsure which folder a conversation belongs in, it now falls back to the folder that owns the conversation's category instead of the catch-all default, so an uncertain "finance" conversation lands in Work rather than the default folder.
What was missing
The issue notes folder assignment "isn't that accurate" and "does not seem to take into consideration the title/summary." Two things were going on:
Fix
Testing
Refs #4043.