Surface multiple solutions for katas that have them#3275
Conversation
When an exercise has multiple reference solutions (14 exercises today), show a "See alternative approaches" link in the panel after a passing check. Clicking opens Copilot Chat where the agent presents all reference solutions with their explanations. Changes: - Preserve all @[solution] blocks from katas content (catalog.ts was discarding all but the first via .find()) - Add hasAlternatives flag to ExerciseContent, driven by solutionCodes.length > 1 - Extend the solution tool to return alternatives alongside the primary - Thread hasAlternatives through webview to conditionally render the link - Update agent instructions with new chat entry point and handling
| - **"Explain this concept in more detail"** — Provide a deeper pedagogical explanation. Offer analogies, relate to prior units. Don't repeat the panel content. | ||
| - **"Help me understand why my solution failed"** — Analyze common mistakes for that exercise. Give targeted debugging hints, not the full solution. | ||
| - **"Explain this solution step by step"** — Walk through the reference solution line by line, explaining the quantum concepts and Q# patterns. | ||
| - **"Explain this solution step by step"** — Walk through the reference solution line by line, explaining the quantum concepts and Q# patterns. If there are multiple reference solutions, walk through only the first one. |
There was a problem hiding this comment.
Shall we instruct Copilot to also call the readUserCode (?) tool to read the user's solution, and compare to the reference solution?
There was a problem hiding this comment.
This comment was meant for the line below it. Looks like this line is just out of date (and the corresponding row in the table). Could you clean it up maybe?
There was a problem hiding this comment.
Removed the entry for "Explain this solution"
|
|
||
| Render the result, offer a brief reaction. Don't auto-call `next` — the user may want to review the solution first. | ||
| Render the result, offer a brief reaction. Don't auto-call `next` — the user may want to review the solution first. If the exercise has alternative approaches (indicated by the panel showing a "See alternative approaches" link), you may briefly mention that other approaches exist, but don't present them unless asked. |
There was a problem hiding this comment.
The agent can't "see" this UI state, so this wording is likely to just confuse it.
Most of the time the agent can't "see" passing checks as they happen at all, because the user does it through the Check button in the UI. So this paragraph is essentially telling the agent how to handle the result of a check tool call that it made.
Probably best to guide the agent towards the hasAlternativeSolutions flag for the current exercise (which should hopefully already be in context, thanks to frequent calls the agent has to make to getState).
(indicated by the
hasAlternativeSolutionsflag)
| filePath: string; | ||
| isComplete: boolean; | ||
| /** True when multiple reference solutions exist for this exercise. */ | ||
| hasAlternatives: boolean; |
There was a problem hiding this comment.
Suggest renaming this to hasAlternativeSolutions because the agent can't see the doc comment, just the JSON data. The agent can infer meaning from descriptive names.
minestarks
left a comment
There was a problem hiding this comment.
Thanks! Works well on the exercise I tried. A couple of minor suggestions

I remember finding the alternative solutions useful in the web version of the katas and I thought they might be useful in VS Code too. I decided not to try to figure out if the user's solution matched one of the available solutions since I wasn't sure Haiku could handle that reliably and it's easy enough to read past the one that matches yours.
