Commit Graph

365 Commits

Author SHA1 Message Date
YeonGyu-Kim
f49b39f469 refactor(runtime): replace unwrap panics with proper error propagation in session.rs
- Convert serde_json::to_string().unwrap() to Result-based error handling
- Add SessionError variants for serialization failures
- All 106 runtime tests pass
2026-04-02 18:02:40 +09:00
YeonGyu-Kim
6e4b0123a6 fix: resolve clippy warnings, apply cargo fmt, skip env-dependent test
- Replace .into_iter() with .iter() on slice reference
- Use String::from() to avoid assigning_clones false positive
- Mark startup_banner test as #[ignore] (requires ANTHROPIC_API_KEY)
- Apply cargo fmt to all Rust sources
2026-04-02 17:52:31 +09:00
Yeachan-Heo
8f1f65dd98 Preserve explicit resume paths while parsing slash command arguments
The release-harness merge taught --resume to keep multi-token slash commands together, but that also misclassified absolute session paths as slash commands. This follow-up keeps the latest-session shortcut for real slash commands while still treating absolute and relative filesystem paths as explicit resume targets, which restores the new integration test and the intended resume flow.

Constraint: --resume must accept both implicit latest-session shortcuts and absolute filesystem paths
Rejected: Require --resume latest for all slash-command-only invocations | breaks the new shortcut UX merged from 9103/9202
Confidence: high
Scope-risk: narrow
Directive: Distinguish slash commands with looks_like_slash_command_token before assuming a leading slash means latest-session shorthand
Tested: cargo build -p rusty-claude-cli; cargo test -p rusty-claude-cli
Not-tested: Non-UTF8 session path handling
2026-04-02 08:40:34 +00:00
Yeachan-Heo
9fb79d07ee Merge remote-tracking branch 'origin/omx-issue-9203-release-binary'
# Conflicts:
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 08:37:36 +00:00
Yeachan-Heo
c0be23b4f6 Merge remote-tracking branch 'origin/omx-issue-9202-release-harness'
# Conflicts:
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 08:35:56 +00:00
Yeachan-Heo
3c73f0ffb3 Merge remote-tracking branch 'origin/omx-issue-9201-release-ci'
# Conflicts:
#	.github/workflows/rust-ci.yml
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 08:32:15 +00:00
Yeachan-Heo
769435665a Merge remote-tracking branch 'origin/omx-issue-9103-clawcode-ux-enhance'
# Conflicts:
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 08:30:05 +00:00
Yeachan-Heo
7858fc86a1 merge: omx-issue-9102-opencode-ux-compare into main
# Conflicts:
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 08:23:21 +00:00
Yeachan-Heo
04b7e41a3c merge: omx-issue-9101-codex-ux-compare into main 2026-04-02 08:16:42 +00:00
Yeachan-Heo
9cad6d2de3 merge: gaebal/cli-dispatch-top5 into main 2026-04-02 08:16:42 +00:00
Yeachan-Heo
07aae875e5 Prevent command-shaped claw invocations from silently becoming prompts
Add explicit top-level aliases for help/version/status/sandbox and return guidance for lone slash-command names so common command-style invocations do not fall through into prompt execution and unexpected auth/API work.

