Skip to content

Commit 9043d92

Browse files
committed
fix: hide skill prompt text from chat UI
Mark the skill template TextPart as synthetic so the full prompt is sent to the model but hidden from the user. Add a short ignored summary part ('Running skill: <command>') so the user still sees confirmation that the skill was loaded. Rebased from flexion/hide-skill-prompt-in-chat onto v1.4.0.
1 parent 4ae7c77 commit 9043d92

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/opencode/src/session/prompt.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export namespace SessionPrompt {
124124

125125
const resolvePromptParts = Effect.fn("SessionPrompt.resolvePromptParts")(function* (template: string) {
126126
const ctx = yield* InstanceState.context
127-
const parts: PromptInput["parts"] = [{ type: "text", text: template }]
127+
const parts: PromptInput["parts"] = [{ type: "text", text: template, synthetic: true }]
128128
const files = ConfigMarkdown.files(template)
129129
const seen = new Set<string>()
130130
yield* Effect.forEach(
@@ -1637,7 +1637,15 @@ NOTE: At any point in time through this workflow you should feel free to ask the
16371637
prompt: templateParts.find((y) => y.type === "text")?.text ?? "",
16381638
},
16391639
]
1640-
: [...templateParts, ...(input.parts ?? [])]
1640+
: [
1641+
...templateParts,
1642+
{
1643+
type: "text" as const,
1644+
text: `Running skill: ${input.command}`,
1645+
ignored: true,
1646+
},
1647+
...(input.parts ?? []),
1648+
]
16411649

16421650
const userAgent = isSubtask ? (input.agent ?? (yield* agents.defaultAgent())) : agentName
16431651
const userModel = isSubtask

0 commit comments

Comments
 (0)