Commit Graph
6 Commits
Author SHA1 Message Date
22b1a193f1 feat: memory optimization to prevent OOM in multi-session scenarios (#1437)
- Add memory pressure monitor (RSS-based) with 4 levels: normal/elevated/high/critical
- Add memory compaction trigger that fires when pressure is elevated or critical
- Add per-session memory budget calculation (total budget / max concurrent sessions)
- Add concurrent session limiter using semaphore pattern
- Wire into QueryEngine auto-compact path with skipTokenCheck for forceReason
- Guard forceReason by querySource to prevent recursive deadlock
- Extract monitor startup into shared startMemoryMonitorIfNeeded() helper
- Call from both headless and interactive REPL paths (idempotent)

Co-authored-by: oyi77 <oyi77@users.noreply.github.com>
2026-06-03 19:33:01 +08:00
JATMNandGitHub cb666c85d0 Fix launcher heap setup for long sessions (#1242)
Relaunch the package executable before loading dist/cli.mjs so OpenClaude starts with an effective V8 heap cap instead of setting NODE_OPTIONS after the current process has already started.

The launcher now adds a default 8192 MB max-old-space-size and --expose-gc when they are missing, preserves flags supplied through process.execArgv or NODE_OPTIONS, and provides OPENCLAUDE_DISABLE_HEAP_RELAUNCH plus OPENCLAUDE_NODE_MAX_OLD_SPACE_SIZE_MB escape hatches.

Update the headless loop GC hook to use Node global.gc when the launcher exposed it, while preserving the existing Bun.gc path. Clarify the entrypoint NODE_OPTIONS comment so it reflects child-process propagation rather than current-process heap sizing.

Add scripts/openclaude-bin-heap.test.ts to guard launcher ordering and user override handling.

Validation: bun test scripts/openclaude-bin-heap.test.ts src/entrypoints/cli.test.ts; node bin/openclaude --version returned 0.13.0 (OpenClaude). Earlier full build passed after bun install --frozen-lockfile. bun run typecheck remains blocked by existing repo-wide type errors unrelated to this change.
2026-05-25 19:15:55 +08:00
Kevin CodexandGitHub 5ef79546e9 test: stabilize suite and add coverage heatmap (#373)
* test: stabilize suite and add coverage heatmap

* ci: run full bun test suite in pr checks
2026-04-05 12:44:54 +08:00
SenaxZzandGitHub 2ee43e010b Fix Windows ESM import by using file URL 2026-04-01 13:53:36 +02:00
Vasanthdev2004 4ce7dcf91e fix: support Windows launcher import paths 2026-04-01 12:43:14 +05:30
did:key:z6MkqDnb7Siv3Cwj7pGJq4T5EsUisECqR8KpnDLwcaZq5TPrandClaude Opus 4.6 3e652cafdf feat: add build system, stubs, and npm packaging — openclaude is now runnable
- package.json with all 70+ dependencies
- Bun build script with feature flag shims, native module stubs, otel externals
- Stubs for ~15 missing source files (snapshot gaps)
- tsconfig.json for TypeScript
- bin/openclaude entry point
- Builds to single 19MB dist/cli.mjs
- Verified: --version and --help work

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 02:36:07 +08:00