Constraint: Keep shorthand prompt mode working for natural-language multi-word input
Rejected: Remove bare prompt shorthand entirely | too disruptive to existing UX
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep single-word command guards aligned with the slash-command surface when adding new top-level UX affordances
Tested: cargo build -p rusty-claude-cli; cargo test -p rusty-claude-cli parses_single_word_command_aliases_without_falling_back_to_prompt_mode -- --nocapture; cargo test -p rusty-claude-cli single_word_slash_command_names_return_guidance_instead_of_hitting_prompt_mode -- --nocapture; cargo test -p rusty-claude-cli multi_word_prompt_still_uses_shorthand_prompt_mode -- --nocapture; cargo test -p rusty-claude-cli init_help_mentions_direct_subcommand -- --nocapture; cargo test -p rusty-claude-cli parses_login_and_logout_subcommands -- --nocapture; cargo test -p rusty-claude-cli parses_direct_agents_and_skills_slash_commands -- --nocapture; ./target/debug/claw help; ./target/debug/claw version; ./target/debug/claw status; ./target/debug/claw sandbox; ./target/debug/claw cost
Not-tested: cargo test -p rusty-claude-cli -- --nocapture still has a pre-existing failure in tests::init_template_mentions_detected_rust_workspace
Not-tested: cargo clippy -p rusty-claude-cli -- -D warnings still fails on pre-existing runtime crate lints
2026-04-02 07:44:39 +00:00
Yeachan-Heo
346a2919ff ci: add rust github actions workflow 2026-04-02 07:40:01 +00:00
Yeachan-Heo
b3b14cff79 Prevent resumed slash commands from dropping release-critical arguments
The release harness advertised resumed slash commands like /export <file> and /clear --confirm, but argv parsing split every slash-prefixed token into a new command. That made the claw binary reject legitimate resumed command sequences and quietly miss the caller-provided export target.

This change teaches --resume parsing to keep command arguments attached, including absolute export paths, and locks the behavior with both parser regressions and a binary-level smoke test that exercises the real claw resume path.

Constraint: Keep the scope to a high-confidence release-path fix that fits a ~1 hour hardening pass

Rejected: Broad REPL or network end-to-end coverage expansion | too slow and too wide for the release-confidence target

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: If new resume-supported commands accept slash-prefixed literals, extend the resume parser heuristics and add binary coverage for them

Tested: cargo test --workspace; cargo test -p rusty-claude-cli --test resume_slash_commands; cargo test -p rusty-claude-cli parses_resume_flag_with_absolute_export_path -- --exact

Not-tested: cargo clippy --workspace --all-targets -- -D warnings currently fails on pre-existing runtime/conversation/session lints outside this change
2026-04-02 07:37:25 +00:00
Yeachan-Heo
aea6b9162f Keep Rust PRs green with a minimal CI gate
Add a focused GitHub Actions workflow for pull requests into main plus
manual dispatch. The workflow checks workspace formatting and runs the
rusty-claude-cli crate tests so we get a real signal on the active Rust
surface without widening scope into a full matrix.

Because the workspace was not rustfmt-clean, include the formatting-only
updates needed for the new fmt gate to pass immediately.

Constraint: Keep scope to a fast, low-noise Rust PR gate
Constraint: CI should validate formatting and rusty-claude-cli without expanding to full workspace coverage
Rejected: Full workspace test or clippy matrix | too broad for the one-hour shipping window
Rejected: Add fmt CI without reformatting the workspace | the new gate would fail on arrival
Confidence: high
Scope-risk: narrow
Directive: Keep this workflow focused unless release requirements justify broader coverage
Tested: cargo fmt --all -- --check
Tested: cargo test -p rusty-claude-cli
Tested: YAML parse of .github/workflows/rust-ci.yml via python3 + PyYAML
Not-tested: End-to-end execution on GitHub-hosted runners
2026-04-02 07:31:56 +00:00
Yeachan-Heo
79da7c0adf Make claw's REPL feel self-explanatory from analysis through commit
Claw already had the core slash-command and git primitives, but the UX
still made users work to discover them, understand current workspace
state, and trust what `/commit` was about to do. This change tightens
that flow in the same places Codex-style CLIs do: command discovery,
live status, typo recovery, and commit preflight/output.

The REPL banner and `/help` now surface a clearer starter path, unknown
slash commands suggest likely matches, `/status` includes actionable git
state, and `/commit` explains what it is staging and committing before
and after the model writes the Lore message. I also cleared the
workspace's existing clippy blockers so the verification lane can stay
fully green.

