@cubicecho/agent-core 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/side-task.js +10 -1
  2. package/package.json +1 -1
package/dist/side-task.js CHANGED
@@ -61,7 +61,16 @@ function rejectedTheRequest(error) {
61
61
  * model that spends it deliberating is cut off mid-scratchpad and the closing tag never
62
62
  * arrives — and the whole deliberation was then returned to the caller as the answer.
63
63
  */
64
- const stripThinking = (text) => text.replace(/<think>[\s\S]*?<\/think>/gi, "").replace(/<think>[\s\S]*$/i, "");
64
+ const stripThinking = (text) => text
65
+ .replace(/<think>[\s\S]*?<\/think>/gi, "")
66
+ .replace(/<think>[\s\S]*$/i, "")
67
+ // And the fence that never opens. Several chat templates put the opening tag at the end of
68
+ // the prompt rather than leaving the model to write it, so what comes back is deliberation
69
+ // first and only the closing tag to mark where it stops. Neither pattern above matches that,
70
+ // and the whole scratchpad went to the caller as the answer — a session title, a tool
71
+ // preselection, a suggestion list. Every real `<think>` is gone by this point, so a `</think>`
72
+ // still here opened in the prompt; the first one is taken, which keeps the most text.
73
+ .replace(/^[\s\S]*?<\/think>/i, "");
65
74
  /**
66
75
  * Runs a side task and returns the reply text, thinking stripped. Throws like any request.
67
76
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubicecho/agent-core",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "The endpoint-agnostic half of an OpenAI-compatible agent loop: tool-schema compatibility, on-demand tool loading, one-shot side tasks, run events, and a pooled client.",
5
5
  "keywords": [
6
6
  "openai",