osborn 0.9.129 → 0.9.130
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/dist/claude-llm.js +13 -10
- package/package.json +1 -1
package/dist/claude-llm.js
CHANGED
|
@@ -149,6 +149,16 @@ function ensureCompactionSettings() {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
ensureCompactionSettings();
|
|
152
|
+
// Enable Opus 4.8's native 1M context window + set the auto-compact threshold
|
|
153
|
+
// at MODULE LOAD — BEFORE any query() spawns — so they actually apply to the
|
|
154
|
+
// persistent session. Setting these per-message in pushMessage() is too late:
|
|
155
|
+
// the SDK subprocess reads env once at cold-start, so later writes never reach
|
|
156
|
+
// the running query — the reason auto-compaction kept firing at ~150k every
|
|
157
|
+
// turn. ENABLE_1M_CONTEXT is Claude Code's documented switch for the context-1m
|
|
158
|
+
// (1M) window; without it opus runs at its 200K default. NOTE: 1M activation
|
|
159
|
+
// also depends on account entitlement (auto on Team seats; else usage credits).
|
|
160
|
+
process.env.ENABLE_1M_CONTEXT = '1';
|
|
161
|
+
process.env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE = '92';
|
|
152
162
|
// Research mode tools — full research capabilities
|
|
153
163
|
// Named sub-agents — the orchestrator delegates to these specialists. Each has
|
|
154
164
|
// a specific role, model, and tool set. Module-level + exported so the HTTP
|
|
@@ -769,16 +779,9 @@ export class ClaudeLLM extends llm.LLM {
|
|
|
769
779
|
* @param callbacks - Event callbacks for the background consumer
|
|
770
780
|
*/
|
|
771
781
|
pushMessage(userText, sdkOptions, callbacks) {
|
|
772
|
-
//
|
|
773
|
-
//
|
|
774
|
-
// per
|
|
775
|
-
// is safe before Claude starts hard-capping replies near the 1M limit.
|
|
776
|
-
process.env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE = '92';
|
|
777
|
-
// Compaction WINDOW in thousands of tokens (min(actual_context, this)). Now
|
|
778
|
-
// that the model runs with [1m] (1M context), set this to 1000 (=1,000,000)
|
|
779
|
-
// so the compaction budget matches the real window instead of being clamped
|
|
780
|
-
// to opus' 200k base — the actual cause of the ~153k early compaction.
|
|
781
|
-
process.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = '1000';
|
|
782
|
+
// (Compaction/1M env is set once at module load — see ENABLE_1M_CONTEXT /
|
|
783
|
+
// CLAUDE_AUTOCOMPACT_PCT_OVERRIDE near ensureCompactionSettings(). Setting it
|
|
784
|
+
// here per-message was too late for the persistent query.)
|
|
782
785
|
const userMessage = {
|
|
783
786
|
type: 'user',
|
|
784
787
|
message: { role: 'user', content: [{ type: 'text', text: userText }] },
|