GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: user invoked subtasks causing tool_use or missing thinking signa… · bcardarella/opencode@5f57cee

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .opencode/command
    • commit.md
  • packages/opencode/src/session
    • prompt.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.opencode/command/commit.md‎

Copy file name to clipboardExpand all lines: .opencode/command/commit.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
description: git commit and push
33
model: opencode/glm-4.6
4+
subtask: true
45
---
56

67
commit and push
Collapse file

‎packages/opencode/src/session/prompt.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/session/prompt.ts
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,30 @@ export namespace SessionPrompt {
396396
},
397397
} satisfies MessageV2.ToolPart)
398398
}
399+
400+
// Add synthetic user message to prevent certain reasoning models from erroring
401+
// If we create assistant messages w/ out user ones following mid loop thinking signatures
402+
// will be missing and it can cause errors for models like gemini for example
403+
const summaryUserMsg: MessageV2.User = {
404+
id: Identifier.ascending("message"),
405+
sessionID,
406+
role: "user",
407+
time: {
408+
created: Date.now(),
409+
},
410+
agent: lastUser.agent,
411+
model: lastUser.model,
412+
}
413+
await Session.updateMessage(summaryUserMsg)
414+
await Session.updatePart({
415+
id: Identifier.ascending("part"),
416+
messageID: summaryUserMsg.id,
417+
sessionID,
418+
type: "text",
419+
text: "Summarize the task tool output above and continue with your task.",
420+
synthetic: true,
421+
} satisfies MessageV2.TextPart)
422+
399423
continue
400424
}
401425

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.