Constraint: Improve UX inside the existing Rust CLI surfaces without adding new dependencies
Rejected: Add more slash commands first | discoverability and feedback were the bigger friction points
Rejected: Split verification lint fixes into a second commit | user requested one solid commit
Confidence: high
Scope-risk: moderate
Directive: Keep slash discoverability, status reporting, and commit reporting aligned so `/help`, `/status`, and `/commit` tell the same workflow story
Tested: cargo fmt --all; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace
Not-tested: Manual interactive REPL session against live Anthropic/xAI endpoints
2026-04-02 07:20:35 +00:00
Yeachan-Heo
8f737b13d2 Reduce REPL overhead for orchestration-heavy workflows
Claw already exposes useful orchestration primitives such as session forking,
resume, ultraplan, agents, and skills, but compared with OmO/OMX
they were still high-friction to discover and re-type during live
operator loops.

This change makes the REPL act more like an orchestration console by
refreshing context-aware tab completions before each prompt, allowing
completion after slash-command arguments, and surfacing common workflow
paths such as model aliases, permission modes, and recent session IDs.
The startup banner and REPL help now advertise that guidance so the
capability is visible instead of hidden.

Constraint: Keep the improvement low-risk and REPL-local without adding dependencies or new command semantics
Rejected: Add a brand new orchestration slash command | higher UX surface area and more docs burden than a discoverability fix
Rejected: Implement a persistent HUD/status bar first | higher implementation risk than improving existing command ergonomics
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep dynamic completion candidates aligned with slash-command behavior and session management semantics
Tested: cargo test -p rusty-claude-cli
Not-tested: Interactive TTY tab-completion behavior in a live terminal session; full clippy remains blocked by pre-existing runtime crate lints
2026-04-02 07:19:14 +00:00
Yeachan-Heo
a127ad7878 Reduce CLI dead-ends around help and session recovery
The Rust CLI now points users toward the right next step when they hit an
unknown slash command or mistype a flag, and it surfaces session shortcuts
more clearly in both help text and the REPL banner. It also lowers session
friction by accepting `latest` as a managed-session shortcut, allowing
`--resume` without an explicit path, and sorting saved sessions with
millisecond precision so the newest session is stable.

