osborn 0.9.178 → 0.9.180

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.
@@ -167,7 +167,7 @@ ensureCompactionSettings();
167
167
  // (1M) window; without it opus runs at its 200K default. NOTE: 1M activation
168
168
  // also depends on account entitlement (auto on Team seats; else usage credits).
169
169
  process.env.ENABLE_1M_CONTEXT = '1';
170
- process.env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE = '60';
170
+ process.env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE = '75'; // auto-compact at 75% of 1M context (750k tokens) — prevents compaction at extreme tail
171
171
  // Research mode tools — full research capabilities
172
172
  // Named sub-agents — the orchestrator delegates to these specialists. Each has
173
173
  // a specific role, model, and tool set. Module-level + exported so the HTTP
@@ -276,13 +276,13 @@ export const NAMED_AGENTS = {
276
276
  },
277
277
  writer: {
278
278
  description: [
279
- 'Execution agent with file write/edit permissions (Sonnet).',
279
+ 'Execution agent with file write/edit permissions (Opus).',
280
280
  'Handles ALL file operations: code, config, docs, scripts, data files.',
281
281
  'VERIFY-FIRST workflow: checks assumptions before making changes, runs tests after.',
282
282
  'If anything is unclear, asks the main agent for clarification before touching files.',
283
283
  ].join(' '),
284
284
  tools: ['Read', 'Write', 'Edit', 'MultiEdit', 'Bash', 'Glob', 'Grep', 'NotebookRead', 'NotebookEdit'],
285
- model: 'sonnet',
285
+ model: 'opus',
286
286
  prompt: [
287
287
  'You are Osborn\'s writer agent. You execute file changes with a verify-first approach.',
288
288
  '',
@@ -421,13 +421,13 @@ export const NAMED_AGENTS = {
421
421
  },
422
422
  planner: {
423
423
  description: [
424
- 'Planning agent (Opus). Use for: decomposing a large or ambiguous request into a concrete,',
424
+ 'Planning agent (Sonnet). Use for: decomposing a large or ambiguous request into a concrete,',
425
425
  'ordered sequence of atomic writer-safe steps. Returns a self-contained brief the writer',
426
426
  'can execute without further clarification. Slow but thorough — only use for genuinely',
427
427
  'complex multi-file changes or when the approach is uncertain.',
428
428
  ].join(' '),
429
429
  tools: ['Read', 'Glob', 'Grep', 'WebSearch'],
430
- model: 'opus',
430
+ model: 'sonnet',
431
431
  prompt: [
432
432
  'You are Osborn\'s planning agent. Your job is to decompose complex tasks into clear, atomic steps.',
433
433
  '',
@@ -474,13 +474,13 @@ export const NAMED_AGENTS = {
474
474
  },
475
475
  reviewer: {
476
476
  description: [
477
- 'Code-review agent (Opus). Use for: the VERIFY step in a generator-verifier loop — after the',
477
+ 'Code-review agent (Sonnet). Use for: the VERIFY step in a generator-verifier loop — after the',
478
478
  'writer completes a change, the reviewer reads the diff, checks correctness, spec/requirement',
479
479
  'adherence, obvious bugs, and security issues, then tags each finding BLOCKER/MAJOR/MINOR/NIT',
480
480
  'and returns an ACCEPT or REJECT verdict with specific, actionable feedback. May write documentation files (.md etc.) only.',
481
481
  ].join(' '),
482
482
  tools: ['Read', 'Glob', 'Grep', 'Bash', 'Write', 'Edit'],
483
- model: 'opus',
483
+ model: 'sonnet',
484
484
  prompt: [
485
485
  'You are Osborn\'s reviewer agent. You are the VERIFY step in a generator-verifier loop.',
486
486
  '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.178",
3
+ "version": "0.9.180",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Regression tests for CLAUDE_AUTOCOMPACT_PCT_OVERRIDE in claude-llm.ts
3
+ *
4
+ * Scope: verifies that the compaction threshold is set to a value that
5
+ * leaves meaningful context headroom before compaction fires.
6
+ *
7
+ * Derived from: requirements documented in CLAUDE.md (ENABLE_1M_CONTEXT,
8
+ * compaction rationale comments in claude-llm.ts) and the 0.9.177 → 0.9.178
9
+ * change that lowered the threshold from 92 → 60.
10
+ * NOT derived from the implementation diff.
11
+ */
12
+
13
+ import { strict as assert } from 'node:assert'
14
+ import { readFileSync } from 'node:fs'
15
+ import { dirname, join } from 'node:path'
16
+ import { fileURLToPath } from 'node:url'
17
+
18
+ const here = dirname(fileURLToPath(import.meta.url))
19
+ const src = readFileSync(join(here, '../src/claude-llm.ts'), 'utf8')
20
+
21
+ let passed = 0
22
+ let failed = 0
23
+
24
+ function test(name: string, fn: () => void) {
25
+ try {
26
+ fn()
27
+ console.log(` ✅ ${name}`)
28
+ passed++
29
+ } catch (err: any) {
30
+ console.error(` ❌ ${name}`)
31
+ console.error(` ${err.message}`)
32
+ failed++
33
+ }
34
+ }
35
+
36
+ // Extract the numeric value of CLAUDE_AUTOCOMPACT_PCT_OVERRIDE from source
37
+ const match = src.match(/process\.env\.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE\s*=\s*'(\d+)'/)
38
+ const pctValue = match ? parseInt(match[1], 10) : NaN
39
+
40
+ console.log('\n=== autocompact PCT override regression tests ===\n')
41
+ console.log(` (detected value: CLAUDE_AUTOCOMPACT_PCT_OVERRIDE = '${pctValue}')`)
42
+ console.log()
43
+
44
+ test('CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is set in claude-llm.ts', () => {
45
+ assert.ok(
46
+ !isNaN(pctValue),
47
+ 'CLAUDE_AUTOCOMPACT_PCT_OVERRIDE must be explicitly set in claude-llm.ts'
48
+ )
49
+ })
50
+
51
+ test('CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is a valid percentage (1–99)', () => {
52
+ assert.ok(
53
+ pctValue >= 1 && pctValue <= 99,
54
+ `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE must be between 1 and 99, got ${pctValue}`
55
+ )
56
+ })
57
+
58
+ test('CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is ≤ 92 (prevents compaction at extreme tail)', () => {
59
+ // Values above 92 leave almost no headroom before hitting the token limit.
60
+ // The long-standing default was 92; anything higher than that risks the
61
+ // "compacting every message" bug described in memory/osborn-1m-context-and-worker-restart.md
62
+ assert.ok(
63
+ pctValue <= 92,
64
+ `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is ${pctValue} which is above 92 — ` +
65
+ 'values this high risk compaction firing on every message at the context ceiling'
66
+ )
67
+ })
68
+
69
+ test('ENABLE_1M_CONTEXT is also set in claude-llm.ts', () => {
70
+ assert.ok(
71
+ src.includes("process.env.ENABLE_1M_CONTEXT = '1'"),
72
+ "ENABLE_1M_CONTEXT = '1' must be set alongside CLAUDE_AUTOCOMPACT_PCT_OVERRIDE"
73
+ )
74
+ })
75
+
76
+ console.log(`\n--- ${passed + failed} tests: ${passed} passed, ${failed} failed ---\n`)
77
+ if (failed > 0) process.exit(1)