fix(code): show user skills in running tasks and trigger / after spaces#2229
Open
richardsolomou wants to merge 2 commits into
Open
fix(code): show user skills in running tasks and trigger / after spaces#2229richardsolomou wants to merge 2 commits into
richardsolomou wants to merge 2 commits into
Conversation
The slash-command popup in the prompt input had two annoyances: 1. In a running session, the / popup only showed the built-in /good /bad /feedback commands until the agent's `available_commands_update` arrived. The fallback to the locally-fetched skills list was gated on the *absence* of a taskId, so running sessions never used it. 2. The popup only triggered when `/` was the first character of the prompt, because `CommandMention` was configured with `startOfLine: true`. Typing `please /skill` mid-prompt did nothing — inconsistent with `@` and `#`. Fixes: - Drop `startOfLine: true` from `CommandMention` so `/` works after a space. - Fall back to draft-store skills in `getCommandSuggestions` when the session hasn't yet emitted `available_commands_update`. - Move the skills loader from `TaskInput` into `PromptInput` so the session-view editor also populates the fallback list. Generated-By: PostHog Code Task-Id: 300b3a9a-c74e-42a2-9099-5ede198c7570
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/message-editor/suggestions/getSuggestions.test.ts:89-148
**Prefer parameterised tests for the fallback/override scenarios**
Tests 2 and 3 share identical setup (`seedSessionContext(TASK_ID)`) and differ only in whether `seedSessionAvailableCommands` is called; likewise tests 3 and 5 both exercise the draft-store fallback path but from different context states. Expressing these as `it.each` suites would satisfy the team's parameterised-test preference and make adding future cases (e.g. empty `availableCommands` from agent) a one-liner rather than a new `it` block.
Reviews (1): Last reviewed commit: "fix(code): show user skills in running t..." | Re-trigger Greptile |
Address review feedback — tests 2-5 shared most of their scaffolding; collapse into an `it.each` table so adding scenarios is a row, not another `it` block. Generated-By: PostHog Code Task-Id: 300b3a9a-c74e-42a2-9099-5ede198c7570
Contributor
|
this is a regression, i'm gonna take a peek in case there's a smaller/simpler bug here we can fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The slash-command popup in the prompt input had two annoyances reported on Slack:
/only showed the built-in/good /bad /feedbackcommands — none of the user's own skills./was the very first character of the prompt. Typing a space and then/(e.g.please /skill) did nothing.Changes
Trigger
/after a space, not just at start of line.CommandMentionwas configured withstartOfLine: true, which is inconsistent with@(files) and#(issues). Dropped the option so/now also triggers after a space — matching the rest of the mention extensions.Show user skills while waiting for the agent's command list. In
getCommandSuggestions, the fallback to the locally-fetched skills list (draftStore.commands[sessionId]) was gated on the absence of ataskId. That meant a running session would only ever show the built-in commands untilavailable_commands_updatearrived from the agent (fire-and-forget after a small delay). Switched the gate so the fallback kicks in whenever the session hasn't yet reported its commands — agent-supplied commands still win once they arrive.Populate the fallback for session-view inputs too. Previously only
TaskInput(new-task screen) loadedtrpcClient.skills.listintodraftStore.SessionView'sPromptInputnever did, so the fallback was empty there. Moved the loader intoPromptInputitself so it runs for any prompt with commands enabled.How did you test this?
pnpm --filter code typecheck✅pnpm lint✅pnpm --filter code test— 1317 tests pass (5 new ingetSuggestions.test.tscovering: built-ins always present, agent commands surfaced from session events, draft fallback when session is empty, agent commands win over draft, draft used outside a running task).Publish to changelog?
no
Created with PostHog Code