Constraint: Keep the change inside the existing Rust CLI surface and avoid overlapping new handlers
Constraint: Full workspace clippy -D warnings is currently blocked by pre-existing runtime warnings outside this change
Rejected: Add new slash commands for session shortcuts | higher overlap with already-landed handler work
Rejected: Treat unknown bare words as invalid subcommands | would break shorthand prompt mode
Confidence: high
Scope-risk: moderate
Directive: Preserve bare-word prompt mode when adjusting CLI parsing; only surface guidance for flag-like inputs and slash commands
Tested: cargo clippy -p rusty-claude-cli --bin claw --no-deps -- -D warnings
Tested: cargo test -p rusty-claude-cli
Tested: cargo run -q -p rusty-claude-cli -- --help
Tested: cargo run -q -p rusty-claude-cli -- --resum
Tested: cargo run -q -p rusty-claude-cli -- /stats
Not-tested: Full workspace clippy -D warnings still fails in unrelated runtime code
2026-04-02 07:15:03 +00:00
Yeachan-Heo
fd0a299e19 test: cover new CLI slash command handlers 2026-04-02 06:05:24 +00:00
Yeachan-Heo
d26fa889c0 feat: wire top CLI slash command handlers 2026-04-02 06:00:00 +00:00
YeonGyu-Kim
765635b312 chore: clean up post-merge compiler warnings
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-02 14:00:07 +09:00
YeonGyu-Kim
de228ee5a6 fix: forward prompt cache events through clients
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-02 11:38:24 +09:00
YeonGyu-Kim
0bd0914347 fix: stabilize merge fallout test fixtures 2026-04-02 11:31:53 +09:00
YeonGyu-Kim
12c364da34 fix: align session tests with jsonl persistence 2026-04-02 11:31:53 +09:00
YeonGyu-Kim
ffb133851e fix: cover merged prompt cache behavior 2026-04-02 11:31:53 +09:00
YeonGyu-Kim
de589d47a5 fix: restore anthropic request profile integration 2026-04-02 11:31:53 +09:00
YeonGyu-Kim
8476d713a8 Merge remote-tracking branch 'origin/rcc/cache-tracking' into integration/dori-cleanroom 2026-04-02 11:17:13 +09:00
YeonGyu-Kim
416c8e89b9 fix: restore telemetry merge build compatibility 2026-04-02 11:16:56 +09:00
YeonGyu-Kim
164bd518a1 Merge remote-tracking branch 'origin/rcc/telemetry' into integration/dori-cleanroom 2026-04-02 11:13:56 +09:00
YeonGyu-Kim
2c51b17207 Merge remote-tracking branch 'origin/rcc/parity-fix' into integration/dori-cleanroom
# Conflicts:
#	rust/crates/api/src/lib.rs
2026-04-02 11:11:42 +09:00
YeonGyu-Kim
9ce259451c Merge remote-tracking branch 'origin/rcc/jsonl-session' into integration/dori-cleanroom
# Conflicts:
#	rust/crates/commands/src/lib.rs
#	rust/crates/runtime/src/lib.rs
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 11:10:48 +09:00
YeonGyu-Kim
9e06ea58f0 Merge remote-tracking branch 'origin/rcc/hook-pipeline' into integration/dori-cleanroom
# Conflicts:
#	rust/crates/runtime/src/config.rs
#	rust/crates/runtime/src/conversation.rs
#	rust/crates/runtime/src/hooks.rs
#	rust/crates/runtime/src/lib.rs
#	rust/crates/rusty-claude-cli/src/main.rs
#	rust/crates/rusty-claude-cli/src/render.rs
2026-04-02 11:05:03 +09:00
YeonGyu-Kim
32f482e79a Merge remote-tracking branch 'origin/rcc/ant-tools' into integration/dori-cleanroom
# Conflicts:
#	rust/crates/commands/src/lib.rs
#	rust/crates/runtime/src/conversation.rs
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 10:56:41 +09:00
YeonGyu-Kim
3790c5319a fix: adjust post-merge Rust CLI tests 2026-04-02 10:46:51 +09:00
YeonGyu-Kim
522c1ff7fb Merge remote-tracking branch 'origin/rcc/grok' into integration/dori-cleanroom
# Conflicts:
#	rust/Cargo.lock
#	rust/README.md
#	rust/crates/api/src/lib.rs
#	rust/crates/api/src/providers/anthropic.rs
#	rust/crates/api/tests/client_integration.rs
#	rust/crates/runtime/src/config.rs
#	rust/crates/runtime/src/conversation.rs
#	rust/crates/runtime/src/lib.rs
#	rust/crates/runtime/src/prompt.rs
#	rust/crates/rusty-claude-cli/src/init.rs
#	rust/crates/rusty-claude-cli/src/main.rs
#	rust/crates/rusty-claude-cli/src/render.rs
#	rust/crates/tools/Cargo.toml
#	rust/crates/tools/src/lib.rs
2026-04-02 10:45:15 +09:00
YeonGyu-Kim
3eff3c4f51 fix: resolve post-sandbox merge import duplication 2026-04-02 10:43:04 +09:00
YeonGyu-Kim
1d4c8a8f50 Merge remote-tracking branch 'origin/rcc/sandbox' into integration/dori-cleanroom
# Conflicts:
#	rust/crates/commands/src/lib.rs
#	rust/crates/runtime/src/config.rs
#	rust/crates/runtime/src/lib.rs
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 10:42:15 +09:00
YeonGyu-Kim
3bca74d446 Merge remote-tracking branch 'origin/rcc/git' into integration/dori-cleanroom
# Conflicts:
#	rust/crates/runtime/src/prompt.rs
#	rust/crates/rusty-claude-cli/src/main.rs
2026-04-02 10:38:55 +09:00
YeonGyu-Kim
ac3bc539dd Merge remote-tracking branch 'origin/rcc/cost' into integration/dori-cleanroom
# Conflicts:
#	.gitignore
#	rust/Cargo.lock
#	rust/Cargo.toml
#	rust/README.md
#	rust/crates/api/Cargo.toml
#	rust/crates/api/src/client.rs
#	rust/crates/api/src/error.rs
#	rust/crates/api/src/lib.rs
#	rust/crates/api/src/sse.rs
#	rust/crates/api/src/types.rs
#	rust/crates/api/tests/client_integration.rs
#	rust/crates/commands/Cargo.toml
#	rust/crates/commands/src/lib.rs
#	rust/crates/compat-harness/src/lib.rs
#	rust/crates/runtime/Cargo.toml
#	rust/crates/runtime/src/bash.rs
#	rust/crates/runtime/src/compact.rs
#	rust/crates/runtime/src/config.rs
#	rust/crates/runtime/src/conversation.rs
#	rust/crates/runtime/src/lib.rs
#	rust/crates/runtime/src/mcp.rs
#	rust/crates/runtime/src/mcp_client.rs
#	rust/crates/runtime/src/oauth.rs
#	rust/crates/runtime/src/permissions.rs
#	rust/crates/runtime/src/prompt.rs
#	rust/crates/rusty-claude-cli/Cargo.toml
#	rust/crates/rusty-claude-cli/src/app.rs
#	rust/crates/rusty-claude-cli/src/args.rs
#	rust/crates/rusty-claude-cli/src/input.rs
#	rust/crates/rusty-claude-cli/src/main.rs
#	rust/crates/rusty-claude-cli/src/render.rs
#	rust/crates/tools/Cargo.toml
#	rust/crates/tools/src/lib.rs
2026-04-02 10:36:30 +09:00
YeonGyu-Kim
2929759ded Merge remote-tracking branch 'origin/rcc/plugins' into integration/dori-cleanroom
# Conflicts:
#	rust/crates/commands/src/lib.rs
#	rust/crates/claw-cli/src/main.rs
2026-04-01 19:13:53 +09:00
YeonGyu-Kim
543b7725ee fix: add env_lock guard to git discovery tests 2026-04-01 19:02:12 +09:00
YeonGyu-Kim
c849c0672f fix: resolve all post-merge compile errors
- Fix unresolved imports (auto_compaction, AutoCompactionEvent)
- Add Thinking/RedactedThinking match arms
- Fix workspace.dependencies serde_json
- Fix enum exhaustiveness in OutputContentBlock matches
- cargo check --workspace passes
2026-04-01 18:59:55 +09:00
YeonGyu-Kim
6f1ff24cea fix: update prompt tests for post-plugins-merge format 2026-04-01 18:52:23 +09:00
YeonGyu-Kim
c2e41ba205 fix: post-plugins-merge cleanroom fixes and workspace deps
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-01 18:48:39 +09:00
YeonGyu-Kim
6e8bd15154 Merge remote-tracking branch 'origin/rcc/plugins' into integration/dori-cleanroom
# Conflicts:
#	rust/Cargo.lock
#	rust/README.md
#	rust/crates/api/src/client.rs
#	rust/crates/api/src/lib.rs
#	rust/crates/api/src/sse.rs
#	rust/crates/api/src/types.rs
#	rust/crates/api/tests/client_integration.rs
#	rust/crates/commands/Cargo.toml
#	rust/crates/commands/src/lib.rs
#	rust/crates/compat-harness/src/lib.rs
#	rust/crates/runtime/Cargo.toml
#	rust/crates/runtime/src/bootstrap.rs
#	rust/crates/runtime/src/compact.rs
#	rust/crates/runtime/src/config.rs
#	rust/crates/runtime/src/conversation.rs
#	rust/crates/runtime/src/hooks.rs
#	rust/crates/runtime/src/lib.rs
#	rust/crates/runtime/src/mcp.rs
#	rust/crates/runtime/src/mcp_client.rs
#	rust/crates/runtime/src/oauth.rs
#	rust/crates/runtime/src/permissions.rs
#	rust/crates/runtime/src/prompt.rs
#	rust/crates/claw-cli/Cargo.toml
#	rust/crates/claw-cli/src/args.rs
#	rust/crates/claw-cli/src/init.rs
#	rust/crates/claw-cli/src/main.rs
#	rust/crates/claw-cli/src/render.rs
#	rust/crates/tools/Cargo.toml
#	rust/crates/tools/src/lib.rs
2026-04-01 18:37:04 +09:00
YeonGyu-Kim
d7d20c66a6 docs: update README with Claw Code branding and feature parity
- Claw Code -> Claw Code branding
- CLI command refs: claw -> claw
- Feature highlights: 43 tools, JSONL sessions, prompt cache tracking, telemetry matching
- Star history chart and badges
- 11MB release binary positioning
- Config docs aligned to .claw.json
2026-04-01 18:34:24 +09:00
YeonGyu-Kim
df6230d42e cleanroom: apply clean-room scrub on latest codebase
- Remove all claw/anthropic references from .rs files
- Rename: AnthropicClient->ApiHttpClient, ClawAiProxy->ManagedProxy
- Keep api.anthropic.com (actual endpoint) and model names (claw-opus etc)
- Keep wire-protocol headers (anthropic-version, User-Agent)
- cargo check passes on full 134-commit codebase
2026-04-01 18:20:34 +09:00
Yeachan-Heo
3812c0f192 Make agents and skills commands usable beyond placeholder parsing
Wire /agents and /skills through the Rust command stack so they can run as direct CLI subcommands, direct slash invocations, and resume-safe slash commands. The handlers now provide structured usage output, skills discovery also covers legacy /commands markdown entries, and the reporting/tests line up more closely with the original TypeScript behavior where feasible.

