Skip to content

Commit 0d5bfb3

Browse files
committed
fix(code-review): P1 CLI DELETE URL + P1 regex sync comment + P2 enhance contamination tag
P1 #2: CLI $-removal now hits correct URL (/skill/:name not /skill with body) P1 #1: Added sync comment linking CLI regex to skill-parse.ts source of truth P2 #3: Tagged enhancePrompt as contamination from prax/enhance-prompt (PR #9) P2 #5/#6: bootstrap.ts + message-v2.ts contamination accepted as-is (too intertwined)
1 parent 3e1296d commit 0d5bfb3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/app/src/components/prompt-input.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
284284
}
285285

286286
const [steerPending, setSteerPending] = createSignal(false)
287+
// TODO(contamination): enhancePrompt belongs to prax/enhance-prompt (PR #9).
288+
// It leaked into this branch during extraction from prax-dev.
289+
// Remove when prax/enhance-prompt is merged via prax-build.sh.
287290
const [enhancing, setEnhancing] = createSignal(false)
288291

289292
const enhancePrompt = async () => {

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,8 @@ export function Prompt(props: PromptProps) {
634634
// Guards: $ must be at start-of-line or after whitespace (not $$).
635635
// $name → adds skill to session (SkillPart in parts array)
636636
// $-name → removes skill from session (DELETE API call)
637+
// NOTE: This regex MUST stay in sync with packages/app/src/util/skill-parse.ts
638+
// (the web frontend's source-of-truth parser). If you change it here, update there too.
637639
const skillPattern = /(?:^|(?<=\s))\$(-?[a-zA-Z][\w-]*)/g
638640
const skills: Array<{ type: "skill"; name: string }> = []
639641
const removals: string[] = []
@@ -644,13 +646,11 @@ export function Prompt(props: PromptProps) {
644646
else skills.push({ type: "skill" as const, name: token })
645647
}
646648

647-
// Process $-removal requests via DELETE /session/:id/skill
649+
// Process $-removal requests via DELETE /session/:id/skill/:name
648650
if (sessionID) {
649651
for (const name of removals) {
650-
fetch(`${sdk.url}/session/${sessionID}/skill`, {
652+
fetch(`${sdk.url}/session/${sessionID}/skill/${encodeURIComponent(name)}`, {
651653
method: "DELETE",
652-
headers: { "Content-Type": "application/json" },
653-
body: JSON.stringify({ name }),
654654
}).catch(() => {
655655
toast.show({
656656
variant: "error",

0 commit comments

Comments
 (0)