| docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides (#2151) * docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides - Add drift caveat to CodeRabbit findings: verify suggestions against PR intent before applying; decline out-of-scope with justification or ask a maintainer; never silently ignore findings - Add Keep Your Branch Current subsection (rebase duty, fix-churn warning) - Require full local CI-equivalent suite green before every push, with cross-platform exception - Add ignored/filler PR template submissions to close-without-review list - Expand follow-up guidance: multi-round review is normal, repeated fix requests signal root-cause investigation and better agent prompting - Mirror all of the above in AGENTS.md for coding agents * docs: address CodeRabbit findings on review-expectations guides - Make CONTRIBUTING.md Validation the single authoritative pre-push validation contract mirroring .github/workflows/pr-checks.yml exactly: --frozen-lockfile install, launcher compatibility checks, provider recommendation via npm as CI does, web job carve-out - Remove conflicting 'relevant subset' wording; cross-platform exception is the only carve-out from the full suite - AGENTS.md now defers to the CONTRIBUTING contract instead of defining a divergent core-checks list - Reword ambiguous 'submit the PR template ignored' bullet to 'submit a PR with the PR template ignored' * docs: align pre-push validation suite with CI semantics - Drop standalone 'bun run test:full'; bun run check already includes it - Document web workspace install (bun install --cwd web --frozen-lockfile) before web checks, matching the web CI job - Pass explicit --base/--head to security:pr-scan so local scans target the PR merge-base like CI does instead of script defaults * docs: use PR base commit ref for local security scan parity Replace git merge-base computation with origin/main and document the required invariant (fetch + keep branch rebased onto current origin/main) so the local scan matches CI's PR base.sha instead of diverging. * docs: use exact PR base for security scan * docs: make local validation contract portable * docs: scope local checks and baseline waivers * docs: harden contributor workflow guidance * docs: pin contributor safety contracts | 11 天前 |
| perf(cli): enable Node module compile cache (#2092) * perf(cli): enable Node module compile cache Warm CLI invocations spend substantial time compiling the bundled ESM entrypoint. Enable Node's optional on-disk compile cache only in the process that imports the bundle, while preserving early Node 22 compatibility and making cache failures non-fatal. Add deterministic launcher coverage, packaging checks, and a reproducible benchmark procedure so the startup benefit can be measured without flaky CI thresholds. * fix(ci): isolate minimum Node launcher check The full validation suite depends on knip and oxc-parser behavior unavailable in Node 22.0.0. Keep full CI on the active Node 22 line and exercise the declared runtime floor in a dedicated build-and-launch job. * fix(benchmark): harden startup measurements Keep environment setup outside the timed process window, document the API's Node 22.8 floor, and preserve completed benchmark results when git metadata is unavailable. * test(cli): verify compile cache disable behavior Pair NODE_DISABLE_COMPILE_CACHE with a temporary cache directory and assert that supported Node releases leave it empty while preserving normal launcher output. | 28 天前 |
| feat(providers): live model lists for OpenRouter and OpenGateway (#2084) * feat(providers): fetch live model lists for OpenRouter and OpenGateway Enable hybrid discovery so OpenGateway and OpenRouter load public GET /v1/models catalogs (with coding filters on OpenRouter), matching cairn-code and the Zero live-list fix. Refs #2083 * Address live model discovery review feedback. Remove hardcoded model allowlisting, deduplicate live MiMo routes, avoid duplicate startup probes, share mapping helpers, and strengthen provider documentation and tests.\n\nRefs #2083 * test(providers): Isolate OpenGateway picker discovery state. Prevent persisted live discovery cache entries from making the static catalog assertion nondeterministic. Refs #2083 * fix(test): restore OPENGATEWAY_API_KEY after discovery test The no-auth OpenGateway discovery test deletes OPENGATEWAY_API_KEY but originalEnv never snapshotted it and afterEach never restored it, so a worker starting with the credential set would run every later test in that worker without it. Snapshot and restore it like the other provider env vars. Refs #2084 * fix(integrations): preserve route shim maxTokensField for live-only discovered models * fix(test): drop unrelated permissions.test.ts optional-chaining tweak Not part of the OpenGateway/OpenRouter live discovery change; jatmn's review on #2084 flagged it as unrelated drift that should be dropped or split into its own PR. Refs #2084 * docs(integrations): Add JSDoc comments to model mapping helpers Add detailed JSDoc documentation for gateway model normalization, tooling and reasoning support detection, and core model mapping type guards and helpers across OpenGateway, OpenRouter, and modelMapping. Refs #2083 * fix(integrations): address review feedback on live discovery and proxy credentials Preserve caller credentials and custom headers for private route overrides, remove deep-research exclusion for text models, isolate test config directories, and align model picker assertions with upstream curated models. Refs #2083 Refs #2084 * test(integrations): test explicit openaiShim precedence and removeBodyFields merge Add unit test assertions verifying that explicit descriptor and catalog openaiShim configurations take precedence over inferred model settings and that removeBodyFields arrays merge correctly across layers. Refs #2083 Refs #2084 * Filter expired catalog entries at discovery boundary and revert permissions test hunk. Wrap static and merged route catalog model lists in filterAvailableCatalogEntries across all discoverModelsForRoute and refreshStartupDiscoveryForRoute return paths, preventing expired time-boxed catalog entries and live duplicates from resurfacing in model picker refresh, summary, or bootstrap additional options. Also restore permissions.test.ts to upstream/main without optional-chaining. Refs #2084 * Fix ModelCatalogEntry type import in model test suite. Import ModelCatalogEntry from descriptors.js rather than index.js to satisfy typecheck. Refs #2084 --------- Co-authored-by: euxaristia <euxaristia@users.noreply.github.com> | 11 天前 |
| feat: merge knowledge graph + conversation arc into memdir (#1811) * feat: merge knowledge graph + conversation arc into memdir Replace the standalone KG/ARC system (SQLite + JSON + Orama storage) with direct integration into the existing auto-memory directory. What changed: - New memdir/vectorIndex.ts — Orama full-text index over all memory/ .md files, replacing the separate knowledge.orama binary - New memdir/autoExtractFacts.ts — auto-detects env vars, paths, versions, URLs, IPs, backtick concepts from conversation and writes them as structured .md files into memory/.facts/ with frontmatter - conversationArc.ts now persists arc state (goals, decisions, milestones, phase) to memory/.arc.json sidecar instead of the KG - knowledgeGraph.ts gutted from 728→165 lines — now a thin compatibility layer that reads .facts/ files from memdir and delegates vector search to vectorIndex.ts - build.ts: enabled CONVERSATION_ARC and MULTI_TURN_CONTEXT feature flags (previously undefined → dead-code eliminated in production) Removed: - src/utils/storage/ (SQLiteProvider, JSONProvider, 3 test files) — unused after KG migration - src/utils/knowledgeGraph.test.ts, .stress.test.ts - src/utils/conversationArc.test.ts, .perf.test.ts - ~1700 lines of redundant storage code Benefits: - Single memory system (memdir) instead of two parallel systems - Auto-extracted facts are plain .md files — visible to the model, discoverable by the existing Sonnet prefetch - Vector search indexes real memory content, not a separate DB - Arc state survives across sessions via .arc.json - ~700 lines removed from the production bundle * fix: type errors, add test suites, fix resetArc() disk-write bug - Fix vectorIndex.ts: parseFrontmatter returns nested {frontmatter, content}, Orama DB typed as 'any' matching existing code pattern - Fix resetArc(): was overwriting .arc.json on disk — now clears only in-memory state - Add vectorIndex.test.ts (6 tests): build/search/persist/rebuild - Add autoExtractFacts.test.ts (10 tests): env vars, paths, versions, URLs, backtick concepts, PascalCase, React/Redux, file signatures, frontmatter - Add conversationArc.test.ts (14 tests): arc init, persistence, goals, decisions, milestones, phase detection, arc summary, finalize, stats - Update verify-kg-merge.sh: add test suite check (33 tests) * fix: remove generic type param from restore() call * fix: address CodeRabbit findings — YAML injection, secrets leak, cache invalidation, frontmatter parsing, test weakness * fix: redact URL credentials/query/hash in endpoint extraction; add persistence + reindex regression test * test: add regression for URL credential/query/hash redaction in fact extraction * feat: wire getOrchestratedMemory into query.ts prompt; remove dead promises array in autoExtractFacts * feat: enhance memory management by adding clearArcArtifacts function and integrating it into the clear command; implement file count tracking in vector index * feat: enhance fact extraction by adding tests for absolute paths, backtick concepts, technical terms, project file signatures, and IP addresses; implement clearArcArtifacts function in tests * Review-fix: scoped IP tagging, scrubbedContent, arcMemoryDir null, vector-index cleanup * Review-fix: isAutoMemoryEnabled gate, scrubbed paths, clearIndex in cleanup * Review-fix: URL-stripped path scan, digit-key/quoted-value env redaction, rm isAutoMemory gate * Review-fix: quoted multi-token env values fully redacted, regression test * Review-fix: freshness check on each search, integration test, typecheck in verifier * Review-fix: missing-index-file reinit, full-pipeline integration test * Review-fix: gate arc/RAG on isAutoMemoryEnabled, add integration+stale-index tests Addresses three P1/P2 findings from code review: 1. P1: Honor auto-memory opt-out before writing arc facts - Add isAutoMemoryEnabled() checks in query.ts before calling updateArcPhase() and getOrchestratedMemory() - Add same check inside conversationArc.ts extractFactsAutomatically() - Prevents .facts file writes when auto-memory disabled via --bare, CLAUDE_CODE_DISABLE_AUTO_MEMORY=1, or memory.autoWrite: false 2. P2: Add query-level integration test coverage - New test in conversationArc.test.ts verifies query.ts path - Confirms arc functions called behind feature gates and results appended to system prompt (lines 555-575) 3. P2: Add stale-index regression tests - 6 new tests in vectorIndex.test.ts cover: * Searching after adding files * Searching after editing files * Searching after removing files * Searching when .vector-index missing * Searching when .vector-index-meta.json missing * Mixed stale conditions All tests pass (31 total, 99 assertions), typecheck clean. * Review-fix: use >= for mtime staleness check to catch same-ms edits The verification agent discovered a timing-dependent bug in the stale index detection. When a file edit and index save occur within the same millisecond, latestMtime equals indexMtime, causing the check `latestMtime > indexMtime` to return false. The stale index is not refreshed and searches miss the updated content. Changed line 220 from `>` to `>=` in the mtime comparison. The file count check catches add/remove operations, but edits that don't change the file count rely on mtime comparison. All 12 vector index tests now pass consistently, including the "searching after editing a file picks up changes" test that previously failed intermittently. * Review-fix: move auto-memory gate to persistence layer Addresses inline review comment: query.ts was incorrectly skipping updateArcPhase() entirely when isAutoMemoryEnabled() returned false, leaving the in-memory arc state stale. Fixed by: - Removed isAutoMemoryEnabled() gate from query.ts line 449 - Added gate inside conversationArc.ts updateArcPhase() at persistence layer (line 223), so phase advances but only persistence is disabled - Arc state tracking now works regardless of auto-memory setting - Only disk writes (.arc.json, .facts files, index rebuilds) are gated The 2ms delay in vectorIndex.test.ts is kept as a pragmatic fix for the timing race. Content-hash detection would be ideal but adds complexity; the mtime check works reliably in production. All 31 tests pass, typecheck clean. * Refactor memory handling: consolidate metadata retrieval and improve auto-memory checks * Fix: update expectation to use toEqual for prompt comparison in conversationArc tests * fix: detect same-size content changes via content hash; handle text-block user messages in arc query * fix: skip symlinked dirs in vector index walk; enable arc/multi-turn flags; add production-path tests * fix: follow symlinked dirs in vector index walk per review * fix: skip symlinked dirs in vector index walk; add symlink-boundary regression tests * fix: skip indexing symlinked directories and ensure only files are processed * fix: show cmd output on failure in verifier; add multi-turn coverage; clear mempath cache; cover arc reset in knowledge clear test * fix: clear memoized auto-mem path after teardown in knowledge + conversationArc tests * fix: isolate vector index per memdir, filter secrets from backtick facts, clean trailing ws * fix: extend credential filter for AWS/GitLab tokens; reject all symlinks in vector index * fix: use repo's redactSecretSubstringsForDisplay; add npm/glpat/AKIA/ASIA/xox to shared patterns; cover NPM+JWT in tests * fix: P1 backtick credential safety + untrusted-data boundary; P2 legacy migration + non-fatal writes; P3 type safety + build regression * fix: B1-B5, M6, M8 — no message mutation, migration data loss, empty-file, non-fatal writes, probe, rebuildIndex resilience, dead import * fix: address 8 reviewer findings (R1-R8) P1: - Keep retrieved facts in DATA ONLY block with strict system instruction - Catch lowercase config secrets (api_key=...) in env scrubber - Migrate SQLite working store (knowledge.db) before deleting provider - /knowledge clear atomically archives legacy sources P2: - Run legacy migration on getOrchestratedMemory retrieval path - Preserve entity attributes in migration frontmatter - Only rebuild vector index when facts actually changed - Fix feature-flag verifier --define syntax (declare const) * fix: close 9 memory findings — approval gate, non-fatal writes, secret scrub, per-project migration, attribute/relation preservation, WAL cleanup, cheaper index - Gate auto fact extraction on isMemoryWriteApprovalRequired() + isAutoMemoryEnabled() so default projects cannot silently persist conversation content - Make ensureFactsDir/writeFactMemory degrade non-fatally (no turn-breaking throw on read-only dirs) - Scrub token-like URL/path/hyphenated segments from durable facts via looksLikeSecret (reuses providerSecrets.looksLikeSecretValue) - Restore passive project-rule extraction as rule facts - Honor isAutoMemoryEnabled() before legacy migration; scope the migration guard per project (Set) instead of a single global - Preserve legacy entity attributes and relations through migration (indented attributes + relation fact file, reconstructed in getGlobalGraph) - Clear SQLite WAL/SHM sidecars on /knowledge clear - Replace per-turn content hashing in vectorIndex getMdStats with size+mtime metadata; drop redundant initMemdirIndex call in getOrchestratedMemory - Add knowledgeGraph tests covering P1#2/P1#4/P2#5/P2#8 and extend autoExtractFacts tests * test: avoid global cwd pollution in knowledgeGraph tests Replace process.chdir with a per-test setFsImplementation mock cwd that is reset via setOriginalFsImplementation in afterEach, so the test no longer leaks a changed process.cwd() into other test files. Assert the auto-memory gate via the project-specific legacy file rather than the shared resolved memdir dir (which bun runs concurrently across it blocks). * fix: address 15 reviewer findings (R1-R15) P1: - Gate saveArcToDisk/finalizeArcTurn/saveIndex/migration on memory-write approval - Retire legacy sources after successful migration (rmSync, backup preserved) - Slugify entity.type and summary.id in migration filenames (path traversal) - Fall back to JSON when SQLite has zero entities - Scrub rule-fact extraction on scrubbedContent + looksLikeSecret/redact check P2: - Track skipped vs completed migration; re-enable clears skip marker - Walk back to latest human text for tool-round vector queries - Auto-extract goals/decisions from user messages in updateArcPhase - /knowledge clear message says durable wipe, not session-only - Bind arc state to projectKey (re-resolve on cwd change) - clearIndex(memoryDir?) scopes to one memdir - yamlQuote all migration frontmatter fields - Real SHA-256 contentHash alongside fileFingerprint for same-size edits - Stop claiming production-pipeline coverage in tests/verifier * test: isolate governance mock by removing afterEach clear Remove setGovernancePolicySettingsForSourceForTesting(null) from afterEach in autoExtractFacts, conversationArc, and knowledgeGraph test files. The module-level mock is set in each file's beforeEach and since there is no afterEach cleardown, parallel test execution can no longer corrupt the mock state across files. This fixes 26 CI test failures caused by one file's afterEach clearing the mock that another concurrently-running file had set in its beforeEach. * fix: isolate governance mock per async context via executionAsyncId tracking Replace the module-level variable in governancePolicy.ts with an executionAsyncId-keyed Map and an async_hooks.createHook that propagates the override from parent to child async resources. This ensures each concurrent test's beforeEach/afterEach cannot corrupt the override set by another test file, even when test bodies directly mutate the mock. Also restore setGovernancePolicySettingsForSourceForTesting(null) calls in afterEach hooks (removed in 39c68376), which are now safe because each afterEach only clears its own async context. Fixes 26 CI test failures across knowledgeGraph (2), conversationArc (7), and autoExtractFacts (17/22, governance-gate tests). * Refactor knowledge graph legacy migration, secure secrets and IP octets, optimize build-time feature flags, cap conversation arc collections, and resolve all verification check gaps * Fix governancePolicy enablement in full test runs by checking for test runner globals * fix: ensure auto memory is enabled in conversationArc, knowledgeGraph, autoExtractFacts tests Delete CLAUDE_CODE_DISABLE_AUTO_MEMORY and CLAUDE_CODE_SIMPLE env vars in beforeEach hooks so tests are not blocked when CI sets these vars. Also revert governancePolicy.ts to the simple module-level variable (removing the async ID tracking approach that broke with Bun v1.3.13). Fixes 33 CI test failures where isAutoMemoryEnabled() returned false causing all disk-persistence guards to fire. * fix: address P1/P2 review findings — redaction, bounds, legacy backup [P1] Redact goal/decision descriptions with redactLikelySecrets before persisting to .arc.json, session summaries, and prompt summaries so credentials captured by auto-extraction regexes are not durably stored. [P1] Bound multi-turn tool input serialization to 2000 chars and apply redactLikelySecrets, preventing oversized/credential-bearing tool inputs from overflowing the next provider request or exposing secrets. [P2] Archive the non-selected legacy store (JSON or SQLite) and its WAL sidecars before retiring both sources, ensuring a recoverable snapshot exists if generated fact files are incomplete or a migration bug surfaces. * fix: address P1 findings — safe legacy retirement, multi-turn aggregate budget [P1] Do not retire a legacy store unless every existing source was successfully archived. Track archived sources in a Set and skip deletion of any source whose backup failed (knowledgeGraph.ts). [P1] Archive the selected SQLite WAL/SHM sidecars alongside its migration backup, since committed state may reside only in the WAL file and the advertised recovery backup would otherwise be incomplete (knowledgeGraph.ts). [P1] Bound the aggregate multi-turn tool replay to 10KB total and stop appending further turns once the budget is exceeded, preventing many Agent/MCP calls per turn from adding unbounded text to system prompts (conversationArc.ts). * fix: address P1/P2 review findings — rule extraction gate, SQLite read status, atomic WAL/SHAM, KG status gate, byte budgets * fix: tighten looksLikeOpaqueToken to avoid flagging compound model names * fix: address P1/P2 review findings — rebase, test isolation, SQLite retry, attribute redaction, entity aliases, body content, project-scoped multiturn, skip unchanged writes, knowledge list gate * fix: address P1/P2/P3 review findings — secret scrub on migrate, lean decision gate, git-root legacy lookup, backup retention, index rebuild chaining, single vector search, drop unreferenced fixture * fix: scrub secret entity names on migrate, exclude summary facts from entities, reset multi-turn on /knowledge clear * fix: address P1 review findings for legacy graph redaction, recovery-safe clear, stable change guards - Redact embedded secrets in migrated legacy knowledge-graph entities, summaries, and rules via shared sanitizeLegacyText() policy - Preserve legacy artifacts (json/db/wal/shm) as migration-backup before /knowledge clear; resetGlobalGraph returns { archived, failures } - Skip rewrite + index rebuild on unchanged turns by stripping the volatile detectedAt timestamp (facts and arc session summaries) - Always recompute the authoritative content hash in getMdStats so edits of equal size with preserved mtime are detected and served correctly * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: redact protocol-relative URL userinfo in legacy migration new URL() throws for scheme-less URLs, so the catch branch now redacts obvious //user:pass@host userinfo instead of persisting credentials. * fix(memory): harden memdir migration and retrieval --------- Co-authored-by: Gravirei <gravirei@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Kevin Codex <kevin@gitlawb.com> | 16 天前 |
| test(settings): unit-test the multi-source merge customizer (#2176) * test(settings): unit-test the multi-source merge customizer settingsMergeCustomizer is exported for testing but had no direct coverage, despite being the seam that combines policy, user, and project settings. Cover the documented behaviour: permission arrays concatenate with deduplication under target priority, modelPricing entries replace atomically per model id on a null-prototype map (including Object.prototype-named ids), and all other keys defer to lodash's default deep merge. * test(settings): assert the merged modelPricing map is null-prototype The previous assertion checked a fresh unrelated object, which would pass even if the customizer returned a plain object carrying the keys. Assert Object.getPrototypeOf on the merged map itself. | 4 天前 |
| diagnostics(query): trace interruption causality (#2111) * diagnostics(issue-1830): trace interruption causality * test(issue-1830): lock interruption ownership matrix * fix(codex): preserve stream deadline contract * fix(diagnostics): harden interruption trace lifecycle Refs #1830 * fix(diagnostics): harden interruption trace settlement Refs #1830 * fix(diagnostics): preserve interruption causality * fix(diagnostics): address interruption trace review * fix(diagnostics): preserve tracing observer contracts * fix(diagnostics): preserve interruption trace contracts * test(permissions): cover interactive hook interrupts | 19 天前 |
| chore(deps): clean npm install — fix CVEs, silence warnings (#1782) * chore(deps): clean npm install — fix CVEs, silence warnings - bump undici 7.24.6 → 7.28.0 (7 high CVEs: TLS bypass, header injection, DoS, cache poisoning, SameSite downgrade, cross-origin routing) - bump ws 8.20.0 → 8.21.0 (2 high CVEs: uninitialized memory disclosure, memory exhaustion DoS) - add allowScripts for sharp + protobufjs to silence install-script warnings - vendor node-domexception shim (re-exports native DOMException) and override the deprecated polyfill pulled transitively by google-auth-library → gaxios → node-fetch@3 → fetch-blob Result: `npm install` reports 0 vulnerabilities, 0 warnings. Co-Authored-By: OpenClaude <openclaude@gitlawb.com> * chore(deps): update bun.lock for undici/ws bumps and node-domexception override CI runs `bun install --frozen-lockfile`, which requires bun.lock to match package.json. The previous commit bumped undici/ws and added the node-domexception shim override but didn't include the regenerated lockfile, causing frozen-lockfile CI to fail. Co-Authored-By: OpenClaude <openclaude@gitlawb.com> * fix(publish): include vendor/node-domexception-shim in npm tarball The file: override in package.json points at vendor/node-domexception-shim, but the files array didn't list vendor/, so npm pack excluded it. End-user npm installs would fail resolving the override. Add vendor/node-domexception-shim/ to the files array. Verified via npm pack --dry-run: tarball now contains both shim files (12 → 14 files). Addresses reviewer finding #1. Co-Authored-By: OpenClaude <openclaude@gitlawb.com> --------- Co-authored-by: OpenClaude <openclaude@gitlawb.com> | 2 个月前 |
| Add Azure / Foundry launch support to VS Code extension (#1365) * Enhance OpenClaude VS Code extension with Microsoft Foundry / Azure OpenAI support. Added configuration options for Azure API key, endpoint, and deployment settings. Updated README and documentation for new features, including a setup wizard for Azure integration. Improved terminal launch environment handling for Azure compatibility. * Fix packaged Windows helper runtime references * Use installed CLI from Windows helper aliases * Scope Windows helper env overrides to invocation * Align Windows alias docs with shipped helper | 2 个月前 |
| feat(providers): add focused LLMTR hybrid gateway (#2150) * feat: add LLMTR hybrid gateway * feat: support LLMTR_API_KEY * fix: allow LLMTR provider env files * fix: protect LLMTR credential routing * fix: protect LLMTR profile credentials * fix: complete LLMTR env lifecycle * fix: select LLMTR model before client setup * fix: address LLMTR review findings * fix: route LLMTR auxiliary models correctly * fix: complete LLMTR credential boundaries * fix: clear persisted LLMTR startup keys * fix: normalize LLMTR generic credentials * fix: scope LLMTR credential support * fix: align LLMTR credential boundaries * fix: close LLMTR credential boundaries * fix: clear stale LLMTR auth state * fix: clear persisted LLMTR credentials * fix: complete LLMTR setup contracts * fix: close LLMTR lifecycle gaps * fix(providers): close LLMTR credential boundaries * fix(providers): preserve saved LLMTR profile keys | 11 天前 |
| chore: centralize Bun version and refresh CI tool pins (#1171) * chore: centralize Bun version and refresh CI tool pins - add .bun-version as the shared Bun source of truth for workflows and Docker builds - update PR and release workflows to read Bun from bun-version-file - refresh pinned GitHub Actions and Docker action SHAs to newer low-risk releases - align contributor docs with Bun 1.3.13 guidance * test: stabilize reset and provider profile persistence Harden knowledge graph reset behavior across Windows file-lock scenarios by improving SQLite and JSON reset signaling, preserving a safe JSON source of truth when SQLite cannot be cleared, and adding direct storage regression coverage. Also centralize deterministic config-home handling for tests, tighten provider profile persistence path resolution and cleanup semantics, isolate environment-sensitive suites with the env mutex, and remove flaky external npx dependency from the SDK consumer type test. * test: fix Codex OAuth callback flake Investigate the real provider smoke failure from GitHub Actions and fix the root cause instead of patching the symptom. - make Codex OAuth callback host explicit and consistent across redirect URI generation and listener binding - allow safe loopback host overrides for localhost, 127.0.0.1, and ::1 - harden Codex OAuth tests with env/fetch isolation so they do not poison neighboring provider suites - pin the OAuth callback tests to 127.0.0.1 to avoid localhost IPv4/IPv6 family mismatch flakes in CI Validated with bun test src/services/api/codexOAuth.test.ts, bun test src/services/api/providerConfig.codexSecureStorage.test.ts, and bun run test:provider. * test: harden Codex OAuth callback tests Investigate the recurring provider-smoke OAuth failures across multiple PR runs and fix the flaky callback test design at the root. - remove the free-port reservation race from Codex OAuth tests - add bounded callback retry only for loopback listener warm-up during the in-process OAuth test flow - move ephemeral callback port support into an explicit CodexOAuthService test seam instead of widening production env parsing - keep runtime callback-port semantics unchanged while adding regression coverage for callback host and port parsing Validated with targeted Codex OAuth tests and repeated provider-bucket reruns to check for recurring flake. * test: serialize provider shared-state suites Fix the recurring provider smoke flake at the root cause by serializing test suites that mutate process.env or globalThis.fetch. Add a shared test mutation lock and wire it into the provider bucket so Codex OAuth no longer races with unrelated provider/config/openai shim tests under Bun's parallel test execution. Cleanup now releases the lock in finally blocks, and the shared lock waits indefinitely by default to avoid timeout-based CI flakes. * test: fix smoke root causes and noisy suites Replace the Codex OAuth test's live loopback listener dependency with an injected listener seam, avoid module-mock leakage across provider suites, and clean up the auth-code listener test setup. Also harden noisy storage and search tests by asserting expected log output, isolating SQLite masterpiece persistence per test cwd, and removing routine benchmark/stress logging from passing runs. * build: harden Bun version install in Docker Validate the repo-tracked .bun-version value before using it in the Docker build stage, strip line endings, and install Bun through a quoted semver-only variable instead of raw shell expansion. * test: replace flaky conversation arc benchmark Fix the recurring smoke failure caused by an absolute wall-clock assertion in the normal unit suite. Replace the CI-speed-sensitive conversation arc benchmark with deterministic regression coverage that verifies repeated fact extraction, expected entity shapes, bounded graph growth, and populated-summary behavior. * test: isolate shared-state smoke suites * test: restore codex credential mocks between suites * test: fix shared-state and provider init-order flakes * test: isolate remaining shared-state smoke suites Serialize the remaining smoke-sensitive suites that mutate process env, CLAUDE_CONFIG_DIR, fetch, or SDK session globals. Add shared lock coverage to discovery, agent/skills loading, platform storage, and SDK lifecycle/preserved-segment tests. Restore session and cwd state inside the lock boundary so parallel files cannot leak bootstrap state into knowledge graph and SDK isolation tests. Validated with repeated smoke and full-suite passes: - bun run smoke (2x) - bun test - bun test --max-concurrency=1 - bun run test:provider - python -m pytest -q python/tests - npm run test:provider-recommendation | 3 个月前 |
| chore: configure CodeRabbit reviews (#1502) Co-authored-by: OpenClaude Worker 3 <worker-3@openclaude.local> | 3 个月前 |
| Feat/web landing refresh (#958) * feat(web): openclaude landing — runs anywhere, uses anything A new marketing site for openclaude under web/, plus the minimal root infrastructure to build, ignore, and gate it without affecting the published npm package. Landing page (web/) - Vite + React 19 with monospace gitlawb typography (sf mono / fira code). - Hero: pill, two-line wordmark "runs anywhere. / uses anything.", copy-to-clipboard install command, github cta. - Six feature rows in hermes-style "title — sentence" format on hairline dividers (any model, real tools, profiles per repo, streaming, gateway routing, editor + server modes). - Install block: same copyable command + three numbered steps. - One-line footer with brand, version, gitlawb link, and license. - Light theme is the default with a no-flash bootstrap script and a ☀ / ☾ toggle persisted to localStorage. - New orange terminal-face logo at 36px in the nav. - Body wash: dual orange radial gradients for warmth on both themes. Root infra - web/ excluded from npm publish via .npmignore (belt-and-suspenders alongside the existing files whitelist). - web/ excluded from docker context (.dockerignore). - web:dev / web:build / web:preview / web:typecheck scripts in package.json that delegate via --cwd web (no root deps added). - web typecheck + build added to the pr-checks workflow. - web/dist/ and web/*.tsbuildinfo ignored. Co-Authored-By: OpenClaude <openclaude@gitlawb.com> * added vercel in .gitignore --------- Co-authored-by: OpenClaude <openclaude@gitlawb.com> | 4 个月前 |
| feat(providers): add focused LLMTR hybrid gateway (#2150) * feat: add LLMTR hybrid gateway * feat: support LLMTR_API_KEY * fix: allow LLMTR provider env files * fix: protect LLMTR credential routing * fix: protect LLMTR profile credentials * fix: complete LLMTR env lifecycle * fix: select LLMTR model before client setup * fix: address LLMTR review findings * fix: route LLMTR auxiliary models correctly * fix: complete LLMTR credential boundaries * fix: clear persisted LLMTR startup keys * fix: normalize LLMTR generic credentials * fix: scope LLMTR credential support * fix: align LLMTR credential boundaries * fix: close LLMTR credential boundaries * fix: clear stale LLMTR auth state * fix: clear persisted LLMTR credentials * fix: complete LLMTR setup contracts * fix: close LLMTR lifecycle gaps * fix(providers): close LLMTR credential boundaries * fix(providers): preserve saved LLMTR profile keys | 11 天前 |
| feat: add repo map codebase intelligence (#1867) * feat: add Codebase Intelligence — repo map with PageRank-ranked structural summaries Adds a new module that builds a structural map of the repository by parsing source files with tree-sitter, building a cross-file reference graph weighted by IDF, ranking files with PageRank, and rendering a token-budgeted summary of the most important files and their signatures. Surface: - RepoMap tool the model can call on-demand, with focus_files / focus_symbols - /repomap slash command with --tokens, --focus, --stats, --invalidate - Auto-injection into session system context, gated by REPO_MAP=1 env var (compile-time feature('REPO_MAP') flag stays off in scripts/build.ts) How it works: git ls-files → tree-sitter WASM parse → extract defs/refs → IDF-weighted directed graph → PageRank → render top files until token budget Files imported by many others rank highest. Common symbol names (get, set, map, value) are down-weighted via IDF. Results cached to disk keyed by (path, mtime, size) — only changed files are re-parsed. Supported languages: TypeScript, JavaScript, Python. Tree-sitter tag queries are inlined as string constants in queries.ts so they ship inside dist/cli.mjs and work after npm install — the .scm source files are kept for readability/Aider attribution but are not required at runtime. A drift-guard test (queries.test.ts) asserts byte-equality between the inlined strings and the .scm source files. Dependencies added: web-tree-sitter, tree-sitter-wasms, graphology, graphology-pagerank, graphology-operators, js-tiktoken. * fix(repomap): invalidate rendered cache on file edits + Windows test fix - computeMapHash now folds per-file mtime+size into the cache key so a source edit (without changing the file list) no longer returns the prior rendered map. Adds a regression test that edits a file and confirms the second build reflects the new symbol without manual invalidateCache(). - queries.test.ts byte-for-byte drift guard normalizes CRLF -> LF when reading the .scm source so Windows checkouts pass. .gitattributes also pins *.scm to LF on future checkouts. - Externals: declare web-tree-sitter, tree-sitter-wasms, graphology*, and js-tiktoken in scripts/externals.ts so build validation passes. * fix(repomap): expand directory focus paths * fix(repomap): satisfy deadcode check * Fix repo map review findings * Resolve remaining repo map review findings * fix(repomap): address review findings * fix(repomap): address review findings * fix(repomap): resolve smoke and review follow-ups * fix(repomap): preserve cached tag order * fix(repomap): resolve review follow-ups * fix(repomap): satisfy query promise lint * Fix repo map context timeout cleanup * fix: address repo map review findings * fix: cancel timed-out repo map context builds * fix(repomap): preserve git file path whitespace * fix(repomap): handle graph and parsing edge cases * fix(repomap): preserve shell token positions * fix(repomap): respect configured cache home * fix(repomap): address review findings - Add explicit 10000ms timeout to the feature-flag-off context test to avoid cold-import flakes. - Add --focus-symbols flag to /repomap and forward it to buildRepoMap, matching the RepoMap tool. - Add parsing/command tests and docs coverage for --focus-symbols. --------- Co-authored-by: gnanam1990 <gnanasekaran.sekareee@gmail.com> | 1 个月前 |
| fix(atlas-cloud): sync static catalog with live /models metadata (#1754) - Enrich every entry with maxOutputTokens (from max_output_length) and capabilities (function calling, json mode, vision, reasoning) pulled from the live catalog. Addresses discoveryService metadata gap. - Add transportOverrides.openaiShim.removeBodyFields for xai/grok-build-0.1 to drop reasoning_effort (fixes 400 on Atlas Cloud). - Curate current model set: - Add: Kimi K2.7 Code, GLM 5.2, Qwen3.7 Max/Plus, Doubao Seed 2.0 variants, Claude Sonnet 4.6 / Haiku 4.5 (base + coding), latest GPT/Gemini/Grok. - Drop: K2 Thinking/Instruct 0905, older MiniMax M2.1/M2, duplicate Qwen. - Keep source: 'static' only. Entries sorted in descending version order within each vendor family. - Preserve notes: 'Free' on the owl model. .gitignore: ignore .tmp-* directories (test artifacts such as replay-index tests). Follows static-over-hybrid, catalog-model-ordering, and grok-build-0.1 notes. | 2 个月前 |
| feat: add Vietnamese i18n for slash command descriptions (#1431) * feat: add Vietnamese i18n support for slash command descriptions Add a simple i18n helper that reads the `language` setting from config to display localized skill descriptions. Currently supports English (default) and Vietnamese. To switch to Vietnamese, set in ~/.claude/settings.json: { "language": "vietnamese" } Co-Authored-By: OpenClaude (mimo-v2.5-pro) <openclaude@gitlawb.com> * feat(i18n): add Vietnamese translations for all 85 command descriptions - Fix detectLocale() to read ~/.claude/settings.json directly via readFileSync instead of broken require('../../utils/config.js') - Add commandDescVi translation map with 85 Vietnamese descriptions - Export translateCommandDescription() for use in command rendering - Modify formatDescriptionWithSource() to translate descriptions when language is set to "vietnamese" - Bump version to 0.15.1 * fix: add prepare script for git-based installs When installing via `npm install -g git+https://...`, npm runs the `prepare` script automatically. This ensures the CLI is built from source during installation. Requires Bun to be installed globally. Co-Authored-By: OpenClaude (mimo-v2.5-pro) <openclaude@gitlawb.com> * fix(i18n): read locale from merged settings * feat(i18n): translate all prompt-type commands + add env validation + node version files ## Changes ### 1. Fix prompt-type command translations (src/commands.ts) - `formatDescriptionWithSource()` now calls `translateCommandDescription()` for ALL command types - Previously only translated `builtin`/`mcp` source commands - Now translates: workflow, plugin, bundled, and default cases - Fixes: /review, /insights, and other prompt-type commands now display Vietnamese ### 2. Add missing Vietnamese translations (src/skills/bundled/i18n.ts) Added 17 new command translations: - /btw: "Đặt câu hỏi nhanh bên lề mà không làm gián đoạn cuộc hội thoại chính" - /compact: "Xóa lịch sử hội thoại nhưng giữ tóm tắt trong ngữ cảnh" - /auto-fix: "Cấu hình tự động sửa: chạy lint/test sau khi AI chỉnh sửa" - /bridge-kick: "Chèn trạng thái lỗi bridge để kiểm thử khôi phục thủ công" - /review: "Hoàn thành đánh giá bảo mật cho các thay đổi đang chờ trên nhánh hiện tại" - +12 more commands ### 3. Add Zod env validation at startup (src/utils/envValidation.ts) - New file: validates critical env vars using Zod at startup - Crashes immediately if invalid (instead of wasting time) - Validated vars: ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CLAUDE_CONFIG_DIR, HTTP_PROXY, HTTPS_PROXY, NODE_EXTRA_CA_CERTS - Integrated into src/entrypoints/init.ts ### 4. Add node version files - .nvmrc: Node 22 - .node-version: Node 22 - Matches Dockerfile (node:22-slim) and package.json engines (>=22.0.0) ## Test Results - 3007 pass, 11 fail (all in changeDetector.test.ts - pre-existing, unrelated to i18n) Co-Authored-By: OpenClaude <noreply@openclaude.ai> * fix: restore validateBoundedIntEnvVar in envValidation.ts * Localize bundled skills descriptions at read time * fix(i18n): localize slash command suggestions Search rendered localized command descriptions and rebuild the Fuse index when language-sensitive text changes. Preserve Unicode letters and numbers for Vietnamese slash queries, localize the remaining requested command descriptions, and keep exact slash command submission from following a stale highlighted suggestion. Tests: bun test src/commands.test.ts; bun test src/utils/suggestions/commandSuggestions.test.ts; bun test src/utils/envValidation.test.ts Thanks to @jatmn for the patient review and guidance. * fix(i18n): tighten slash command localization scope * fix(i18n): centralize localization and preserve external metadata * fix(commands): scope localized descriptions to OpenClaude-owned commands * fix(i18n): read session language before initial settings * fix(i18n): prefer whenToUse localization keys --------- Co-authored-by: OpenClaude (mimo-v2.5-pro) <openclaude@gitlawb.com> Co-authored-by: OpenClaude <noreply@openclaude.ai> Co-authored-by: lht3003-rgb <lht3003-rgb@users.noreply.github.com> | 2 个月前 |
| Feat/web landing refresh (#958) * feat(web): openclaude landing — runs anywhere, uses anything A new marketing site for openclaude under web/, plus the minimal root infrastructure to build, ignore, and gate it without affecting the published npm package. Landing page (web/) - Vite + React 19 with monospace gitlawb typography (sf mono / fira code). - Hero: pill, two-line wordmark "runs anywhere. / uses anything.", copy-to-clipboard install command, github cta. - Six feature rows in hermes-style "title — sentence" format on hairline dividers (any model, real tools, profiles per repo, streaming, gateway routing, editor + server modes). - Install block: same copyable command + three numbered steps. - One-line footer with brand, version, gitlawb link, and license. - Light theme is the default with a no-flash bootstrap script and a ☀ / ☾ toggle persisted to localStorage. - New orange terminal-face logo at 36px in the nav. - Body wash: dual orange radial gradients for warmth on both themes. Root infra - web/ excluded from npm publish via .npmignore (belt-and-suspenders alongside the existing files whitelist). - web/ excluded from docker context (.dockerignore). - web:dev / web:build / web:preview / web:typecheck scripts in package.json that delegate via --cwd web (no root deps added). - web typecheck + build added to the pr-checks workflow. - web/dist/ and web/*.tsbuildinfo ignored. Co-Authored-By: OpenClaude <openclaude@gitlawb.com> * added vercel in .gitignore --------- Co-authored-by: OpenClaude <openclaude@gitlawb.com> | 4 个月前 |
| feat: add Vietnamese i18n for slash command descriptions (#1431) * feat: add Vietnamese i18n support for slash command descriptions Add a simple i18n helper that reads the `language` setting from config to display localized skill descriptions. Currently supports English (default) and Vietnamese. To switch to Vietnamese, set in ~/.claude/settings.json: { "language": "vietnamese" } Co-Authored-By: OpenClaude (mimo-v2.5-pro) <openclaude@gitlawb.com> * feat(i18n): add Vietnamese translations for all 85 command descriptions - Fix detectLocale() to read ~/.claude/settings.json directly via readFileSync instead of broken require('../../utils/config.js') - Add commandDescVi translation map with 85 Vietnamese descriptions - Export translateCommandDescription() for use in command rendering - Modify formatDescriptionWithSource() to translate descriptions when language is set to "vietnamese" - Bump version to 0.15.1 * fix: add prepare script for git-based installs When installing via `npm install -g git+https://...`, npm runs the `prepare` script automatically. This ensures the CLI is built from source during installation. Requires Bun to be installed globally. Co-Authored-By: OpenClaude (mimo-v2.5-pro) <openclaude@gitlawb.com> * fix(i18n): read locale from merged settings * feat(i18n): translate all prompt-type commands + add env validation + node version files ## Changes ### 1. Fix prompt-type command translations (src/commands.ts) - `formatDescriptionWithSource()` now calls `translateCommandDescription()` for ALL command types - Previously only translated `builtin`/`mcp` source commands - Now translates: workflow, plugin, bundled, and default cases - Fixes: /review, /insights, and other prompt-type commands now display Vietnamese ### 2. Add missing Vietnamese translations (src/skills/bundled/i18n.ts) Added 17 new command translations: - /btw: "Đặt câu hỏi nhanh bên lề mà không làm gián đoạn cuộc hội thoại chính" - /compact: "Xóa lịch sử hội thoại nhưng giữ tóm tắt trong ngữ cảnh" - /auto-fix: "Cấu hình tự động sửa: chạy lint/test sau khi AI chỉnh sửa" - /bridge-kick: "Chèn trạng thái lỗi bridge để kiểm thử khôi phục thủ công" - /review: "Hoàn thành đánh giá bảo mật cho các thay đổi đang chờ trên nhánh hiện tại" - +12 more commands ### 3. Add Zod env validation at startup (src/utils/envValidation.ts) - New file: validates critical env vars using Zod at startup - Crashes immediately if invalid (instead of wasting time) - Validated vars: ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CLAUDE_CONFIG_DIR, HTTP_PROXY, HTTPS_PROXY, NODE_EXTRA_CA_CERTS - Integrated into src/entrypoints/init.ts ### 4. Add node version files - .nvmrc: Node 22 - .node-version: Node 22 - Matches Dockerfile (node:22-slim) and package.json engines (>=22.0.0) ## Test Results - 3007 pass, 11 fail (all in changeDetector.test.ts - pre-existing, unrelated to i18n) Co-Authored-By: OpenClaude <noreply@openclaude.ai> * fix: restore validateBoundedIntEnvVar in envValidation.ts * Localize bundled skills descriptions at read time * fix(i18n): localize slash command suggestions Search rendered localized command descriptions and rebuild the Fuse index when language-sensitive text changes. Preserve Unicode letters and numbers for Vietnamese slash queries, localize the remaining requested command descriptions, and keep exact slash command submission from following a stale highlighted suggestion. Tests: bun test src/commands.test.ts; bun test src/utils/suggestions/commandSuggestions.test.ts; bun test src/utils/envValidation.test.ts Thanks to @jatmn for the patient review and guidance. * fix(i18n): tighten slash command localization scope * fix(i18n): centralize localization and preserve external metadata * fix(commands): scope localized descriptions to OpenClaude-owned commands * fix(i18n): read session language before initial settings * fix(i18n): prefer whenToUse localization keys --------- Co-authored-by: OpenClaude (mimo-v2.5-pro) <openclaude@gitlawb.com> Co-authored-by: OpenClaude <noreply@openclaude.ai> Co-authored-by: lht3003-rgb <lht3003-rgb@users.noreply.github.com> | 2 个月前 |
| chore(main): release 0.30.0 (#2165) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 4 天前 |
| docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides (#2151) * docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides - Add drift caveat to CodeRabbit findings: verify suggestions against PR intent before applying; decline out-of-scope with justification or ask a maintainer; never silently ignore findings - Add Keep Your Branch Current subsection (rebase duty, fix-churn warning) - Require full local CI-equivalent suite green before every push, with cross-platform exception - Add ignored/filler PR template submissions to close-without-review list - Expand follow-up guidance: multi-round review is normal, repeated fix requests signal root-cause investigation and better agent prompting - Mirror all of the above in AGENTS.md for coding agents * docs: address CodeRabbit findings on review-expectations guides - Make CONTRIBUTING.md Validation the single authoritative pre-push validation contract mirroring .github/workflows/pr-checks.yml exactly: --frozen-lockfile install, launcher compatibility checks, provider recommendation via npm as CI does, web job carve-out - Remove conflicting 'relevant subset' wording; cross-platform exception is the only carve-out from the full suite - AGENTS.md now defers to the CONTRIBUTING contract instead of defining a divergent core-checks list - Reword ambiguous 'submit the PR template ignored' bullet to 'submit a PR with the PR template ignored' * docs: align pre-push validation suite with CI semantics - Drop standalone 'bun run test:full'; bun run check already includes it - Document web workspace install (bun install --cwd web --frozen-lockfile) before web checks, matching the web CI job - Pass explicit --base/--head to security:pr-scan so local scans target the PR merge-base like CI does instead of script defaults * docs: use PR base commit ref for local security scan parity Replace git merge-base computation with origin/main and document the required invariant (fetch + keep branch rebased onto current origin/main) so the local scan matches CI's PR base.sha instead of diverging. * docs: use exact PR base for security scan * docs: make local validation contract portable * docs: scope local checks and baseline waivers * docs: harden contributor workflow guidance * docs: pin contributor safety contracts | 11 天前 |
| chore: centralize Bun version and refresh CI tool pins (#1171) * chore: centralize Bun version and refresh CI tool pins - add .bun-version as the shared Bun source of truth for workflows and Docker builds - update PR and release workflows to read Bun from bun-version-file - refresh pinned GitHub Actions and Docker action SHAs to newer low-risk releases - align contributor docs with Bun 1.3.13 guidance * test: stabilize reset and provider profile persistence Harden knowledge graph reset behavior across Windows file-lock scenarios by improving SQLite and JSON reset signaling, preserving a safe JSON source of truth when SQLite cannot be cleared, and adding direct storage regression coverage. Also centralize deterministic config-home handling for tests, tighten provider profile persistence path resolution and cleanup semantics, isolate environment-sensitive suites with the env mutex, and remove flaky external npx dependency from the SDK consumer type test. * test: fix Codex OAuth callback flake Investigate the real provider smoke failure from GitHub Actions and fix the root cause instead of patching the symptom. - make Codex OAuth callback host explicit and consistent across redirect URI generation and listener binding - allow safe loopback host overrides for localhost, 127.0.0.1, and ::1 - harden Codex OAuth tests with env/fetch isolation so they do not poison neighboring provider suites - pin the OAuth callback tests to 127.0.0.1 to avoid localhost IPv4/IPv6 family mismatch flakes in CI Validated with bun test src/services/api/codexOAuth.test.ts, bun test src/services/api/providerConfig.codexSecureStorage.test.ts, and bun run test:provider. * test: harden Codex OAuth callback tests Investigate the recurring provider-smoke OAuth failures across multiple PR runs and fix the flaky callback test design at the root. - remove the free-port reservation race from Codex OAuth tests - add bounded callback retry only for loopback listener warm-up during the in-process OAuth test flow - move ephemeral callback port support into an explicit CodexOAuthService test seam instead of widening production env parsing - keep runtime callback-port semantics unchanged while adding regression coverage for callback host and port parsing Validated with targeted Codex OAuth tests and repeated provider-bucket reruns to check for recurring flake. * test: serialize provider shared-state suites Fix the recurring provider smoke flake at the root cause by serializing test suites that mutate process.env or globalThis.fetch. Add a shared test mutation lock and wire it into the provider bucket so Codex OAuth no longer races with unrelated provider/config/openai shim tests under Bun's parallel test execution. Cleanup now releases the lock in finally blocks, and the shared lock waits indefinitely by default to avoid timeout-based CI flakes. * test: fix smoke root causes and noisy suites Replace the Codex OAuth test's live loopback listener dependency with an injected listener seam, avoid module-mock leakage across provider suites, and clean up the auth-code listener test setup. Also harden noisy storage and search tests by asserting expected log output, isolating SQLite masterpiece persistence per test cwd, and removing routine benchmark/stress logging from passing runs. * build: harden Bun version install in Docker Validate the repo-tracked .bun-version value before using it in the Docker build stage, strip line endings, and install Bun through a quoted semver-only variable instead of raw shell expansion. * test: replace flaky conversation arc benchmark Fix the recurring smoke failure caused by an absolute wall-clock assertion in the normal unit suite. Replace the CI-speed-sensitive conversation arc benchmark with deterministic regression coverage that verifies repeated fact extraction, expected entity shapes, bounded graph growth, and populated-summary behavior. * test: isolate shared-state smoke suites * test: restore codex credential mocks between suites * test: fix shared-state and provider init-order flakes * test: isolate remaining shared-state smoke suites Serialize the remaining smoke-sensitive suites that mutate process env, CLAUDE_CONFIG_DIR, fetch, or SDK session globals. Add shared lock coverage to discovery, agent/skills loading, platform storage, and SDK lifecycle/preserved-segment tests. Restore session and cwd state inside the lock boundary so parallel files cannot leak bootstrap state into knowledge graph and SDK isolation tests. Validated with repeated smoke and full-suite passes: - bun run smoke (2x) - bun test - bun test --max-concurrency=1 - bun run test:provider - python -m pytest -q python/tests - npm run test:provider-recommendation | 3 个月前 |
| chore(main): release 0.30.0 (#2165) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 4 天前 |
| docs: add community standard files (#257) | 4 个月前 |
| docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides (#2151) * docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides - Add drift caveat to CodeRabbit findings: verify suggestions against PR intent before applying; decline out-of-scope with justification or ask a maintainer; never silently ignore findings - Add Keep Your Branch Current subsection (rebase duty, fix-churn warning) - Require full local CI-equivalent suite green before every push, with cross-platform exception - Add ignored/filler PR template submissions to close-without-review list - Expand follow-up guidance: multi-round review is normal, repeated fix requests signal root-cause investigation and better agent prompting - Mirror all of the above in AGENTS.md for coding agents * docs: address CodeRabbit findings on review-expectations guides - Make CONTRIBUTING.md Validation the single authoritative pre-push validation contract mirroring .github/workflows/pr-checks.yml exactly: --frozen-lockfile install, launcher compatibility checks, provider recommendation via npm as CI does, web job carve-out - Remove conflicting 'relevant subset' wording; cross-platform exception is the only carve-out from the full suite - AGENTS.md now defers to the CONTRIBUTING contract instead of defining a divergent core-checks list - Reword ambiguous 'submit the PR template ignored' bullet to 'submit a PR with the PR template ignored' * docs: align pre-push validation suite with CI semantics - Drop standalone 'bun run test:full'; bun run check already includes it - Document web workspace install (bun install --cwd web --frozen-lockfile) before web checks, matching the web CI job - Pass explicit --base/--head to security:pr-scan so local scans target the PR merge-base like CI does instead of script defaults * docs: use PR base commit ref for local security scan parity Replace git merge-base computation with origin/main and document the required invariant (fetch + keep branch rebased onto current origin/main) so the local scan matches CI's PR base.sha instead of diverging. * docs: use exact PR base for security scan * docs: make local validation contract portable * docs: scope local checks and baseline waivers * docs: harden contributor workflow guidance * docs: pin contributor safety contracts | 11 天前 |
| fix(launcher): route direct Node launch paths through launcher (#1363) Ensures package.json scripts (dev, start), scripts/provider-launch.ts, and Dockerfile route node executions through the bin/openclaude launcher rather than calling node directly on dist/cli.mjs. This resolves PR feedback: 1. Preserves the robust launcher relaunch guard, GC exposure, and test coverage already merged on main (from #1242). 2. Prevents hardcoded heap caps (--max-old-space-size=8192) from overriding user-provided NODE_OPTIONS or OPENCLAUDE_NODE_MAX_OLD_SPACE_SIZE_MB settings during development, start, or containerized runs. Co-authored-by: daltoncoder <daltoncoder@example.com> | 3 个月前 |
| hardening: isolate third-party paths and clean external-build metadata (#311) * hardening: isolate third-party paths and clean external-build metadata * fix: restore external feedback flow and make privacy check portable | 4 个月前 |
| Store provider profiles in user config (#969) | 3 个月前 |
| docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides (#2151) * docs: tighten PR review expectations in CONTRIBUTING and AGENTS guides - Add drift caveat to CodeRabbit findings: verify suggestions against PR intent before applying; decline out-of-scope with justification or ask a maintainer; never silently ignore findings - Add Keep Your Branch Current subsection (rebase duty, fix-churn warning) - Require full local CI-equivalent suite green before every push, with cross-platform exception - Add ignored/filler PR template submissions to close-without-review list - Expand follow-up guidance: multi-round review is normal, repeated fix requests signal root-cause investigation and better agent prompting - Mirror all of the above in AGENTS.md for coding agents * docs: address CodeRabbit findings on review-expectations guides - Make CONTRIBUTING.md Validation the single authoritative pre-push validation contract mirroring .github/workflows/pr-checks.yml exactly: --frozen-lockfile install, launcher compatibility checks, provider recommendation via npm as CI does, web job carve-out - Remove conflicting 'relevant subset' wording; cross-platform exception is the only carve-out from the full suite - AGENTS.md now defers to the CONTRIBUTING contract instead of defining a divergent core-checks list - Reword ambiguous 'submit the PR template ignored' bullet to 'submit a PR with the PR template ignored' * docs: align pre-push validation suite with CI semantics - Drop standalone 'bun run test:full'; bun run check already includes it - Document web workspace install (bun install --cwd web --frozen-lockfile) before web checks, matching the web CI job - Pass explicit --base/--head to security:pr-scan so local scans target the PR merge-base like CI does instead of script defaults * docs: use PR base commit ref for local security scan parity Replace git merge-base computation with origin/main and document the required invariant (fetch + keep branch rebased onto current origin/main) so the local scan matches CI's PR base.sha instead of diverging. * docs: use exact PR base for security scan * docs: make local validation contract portable * docs: scope local checks and baseline waivers * docs: harden contributor workflow guidance * docs: pin contributor safety contracts | 11 天前 |
| docs: add security policy | 4 个月前 |
| Add optional Sentry error reporting (env-driven, opt-in) (#2139) * Add optional Sentry error reporting (env-driven, opt-in) * Fix Sentry init to use dynamic import instead of require (ESM compatibility) * Document SENTRY_DSN setup in advanced-setup docs * Disable Sentry default integrations; document runtime install requirement * Wire reportErrorToSentry into top-level error handlers; add sentry.test.ts | 16 天前 |
| fix(deps): ship a zero-warning, minimal install (#1784) * fix(deps): ship a zero-warning, minimal install The published package declared 62 runtime `dependencies`, but `dist/cli.mjs` is a fully-bundled esbuild output that inlines almost all of them. End users therefore installed ~476 transitive packages — including three subtrees the bundle never needs at install time, each emitting an install warning: - node-domexception (deprecated) via google-auth-library - protobufjs (allow-scripts) via @grpc/* (already bundled into dist) - sharp (allow-scripts) native image module The repo's `overrides`/`allowScripts` silence these locally, but those are root-only npm settings and are ignored when the package is installed as a dependency — so end users saw the warnings. Core changes: - package.json: runtime dependencies trimmed 62 -> 3 (@orama/orama, @orama/plugin-data-persistence, @vscode/ripgrep). Bundled packages, plus the optional sharp/google-auth-library, move to devDependencies so they are built/tested but not shipped. - package.json: @anthropic-ai/sdk, @modelcontextprotocol/sdk, react and react-reconciler declared as OPTIONAL peerDependencies — externalized by the ./sdk bundle but bundled into the CLI. Optional peers keep the CLI install minimal and warning-free while still resolving for ./sdk consumers. - externals.ts: sharp, google-auth-library and @anthropic-ai/bedrock-sdk marked OPTIONAL_RUNTIME_EXTERNALS (loaded on demand, not shipped). - validate-externals.ts: runtime deps validate against externals; bundled deps validate against dependencies + devDependencies. - client.ts: load @anthropic-ai/bedrock-sdk via the runtime importer so esbuild no longer inlines it and hoists its static @aws-sdk import into the CLI bundle (that was a startup crash for default installs). Optional-dependency UX (consistent, actionable errors): - New src/utils/optionalRuntimeModule.ts exports importRuntimeModule and importOptionalRuntimeModule. The optional variant translates a missing package (code === 'ERR_MODULE_NOT_FOUND', specifier present in message) into "<feature> requires "<pkg>" ... Run `npm i -g <pkg>`". Generic so typed call sites keep their module types. - Routed ALL optional-package load sites through it (previously only one did): google-auth-library (client.ts, auth.ts, geminiAuth.ts), @anthropic-ai/foundry-sdk + @azure/identity (client.ts), and the @aws-sdk/* Bedrock paths (model/bedrock.ts, tokenEstimation.ts, aws.ts). - imageProcessor.ts: sharp-missing error now says `npm i -g sharp`. - docs/advanced-setup.md: new "Optional provider packages" table and a Vertex note documenting the on-demand installs. - Unit test for the helper (friendly error, success path, specifier match, raw passthrough). - knip.json: ignore google-auth-library (now loaded via runtime string). Verified on the current tree: - tsc, build/validate-externals, knip, and tests all pass. - npm pack + install --omit=dev adds 8 packages, zero deprecation/ allow-scripts/funding warnings; --version/--help/mcp list run. - With packages absent, CLAUDE_CODE_USE_BEDROCK and CLAUDE_CODE_USE_VERTEX print the friendly `npm i -g <pkg>` error (verified end-to-end). - ./sdk imports once its optional peers are present (24 exports, no warns). - Bundled ajv + ajv-formats validate with no ajv installed; no unguarded native runtime requires (fsevents absent in chokidar 4; bun:sqlite Bun-only). Trade-off: image reads, AWS Bedrock, Azure Foundry and GCP/Vertex now prompt a one-time `npm i -g <pkg>` instead of being shipped to every user. Co-Authored-By: OpenClaude <openclaude@gitlawb.com> Review fixes (CodeRabbit + jatmn): - validate-externals: the INTENTIONALLY_BUNDLED exemption is now scoped per bundle. The CLI exempts every bundled package; the SDK does NOT exempt packages declared as peerDependencies (keyed on package.json, an independent source of truth) so dropping react/@anthropic-ai/sdk from SDK_EXTERNALS now fails validation instead of silently passing. Added an explicit minimal- install contract check: bundled packages must be devDependencies-only — never in `dependencies`, and only the SDK-external subset may be optional peers. Validation logic extracted to scripts/externalsValidation.ts + tests. - FileReadTool oversized-image fallback now loads via the shared getImageProcessor() (not a raw import('sharp')) and re-throws ImageProcessorUnavailableError, so a missing processor surfaces the `npm i -g sharp` install hint instead of returning an over-budget image. - optionalRuntimeModule: match the missing specifier as a QUOTED token, not a raw substring, so a missing transitive package whose name contains the requested one (sharp vs sharp-libvips, @aws-sdk/client-bedrock vs @aws-sdk/client-bedrock-runtime) no longer triggers the wrong install hint. Predicate extracted to isMissingSpecifierError() with regression tests. - docs/advanced-setup.md: the Vertex auth section now shows both documented paths (gcloud ADC and a GOOGLE_APPLICATION_CREDENTIALS service-account file). Review fixes (round 2, CodeRabbit): - validate-externals: assert the optional-peer install contract — every peerDependency must be { optional: true } in peerDependenciesMeta (validateOptionalPeers), so losing that flag fails the build instead of silently reintroducing install warnings. - validate-externals: hard-check OPTIONAL_RUNTIME_EXTERNALS placement (validateOptionalRuntimeexternals). Anything esbuild can see statically must stay external in BOTH bundles (dropping sharp/google-auth-library now fails); the runtime-indirection-only subset (new RUNTIME_INDIRECTION_ONLY_EXTERNALS) must stay OUT of externals so esbuild never re-exposes their static imports. - Deeper-dig fix: @anthropic-ai/foundry-sdk was misclassified as INTENTIONALLY_BUNDLED, but it is loaded only through the Function indirection (esbuild never sees it, so it was never actually bundled) — its sole presence in dist is the specifier string. Per the PR's own "Azure Foundry now prompts" trade-off it is on-demand, so it now lives in OPTIONAL_RUNTIME_EXTERNALS + RUNTIME_INDIRECTION_ONLY_EXTERNALS (mirroring bedrock-sdk). sandbox-runtime is genuinely statically imported, so it stays bundled. - Provider-routing coverage (scripts/optionalRuntimeSpecifiers.test.ts): a static scan asserts every importOptionalRuntimeModule specifier is a declared OPTIONAL_RUNTIME_EXTERNAL and never also INTENTIONALLY_BUNDLED — the invariant that keeps a provider's optional package loadable on demand. - All new validators extracted to scripts/externalsValidation.ts with tests. Review fixes (round 3, CodeRabbit): - client.ts: gate the Vertex google-auth-library import behind the non-skip branch. CLAUDE_CODE_SKIP_VERTEX_AUTH (proxy/test) uses a mock GoogleAuth and must not require the optional package; it was loaded unconditionally before. - optionalRuntimeModule: drop the hard-coded `npm i -g`. The helper backs both the global CLI and project-local ./sdk consumers, so the hint is now context-neutral ("npm install <pkg>" / add -g for the global CLI). - validate-externals: every SDK_ONLY_EXTERNALS entry must STAY a peerDependency (a dropped peer leaves runtimeDeps while the SDK still externalizes it); and OPTIONAL_RUNTIME_EXTERNALS must never be shipped (fail on overlap with dependencies/peerDependencies). Both with tests + live-verified. - optionalRuntimeSpecifiers.test: pin the EXACT set of optionally-loaded specifiers instead of a >=5 count (a count passes even if a provider path regresses). - attachments: extract tryReadEditedImageAttachment() — background watched-file image attachments DEGRADE to null on any failure (incl. ImageProcessorUnavailableError) so a missing optional package never aborts a turn, while the explicit FileReadTool path still surfaces the install hint. Deterministic regression test (bad path -> null). - docs: Bedrock row notes profile-based auth also needs @aws-sdk/credential-providers; install-hint wording matches the new message. Review fixes (round 4, CodeRabbit): - attachments: stop sending the raw file path through the analytics bypass-cast (tengu_watched_file_compression_failed). Send only the safe file extension via getFileExtensionForAnalytics, matching the existing tengu_file_read_dedup pattern, so no usernames/project paths can leak. - externals.ts: corrected the OPTIONAL_RUNTIME_EXTERNALS header comment, which still claimed all entries "remain in COMMON_EXTERNALS" — no longer true since the indirection-only subset (bedrock/foundry) must stay OUT of the externals lists. (Other CodeRabbit comments on this push re-surface items already addressed in prior commits: the peerDependenciesMeta-optional check (validateOptionalPeers), the SDK-peers-present and optional-not-shipped validator rules, the exact-specifier-set test, the attachments degrade contract + test, and the context-neutral install hint are all present. The "assert every optional external is a devDependency" suggestion is intentionally NOT applied: @aws-sdk/* and @azure/identity are transitive devDeps via bedrock-sdk/foundry-sdk, so a blanket assertion would be incorrect; source resolution is covered by the build + tests that import these packages.) Review fixes (round 5, CodeRabbit): - attachments: stop leaking file paths via logError in the background-image degrade path. readImageWithTokenBudget can throw path-bearing messages (e.g. "Image file is empty: <path>") and logError persists message/stack, so log only the error TYPE name now. (Analytics payload was already sanitized.) - attachments: tryReadEditedImageAttachment takes an injectable reader so the degrade contract is tested for the EXACT error types — ImageProcessorUnavailableError and a path-bearing read error both degrade to null (not just ENOENT) — plus a success case. No mocking. - validate-externals: enforce the source-install half of the optional contract. Non-transitive OPTIONAL_RUNTIME_EXTERNALS must be devDependencies so `bun install` source builds resolve them. The new TRANSITIVE_OPTIONAL_EXTERNALS documents the exemption (@aws-sdk/* via @anthropic-ai/bedrock-sdk, @azure/identity via @anthropic-ai/foundry-sdk — provided transitively, not direct devDeps). A blanket "all optionals are devDeps" check would have wrongly failed on those. Tests + live-verified (dropping sharp from devDependencies now fails). Review fixes (round 6, CodeRabbit + jatmn): - optionalRuntimeSpecifiers.test: the call-site scan regex missed generic-annotated calls (importOptionalRuntimeModule<...>(...)) in model/bedrock.ts and tokenEstimation.ts, so the exact-set assertion was incomplete. Regex now allows an optional generic; EXPECTED_SPECIFIERS adds @aws-sdk/client-bedrock and @aws-sdk/client-bedrock-runtime (7 total). - importOptionalRuntimeModule default generic is now <T = unknown> (was any), so destructured imports are no longer silently any. Every call site now supplies its module type — typeof import('<pkg>') where the package is type-resolvable (bedrock-sdk, foundry-sdk, @aws-sdk/credential-providers, google-auth-library), and a named minimal-shape alias for @azure/identity (not a direct devDep, so typeof import can't resolve it). This gives compile-time verification of each provider's module contract (export names, shapes) — the structural answer to the "cover the provider branches" ask. - attachments: tryReadEditedImageAttachment takes injectable {read,log,track}; a new test asserts the sanitized-telemetry contract directly — the logError payload is path-free and the analytics payload carries only `ext`, never the edited-image path. * fix(deps): address optional runtime review findings * test(deps): isolate optional runtime importer mocks * fix(deps): clarify AWS optional auth labels * fix(deps): close optional runtime review gaps --------- Co-authored-by: jatmn <the@jat.mn> | 1 个月前 |
| chore(main): release 0.30.0 (#2165) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 4 天前 |
| Revert "fix(release): synchronize web changelog entries (#2088)" (#2113) This reverts commit 7743cf280ed13b97b4bb2da1b0afde8d0757651a. | 24 天前 |
| fix(typecheck): make `bun run typecheck` actionable on main (#473) (#938) Issue #473 reported that `bun run typecheck` fails on main with ~4400 errors due to repo-foundation drift, masking branch-specific regressions. Per kevincodex1's guidance ("lets narrow the typecheck scope for now and then we expand step by step") this PR addresses the foundational root causes and brings the error count down 60% so the gate is actionable for branch reviews. Changes: - tsconfig.json: bump target to ES2023 + add lib ["ES2023", "DOM"] so Array.findLast / findLastIndex resolve (kills 41 TS2550 errors). Add `noEmit: true` for typecheck-only mode and `allowImportingTsExtensions: true` (kills 40 TS5097 errors). Set `noImplicitAny: false` because cleaning up TSX-component implicit any is explicitly out of scope per the issue. - src/global.d.ts: ambient declaration for the build-time MACRO global injected by scripts/build.ts via Bun's `define` option (kills 9 TS2304 'Cannot find name MACRO' errors). - src/types/{message,utils,tools}.ts: stubs for the highest-impact missing modules from the partial source snapshot (~21 importers for message alone). Document the snapshot caveat at the top of each stub and reference issue #473 so future readers know they're placeholders. - src/entrypoints/sdk/controlTypes.ts and src/constants/querySource.ts: similar one-file stubs unblocking 18 + 19 importers respectively. - src/entrypoints/agentSdkTypes.ts: append `any`-typed aliases for ~70 SDK names that callers expect on the public surface but that live in stubbed sub-files (PermissionMode, SDKCompactBoundaryMessage, HookEvent, ModelUsage, ModelInfo, etc. — exactly the list from auriti's bug-report enumeration). Verified locally on Linux: - baseline `bunx tsc --noEmit` on stashed main: 4434 errors - with PR applied: 1782 errors (60% drop) - `bun run build`: passes (v0.7.0) - `bun test`: 1632 pass; the 4 remaining failures (StartupScreen, thinking) reproduce on main and are unrelated. - TS2550 (lib): 41 → 0 - TS5097 (.ts imports): 40 → 0 - TS2304 'MACRO': 9 → 0 - TS2307 missing modules: 587 → 325 Remaining errors are localized to specific stubbed modules and can be addressed in smaller follow-up issues, matching the issue's "Definition of done" criterion. | 4 个月前 |
| fix(typecheck): recreate missing CLI Transport interface (#1581) * fix(typecheck): recreate missing CLI Transport interface * fix(transports): implement async close in CLI transports * fix(transports): harden async close cleanup * fix: address async transport close review feedback * test: isolate environment-sensitive suites * fix(transports): drain uploader after close failure * fix(transports): type guard CCR stream events * test: remove unused auto-compact fixture helper | 2 个月前 |