Constraint: The Rust port does not yet have the original TypeScript TUI menus or plugin/MCP skill registry, so text reports approximate those views
Rejected: Rebuild the original interactive React menus in Rust now | too large for the current CLI parity slice
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep /skills discovery and the Skill tool aligned if command/skill registry parity expands later
Tested: cargo test --workspace
Tested: cargo clippy --workspace --all-targets -- -D warnings
Tested: cargo run -q -p claw-cli -- agents --help
Tested: cargo run -q -p claw-cli -- /agents
Not-tested: Live Anthropic-backed REPL execution of /agents or /skills
2026-04-01 08:30:02 +00:00
Yeachan-Heo
def861bfed Implement upstream slash command parity for plugin metadata surfaces
Wire the Rust slash-command surface to expose the upstream-style /plugin entry and add /agents and /skills handling. The plugin command keeps the existing management actions while help, completion, REPL dispatch, and tests now acknowledge the upstream aliases and inventory views.\n\nConstraint: Match original TypeScript command names without regressing existing /plugins management flows\nRejected: Add placeholder commands only | users would still lack practical slash-command output\nConfidence: high\nScope-risk: narrow\nReversibility: clean\nDirective: Keep /plugin as the canonical help entry while preserving /plugins and /marketplace aliases unless upstream naming changes again\nTested: cargo fmt --all; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace\nNot-tested: Manual interactive REPL execution of /agents and /skills against a live user configuration
2026-04-01 08:19:25 +00:00
Yeachan-Heo
381d061e27 feat: expand slash command surface 2026-04-01 08:15:23 +00:00
Yeachan-Heo
5b95e0cfe5 feat: command surface follow-up integration 2026-04-01 08:10:36 +00:00