@cubicecho/agent-core 2.2.3 → 2.2.4

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.
package/README.md CHANGED
@@ -82,6 +82,12 @@ again, with the setting still reading `high` and nothing anywhere saying it had
82
82
  So they hang off the endpoint under the name the endpoint knows the model by. Pass `model` and
83
83
  the same loop answers both levels; leave it out and nothing changes.
84
84
 
85
+ A refusal of the *value* is not one of these, however alike the two read: an effort off a list
86
+ this package does not know, a `max_tokens` larger than the model's ceiling, a temperature out of
87
+ range. Dropping the field answers those too — at the model's own default, latched for the rest of
88
+ the process, with the settings row still reading what was typed and nothing saying it had stopped
89
+ meaning it. They are passed to the caller instead, where whoever typed the number can see it.
90
+
85
91
  ```ts
86
92
  const turn = await negotiate(supports, (supports, produced, model) =>
87
93
  streamTurn(
@@ -94,13 +94,37 @@ const rejectsEffort = (detail) => /reasoning_effort/i.test(detail) && !REFUSED_V
94
94
  * whoever typed the number can see it.
95
95
  */
96
96
  const wantsCompletionLimit = (detail) => /max_tokens/i.test(detail) && /max_completion_tokens/i.test(detail);
97
+ /**
98
+ * Temperature named as the field being refused, rather than mentioned in passing.
99
+ *
100
+ * A bare search of the message is not that question. `Unsupported value: 'top_p' does not
101
+ * support 3 with this model. Adjust temperature instead.` refuses another field and merely says
102
+ * the word, and it disabled ours — the word is ordinary English about a model, so any advice,
103
+ * aside or list that reaches for it counted. OpenAI quotes the field it is refusing, which is
104
+ * the anchor; the second half is a server that writes the same clause without the quotes.
105
+ */
106
+ const NAMES_TEMPERATURE = /(['"`])temperature\1|\btemperature\s+(?:is|does|must|can)\b/i;
97
107
  /**
98
108
  * `'temperature' does not support 0.7 with this model. Only the default (1) is supported.`
99
109
  *
100
- * The qualifier is load-bearing. A temperature out of range is the caller's mistake to see
101
- * rather than ours to work around, and dropping the field would hide it.
110
+ * The qualifier is load-bearing, and `does not support` is not the qualifier: that is how a
111
+ * server words a refusal of the *value* `Invalid value: 'temperature' does not support 5.
112
+ * Supported values are between 0 and 2.` — which is the caller's mistake to see rather than
113
+ * ours to work around. Dropping the field there succeeds, at the model's own default, so a
114
+ * number the operator typed and can still read on a settings row is silently replaced by one
115
+ * nobody chose, for the life of the process. `only the default` is the whole of what separates
116
+ * the two: it says the field takes one value, where the generic phrasing says only that this
117
+ * value was the wrong one.
118
+ *
119
+ * `REFUSED_VALUE` cannot be borrowed from `rejectsEffort` to draw that line, which is why this
120
+ * has no such guard rather than having lost one — the genuine refusal above opens with
121
+ * `Unsupported value:` too, so the guard would reject the one message that has to latch.
122
+ *
123
+ * It under-matches an endpoint that refuses the field in some third wording, which is the
124
+ * direction this file argues for on `max_tokens` and on `reasoning_effort`: a false negative
125
+ * costs one visible error, and a false positive quietly changes what every later request means.
102
126
  */
103
- const refusesChosenTemperature = (detail) => /temperature/i.test(detail) && /only the default|does not support/i.test(detail);
127
+ const refusesChosenTemperature = (detail) => NAMES_TEMPERATURE.test(detail) && /only the default/i.test(detail);
104
128
  /**
105
129
  * Sends a request, re-sending it each time the answer is this endpoint refusing something the
106
130
  * request can do without. Returns once the endpoint has answered, or throws if the refusal is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubicecho/agent-core",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
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",