Commit Graph
1747 Commits
Author SHA1 Message Date
Bellman e97ddc767f Merge pull request #3239 from AbbyJL/workspace-slash-command
fix(commands): wire workspace slash command
2026-10-13 07:59:47 +09:00
Bellman 95f797f5e2 Merge pull request #3316 from ultraworkers/fix/release-sha256-macos
fix(ci): use cross-platform sha256 for macOS and Linux release artifacts
v0.1.3
2026-10-13 07:32:17 +09:00
clawdbot ff515c9aeb fix(ci): use cross-platform sha256 for macOS and Linux release artifacts 2026-10-12 22:29:43 +00:00
Bellmanandclawdbot 0f1a69659c chore: remove accidentally committed .gjc session state and ignore .gjc/ (#3315)
Co-authored-by: clawdbot <clawdbot@ultraworkers.dev>
2026-10-13 07:22:41 +09:00
990cc33c19 test(runtime): expand json module unit tests [formatting fix] (#3308)
* test(runtime): expand json module unit tests

The hand-rolled JsonValue parser/renderer in runtime had only two
tests covering a self-contained JSON parser, renderer, accessor set,
and error type. Add focused unit tests covering primitive rendering,
sorted object keys, escape handling (quotes, backslashes, control
chars), signed-integer and whitespace-tolerant parsing, nested
structures, render->parse round-tripping, malformed-input rejection,
i64 overflow rejection, accessor variant mismatches, and JsonError
Display.

* style: format json.rs tests to match rustfmt standards

---------

Co-authored-by: 黄云龙 <76432572+nankingjing@users.noreply.github.com>
Co-authored-by: gaebal-gajae <clawdbot@users.noreply.github.com>
2026-10-13 07:22:31 +09:00
黄云龙 8d2c7b78b2 refactor(cli): let the emitter report the output tail it leaves behind (#3304)
refactor(cli): let the emitter report the output tail it leaves behind

Two places believed they owned terminal output: consume_stream streams
assistant deltas live while emit_output = true, and run_turn decided
whether to emit a separating newline before spinner.finish by guessing
from final_assistant_text(&summary).

That guess agrees with reality only because every *other* writer happens to
terminate its output with a newline — tool results go through
stream_markdown (which appends one), thinking summaries are written with a
trailing newline, and tool-call headers use writeln! — so the assistant
text path is the only one that can leave a partial line. That is a property
of the current renderers rather than of the streaming protocol, and it is
not enforced anywhere.

TerminalTail is state the emitter records into as it writes: both live
writers (AnthropicRuntimeClient::consume_stream and the tool-result blocks
in CliToolExecutor::execute) now push bytes through a TailTrackingWriter
that reports the last byte written, and the caller that ends a turn asks
where the emitter stopped instead of inferring it.

The heuristic also left the failure arm unguarded. A turn that streamed text
and then errored called spinner.fail on a partial line, which the line
clear then erased; that arm now carries the same guard.

Also gate the animated spinner.tick frame on is_terminal(). That frame is
pure cursor control (save, rewrite line, restore) and emits no newline, so
down a pipe it leaves an unterminated banner that the first streamed delta
then continues on the same physical line.

—
*[repo owner's gaebal-gajae (clawdbot) 🦞]*
2026-10-13 07:18:12 +09:00
Bellman 972ba85c3b Merge pull request #3268 from nankingjing/docs-model-aliases
docs(rust/README): document xAI and Kimi model aliases
2026-10-13 07:16:43 +09:00
Bellmanandclawdbot 6d6c83be01 docs(security): enable GitHub Security Advisories instructions (Fixes #3276) (#3311)
- Updated SECURITY.md with explicit instructions for reporting vulnerabilities via GitHub Security Advisories
- Replaced 'when available' qualifier since Private Vulnerability Reporting is now enabled
- Provided step-by-step guidance for security researchers to submit vulnerability reports

Co-authored-by: clawdbot <clawdbot@ultraworkers.dev>
2026-10-13 07:15:26 +09:00
Bellman 171a07b68c fix(cli): preserve trailing block separators in streamed markdown (#3312)
Merged via automated lane resolution
2026-10-13 07:15:19 +09:00
Bellman d1c678b6b0 Merge pull request #3310 from ultraworkers/release/v0.1.3-changelog
docs: add CHANGELOG for v0.1.3 release
2026-10-13 07:15:07 +09:00
黄云龙 8d81c61b7a test(runtime): cover JSON escapes end to end and pin the i64 boundary pair (#3305)
Reviewed and verified: 4 new tests added, all passing. 116 lines added to test JSON escape sequences and i64 boundaries. No production code changes.

—
*[repo owner's gaebal-gajae (clawdbot) 🦞]*
2026-10-13 07:14:47 +09:00
clawdbot faefa6e794 Merge pull request #3264 from JesseBrown1980/asolaria-wire
Add Asolaria json=0 wire-format + addressing example

Contributes a reproducible benchmark demonstrating:
- Binary wire format vs JSON text for agent event logs
- 4.64× size reduction (153.2 B → 33.0 B per record)
- ~11× faster encoding
- Tamper-detection via SHA-256 hash-chain
- Self-contained example with no changes to claw-code core

All measurements reproducible; architectural vision clearly distinguished.
2026-10-12 22:14:35 +00:00
devilking7x 39d2f73d67 docs: fix broken star history chart in README (#3307)
Closes #3293

The api.star-history.com SVG endpoint is broken due to GitHub
stargazer API restrictions. Switch to the working alternative at
star-history.dera.page for both dark/light SVGs and the chart link.
2026-10-13 07:14:27 +09:00
AbdullahFageehandOz 05a2d71cb5 fix: support groq compound defaults (#3281)
Route groq-prefixed models through the OpenAI-compatible client,
apply Groq token-limit metadata, and skip local tool injection for
compound models.

Add regression coverage for routing, token limits, and compound
local-tool behavior.

Co-authored-by: Oz <oz-agent@warp.dev>
2026-10-13 07:14:14 +09:00
Jesse Daniel Brown 5867ef8f9d Add Asolaria wire bench (reproducible binary+SHA vs JSON) 2026-10-12 22:14:13 +00:00
Jesse Daniel Brown 4ce9167e48 Add Asolaria wire bench (Cargo.toml) 2026-10-12 22:14:13 +00:00
Jesse Daniel Brown 49e6c2e72e Add Asolaria json=0 wire + addressing showcase (README) 2026-10-12 22:14:13 +00:00
YE 7633bc3638 docs: add Chinese translation (README.zh.md) (#3246)
docs: add Simplified Chinese translation (README.zh.md)

Adds a complete Chinese translation of the README with proper language selector.

Contribution by @JasonYeYuhe
2026-10-13 07:14:07 +09:00
Bellman 8aeef8d2e2 Merge pull request #3271 from Aneesh-382005/fix/local-model-validation-bypass
fix: generalize local-model validation bypass beyond Ollama tags
2026-10-13 07:13:39 +09:00
Ming LiuandClaude Opus 4.6 43d68dba75 feat: add persistent auto-memory system (#3241)
feat: add persistent auto-memory system

Implement a file-based persistent memory system that allows the AI to retain knowledge about users, feedback, projects, and references across sessions.

## Implementation Details
- MemoryStore data layer with FNV-1a workspace fingerprinting
- MemoryRead/MemoryWrite tools with security hardening (path traversal, symlink, absolute path, and size limit protections)
- System prompt injection of MEMORY.md index with prompt injection mitigation (fenced code block + trust-lowering notice)
- autoMemoryEnabled config option (defaults to true)
- Doctor health check for auto-memory state
- /memory command enhancement showing persistent memory info

## Verification
✓ 1023 lib tests pass
✓ Output format contract tests pass
✓ Release build succeeds
✓ Security hardening verified

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-10-13 07:13:36 +09:00
Bellman d6b7109d33 Merge pull request #3309 from ultraworkers/lane/cc-issue-3287
ci: pin all third-party GitHub Actions to immutable commit SHAs
2026-10-13 07:08:18 +09:00
clawdbot e2e91e1ab0 docs: add CHANGELOG for v0.1.3 release 2026-10-12 22:06:23 +00:00
Gracy769 d02d5736ed trigger ci 2026-10-12 22:06:08 +00:00
Gracy769 0244976f8d test: add explicit coverage for unquoted UNC paths
Asserts that an unquoted UNC path like \\server\share\file.txt survives
extract_path_candidates unchanged, preventing the regression where
shlex.split(posix=True) stripped the backslashes.
2026-10-12 22:06:08 +00:00
Gracy769 358a5252f6 test: add end-to-end UNC containment test
Replaces the basic extraction test with an end-to-end test that verifies
UNC paths are correctly denied when outside the workspace (e.g. local root),
but correctly allowed when the workspace root is itself a UNC share.

Validates the fix from the PR review.
2026-10-12 22:06:08 +00:00
Gracy769 6ef743ad73 test: add regression coverage for drive-relative and escaped UNC paths
Adds explicit test coverage to ensure drive-relative paths (e.g. C:foo)
and escaped UNC paths (e.g. \\\\server\\share\\dir) from JSON payloads
are correctly validated by the workspace containment checks.

Closes final review suggestions.
2026-10-12 22:06:08 +00:00
Gracy769 ad8cd12fa2 test: ensure full candidate probing and clear cache in setUp
- Updates _check_bash_state to not short-circuit on the first unusable
  bash candidate on Windows, ensuring a working fallback is found if present.
- Clears bash detection cache in unittest setUp/tearDown rather than just
  relying on a pytest fixture, covering native unittest runners.
2026-10-12 22:06:08 +00:00
Gracy769 86cf10a43a test: enforce bash lru_cache clearance and expose specific skip reasons
Adds a conftest.py pytest fixture to explicitly clear the lru_cache for bash
detection, addressing the monkeypatching hazard in a way that doesn't rely
solely on comments. (Note: CI currently runs python -m unittest, but this
keeps local pytest runners safe.)

Also updates the bash check to run the execution probe directly inside the
cached _check_bash_state, exposing the difference between 'no bash found'
and 'bash present but execution failed' directly to the unittest skip reason.
2026-10-12 22:06:08 +00:00
Gracy769 c31c5e27dd test: extract bash detection to shared _bash helper
Moves get_bash_executable and require_bash into a shared module so their
lru_cache state is per-session rather than per-test-module. Also adds a
comment regarding monkeypatching since lru_cache will silently drop changes
to os.environ if it has already been populated.

Closes follow-up items from PR review.
2026-10-12 22:06:08 +00:00
Gracy769 a916bf9d66 perf(test): cache bash probe resolution per session with functools.lru_cache 2026-10-12 22:06:08 +00:00
Gracy769 0d8b50b378 fix(security): deny unresolvable paths and enable Git bash detection on Windows 2026-10-12 22:06:08 +00:00
Gracy769 3463331171 test: fix windows test compatibility 2026-10-12 22:06:08 +00:00
Gracy769 49a4f27d14 style: remove trailing whitespace in path_scope.py 2026-10-12 22:06:08 +00:00
Gracy769 ac60c3a42d docs(test): document junction UNC limitation and add mocked UNC link escape test 2026-10-12 22:06:08 +00:00
Gracy769 1f0ded95ed test: support unprivileged Windows runners with NTFS junction fallback and add mocked escape test 2026-10-12 22:06:08 +00:00
Gracy769 08e22ba4e5 test: add regression test for symlink escape using absolute windows path 2026-10-12 22:05:25 +00:00
Gracy769 acc97a8df7 test: add UNC path test for path extraction and fix windows tests 2026-10-12 22:05:25 +00:00
Gracy769 66d73338bf fix(security): path containment checks for Windows environments
- Fixed an issue in extract_path_candidates where shlex.split(posix=True)
  would strip backslashes from Windows paths, mangling UNC paths (e.g. \\server\share)
  before they could be evaluated by _is_windows_absolute.
- Fixed a bypass in validate_path where Windows absolute paths bypassed glob
  expansion and symlink resolution. On Windows, they now fall through to the
  standard Path logic, allowing glob expansion and strict resolution while still
  properly checking containment.
2026-10-12 22:05:25 +00:00
gaebal-gajae 57f11ddbed ci: pin all third-party GitHub Actions to immutable commit SHAs
- actions/checkout: v4 → 11d5960a326750d5838078e36cf38b85af677262
- actions/setup-python: v5 → a26af69be951a213d495a4c3e4e4022e16d87065
- actions/upload-artifact: v4 → ea165f8d65b6e75b540449e92b4886f43607fa02
- dtolnay/rust-toolchain: stable → 686976e191b89faba57d3206551f0f330d8cb249
- Swatinem/rust-cache: v2 → 49a0bdc70d2e1b713ca9e2869b211fcce03d3c1c
- softprops/action-gh-release: v2 → 3bb12739c298aeb8a4eeaf626c5b8d85266b0e65

Improves supply chain security by pinning Actions to specific commits
instead of mutable tag references, preventing unexpected behavior changes
if action maintainers update tags.

Fixes #3287
2026-10-12 22:05:06 +00:00
黄云龙 86428abce6 refactor(runtime): make the permission privilege ladder an explicit rank (#3303)
* fix(runtime): prompt permission mode never invokes the prompter

PermissionMode derives Ord from declaration order, placing Prompt (and Allow)
above the real privilege ladder (ReadOnly < WorkspaceWrite < DangerFullAccess).
In PermissionPolicy::authorize_with_context the ladder check
'current_mode >= required_mode' therefore evaluates true for every tool when the
active mode is Prompt (3 >= {0,1,2}), returning Allow and making the subsequent
'if current_mode == PermissionMode::Prompt' branch that routes to prompt_or_deny
unreachable.

Effect: a session configured with the 'prompt' permission mode silently
auto-allows every tool and never calls the prompter (reached via
ConversationRuntime::run_turn with an interactive prompter), defeating the mode's
entire purpose. The sibling PermissionEnforcer already special-cases Prompt
before its own 'active_mode >= required_mode' check, confirming Prompt is not
meant to be part of the ordered ladder.

Fix: exclude Prompt from the ordered-ladder comparison so Prompt mode falls
through to the interactive prompt path. Allow remains handled by its explicit
equality check. The same comparison appears twice in authorize_with_context —
once in the shared tail and once inside the 'Some(PermissionOverride::Allow)'
arm, which is reached when a hook emits permissionDecision "allow" — so both
copies carry the guard; guarding only the tail still left a hook able to
auto-allow every tool in Prompt mode without ever consulting the prompter.

Adds regression tests covering Prompt mode with a prompter, without a prompter,
and with a hook allow override.

* refactor(runtime): make the permission privilege ladder an explicit rank

`PermissionMode` derived `PartialOrd`/`Ord`, so the ladder deciding whether a
tool runs without asking was declaration order. A variant inserted in the middle
of the enum re-ranked it silently, and the difference between "this tool may
run" and "this tool may run after a prompt" was a property of where an `enum`
line happened to sit. That is how `Prompt` came to outrank `DangerFullAccess`,
satisfy `current_mode >= required_mode` for every tool, and skip the prompter.

Replace the derive with `privilege_rank`, an exhaustive `match` naming every
variant, so inserting one is a build failure rather than a silent re-ranking.
`Ord` is deliberately not derived, so a stray `>=` on two modes no longer
compiles; the two comparisons outside this module now say which rank they read
(`PermissionEnforcer::check_with_required_mode` and the `claw doctor` permission
check). Both keep their previous answers, since `privilege_rank` reproduces the
old declaration order exactly, including `Prompt` and `Allow` above the tiers.

`Prompt` and `Allow` are modes of operation, not privilege tiers, so they are
never ranked *against* a tool requirement. The new `covers` predicate states
that by name rather than by number: `Allow` always covers, `Prompt` never does
(it asks), and only the three tiers compare ranks.

That also collapses the duplicated ladder in `authorize_with_context`. The
`Some(PermissionOverride::Allow)` arm carried a second, identical copy of the
ask-rule check and the ladder; it now falls through to the single copy below,
so a hook `allow` is an override rather than a bypass and the two copies can no
longer drift apart.

Behaviour is unchanged for every (mode, requirement, rule, override)
combination. The tests pin the `Prompt` routes — plain and hook-`allow` — across
all three tiers, plus the rank ordering itself.
2026-10-13 07:04:44 +09:00
gaebal-gajae 1b1fba48fc Merge pull request #3269 from nankingjing/docs/correct-rust-crate-count
docs: correct rust workspace crate count to 11

This updates the documentation to reflect the actual number of crates in the
rust workspace, which is 11, not 9. The workspace contains:
- api
- claw-analog
- claw-rag-service
- commands
- compat-harness
- mock-anthropic-service
- plugins
- runtime
- rusty-claude-cli
- telemetry
- tools
2026-10-12 22:03:21 +00:00
gaebal-gajae 794254597c Fix untrusted project hooks in read-only mode 2026-10-12 22:02:05 +00:00
Bellman cc58238e43 Merge pull request #3273 from nankingjing/fix-duplicate-assistant-text-3258
fix(cli): stop reprinting streamed assistant text after 'Done' in non-compact text mode
2026-10-12 05:40:00 +09:00
Bellman 16ce599ef0 Merge pull request #3286 from SulimanAbdulrazzaq/fix/3278-windows-workspace-path
fix(runtime): normalize Windows workspace paths
2026-10-12 05:38:29 +09:00
Bellman b05aeee652 Merge pull request #3243 from mlzoo/fix/session-store-path-traversal
fix: prevent path traversal via session_id in session_store
2026-10-12 05:36:57 +09:00
gaebal-gajae 811403286b test(cli): assert streamed response is emitted once 2026-10-11 20:35:09 +00:00
mlliuz 102bc5ef79 fix: prevent path traversal via session_id in session_store
load_session/save_session built the session file path directly from the
caller-supplied session_id with no validation, so a value like
'../../../tmp/secrets' (reachable from the 'load-session' CLI subcommand)
could read or write JSON files outside the session directory.

Add _validate_session_id() to reject anything outside [A-Za-z0-9_-]
(path separators, '..', absolute/Windows paths) before the id is used to
build a filename. Legitimate ids (uuid4 hex, 'session-<digits>-<n>') are
unaffected.

Adds SessionStorePathTraversalTests covering traversal rejection on both
load and save plus a legitimate-id round-trip.
2026-10-11 20:31:56 +00:00
nankingjing 072594dfee test(api): lock the README model-alias table to the resolver
The `## Model Aliases` table and `MODEL_REGISTRY` had drifted: the table
listed only the three Anthropic aliases while the resolver had grown the
xAI and Kimi entries, so an alias could resolve without being documented.

Assert the two agree in both directions — every registry alias appears in
the table with the canonical id and auth env var it actually resolves to,
and the table introduces no alias the resolver does not know. Each row is
also checked case-insensitively, since the README claims `OPUS` behaves
the same as `opus`.

Also pin that a provider-prefixed form such as `anthropic/opus` is not an
alias: it is passed through as-is rather than expanded. The README now
says so, which is what made the distinction worth a test rather than a
comment.
2026-09-24 12:19:39 +08:00
Suliman Abdulrazzaq dc346498fb fix(runtime): accept other Windows spellings of a workspace path
validate_workspace_boundary compared paths lexically, so a location inside
the workspace spelled with different letter case (a working directory typed
as c:\users\... for C:\Users\...) or through the \\.\ device namespace was
reported as escaping the workspace.

When the lexical comparison fails, compare the path's canonical form before
reporting an escape. A path whose canonical form is outside the workspace
stays rejected.
2026-09-18 12:03:14 +03:00
Suliman Abdulrazzaq dbf5389729 test(runtime): gate the Windows extended-path boundary test to Windows
accepts_equivalent_extended_path_at_workspace_boundary builds its paths
with backslash separators. Backslashes only separate path components on
Windows, so on Linux each path is a single component, the boundary check
rejects the path, and cargo test fails.

Run the test only on Windows, and call validate_workspace_boundary through
super:: so non-Windows test builds do not warn about an unused import.
2026-09-17 13:15:05 +00:00