Commit Graph

502 Commits

Author SHA1 Message Date
Jobdori
06a93a57c7 merge: clawcode-issue-9410-cli-ux-progress-status-clear into main 2026-04-03 05:08:19 +09:00
Jobdori
698ce619ca merge: clawcode-issue-9409-config-env-project-permissions into main 2026-04-03 05:08:08 +09:00
Jobdori
c87e1aedfb merge: clawcode-issue-9408-api-sse-streaming into main 2026-04-03 05:08:03 +09:00
Jobdori
bf848a43ce merge: clawcode-issue-9407-cli-agents-mcp-config into main 2026-04-03 05:07:56 +09:00
Yeachan-Heo
8805386bea merge: clawcode-issue-9406-commands-skill-install into main 2026-04-02 13:55:42 +00:00
Yeachan-Heo
c9f26013d8 merge: clawcode-issue-9405-plugins-execution-pipeline into main 2026-04-02 13:55:42 +00:00
Yeachan-Heo
703bbeef06 merge: clawcode-issue-9404-tools-plan-worktree into main 2026-04-02 13:55:42 +00:00
Yeachan-Heo
5d8e131c14 Wire plugin hooks and lifecycle into runtime startup
PARITY.md is stale relative to the current Rust plugin pipeline: plugin manifests, tool loading, and lifecycle primitives already exist, but runtime construction only consumed plugin tools. This change routes enabled plugin hooks into the runtime feature config, initializes plugin lifecycle commands when a runtime is built, and shuts plugins down when runtimes are replaced or dropped.\n\nThe test coverage exercises the new runtime plugin-state builder and verifies init/shutdown execution without relying on global cwd or config-home mutation, so the existing CLI suite stays stable under parallel execution.\n\nConstraint: Keep the change inside the current worktree and avoid touching unrelated pre-existing edits\nRejected: Add plugin hook execution inside the tools crate directly | runtime feature merging is the existing execution boundary\nRejected: Use process-global CLAW_CONFIG_HOME/current_dir in tests | races with the existing parallel CLI test suite\nConfidence: high\nScope-risk: moderate\nReversibility: clean\nDirective: Preserve plugin runtime shutdown when rebuilding LiveCli runtimes or temporary turn runtimes\nTested: cargo test -p rusty-claude-cli build_runtime_\nTested: cargo test -p rusty-claude-cli\nNot-tested: End-to-end live REPL session with a real plugin outside the test harness
2026-04-02 10:04:54 +00:00
Yeachan-Heo
9c67607670 Expose configured MCP servers from the CLI
PARITY.md called out missing MCP management in the Rust CLI, so this adds a focused read-only /mcp path instead of expanding the broader config surface first.

The new command works in the REPL, with --resume, and as a direct 7⠋ 🦀 Thinking...8✘  Request failed
 entrypoint. It lists merged MCP server definitions, supports detailed inspection for one server, and adds targeted tests for parsing, help text, completion hints, and config-backed rendering.

Constraint: Keep the enhancement inside the existing Rust slash-command architecture
Rejected: Extend /config with a raw mcp dump only | less discoverable than a dedicated MCP workflow
Confidence: high
Scope-risk: narrow
Directive: Keep /mcp read-only unless MCP lifecycle commands gain shared runtime orchestration
Tested: cargo test -p commands parses_supported_slash_commands
Tested: cargo test -p commands rejects_invalid_mcp_arguments
Tested: cargo test -p commands renders_help_from_shared_specs
Tested: cargo test -p commands renders_per_command_help_detail_for_mcp
Tested: cargo test -p commands ignores_unknown_or_runtime_bound_slash_commands
Tested: cargo test -p commands mcp_usage_supports_help_and_unexpected_args
Tested: cargo test -p commands renders_mcp_reports_from_loaded_config
Tested: cargo test -p rusty-claude-cli parses_login_and_logout_subcommands
Tested: cargo test -p rusty-claude-cli parses_direct_agents_mcp_and_skills_slash_commands
Tested: cargo test -p rusty-claude-cli repl_help_includes_shared_commands_and_exit
Tested: cargo test -p rusty-claude-cli completion_candidates_include_workflow_shortcuts_and_dynamic_sessions
Tested: cargo test -p rusty-claude-cli resume_supported_command_list_matches_expected_surface
Tested: cargo test -p rusty-claude-cli init_help_mentions_direct_subcommand
Tested: cargo run -p rusty-claude-cli -- mcp help
Not-tested: Live MCP server connectivity against a real remote or stdio backend
2026-04-02 10:04:40 +00:00
Yeachan-Heo
5f1eddf03a Preserve usage accounting on OpenAI SSE streams
OpenAI chat-completions streams can emit a final usage chunk when the\nclient opts in, but the Rust transport was not requesting it. This\nkeeps provider config on the client and adds stream_options.include_usage\nonly for OpenAI streams so normalized message_delta usage reflects the\ntransport without changing xAI request bodies.\n\nConstraint: Keep xAI request bodies unchanged because provider-specific streaming knobs may differ\nRejected: Enable stream_options for every OpenAI-compatible provider | risks sending unsupported params to xAI-style endpoints\nConfidence: high\nScope-risk: narrow\nDirective: Keep provider-specific streaming flags tied to OpenAiCompatConfig instead of inferring provider behavior from URLs\nTested: cargo clippy -p api --tests -- -D warnings\nTested: cargo test -p api openai_streaming_requests -- --nocapture\nTested: cargo test -p api xai_streaming_requests_skip_openai_specific_usage_opt_in -- --nocapture\nTested: cargo test -p api request_translation_uses_openai_compatible_shape -- --nocapture\nTested: cargo test -p api stream_message_normalizes_text_and_multiple_tool_calls -- --exact --nocapture\nNot-tested: Live OpenAI or xAI network calls
2026-04-02 10:04:14 +00:00
Yeachan-Heo
e780142886 Make /skills install reusable skill packs
The Rust commands layer could list skills, but it had no concrete install path.
This change adds /skills install <path> and matching direct CLI parsing so a
skill directory or markdown file can be copied into the user skill registry
with a normalized invocation name and a structured install report.

Constraint: Keep the enhancement inside the existing Rust commands surface without adding dependencies
Rejected: Full project-scoped registry management | larger parity surface than needed for one landed path
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: If project-scoped skill installation is added later, keep the install target explicit so command discovery and tool resolution stay aligned
Tested: cargo test -p commands
Tested: cargo clippy -p commands --tests -- -D warnings
Tested: cargo test -p rusty-claude-cli parses_direct_agents_and_skills_slash_commands
Tested: cargo test -p rusty-claude-cli parses_login_and_logout_subcommands
Tested: cargo clippy -p rusty-claude-cli --tests -- -D warnings
Not-tested: End-to-end interactive REPL invocation of /skills install against a real user skill registry
2026-04-02 10:03:22 +00:00
Yeachan-Heo
901ce4851b Preserve resumable history when clearing CLI sessions
PARITY.md and the current Rust CLI UX both pointed at session-management polish as a worthwhile parity lane. The existing /clear flow reset the live REPL without telling the user how to get back, and the resumed /clear path overwrote the saved session file in place with no recovery handle.

This change keeps the existing clear semantics but makes them safer and more legible. Live clears now print the previous session id and a resume hint, while resumed clears write a sibling backup before resetting the requested session file and report both the backup path and the new session id.

Constraint: Keep /clear compatible with follow-on commands in the same --resume invocation
Rejected: Switch resumed /clear to a brand-new primary session path | would break the expected in-place reset semantics for chained resume commands
Confidence: high
Scope-risk: narrow
Directive: Preserve explicit recovery hints in /clear output if session lifecycle behavior changes again
Tested: cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli --test resume_slash_commands
Tested: cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli --bin claw clear_command_requires_explicit_confirmation_flag
Not-tested: Manual interactive REPL /clear run
2026-04-02 10:03:07 +00:00
Yeachan-Heo
e102af6ef3 Honor project permission defaults when CLI has no override
Runtime config already parsed merged permissionMode/defaultMode values, but the CLI defaulted straight from RUSTY_CLAUDE_PERMISSION_MODE to danger-full-access. This wires the default permission resolver through the merged runtime config so project/local settings take effect when no env override is present, while keeping env precedence and locking the behavior with regression tests.

Constraint: Must preserve explicit env override precedence over project config
Rejected: Thread permission source state through every CLI action | unnecessary refactor for a focused parity fix
Confidence: high
Scope-risk: narrow
Directive: Keep config-derived defaults behind explicit CLI/env overrides unless the upstream precedence contract changes
Tested: cargo test -p rusty-claude-cli permission_mode -- --nocapture
Tested: cargo test -p rusty-claude-cli defaults_to_repl_when_no_args -- --nocapture
Not-tested: interactive REPL/manual /permissions flows
2026-04-02 10:02:26 +00:00
Yeachan-Heo
5c845d582e Close the plan-mode parity gap for worktree-local tool flows
PARITY.md still flags missing plan/worktree entry-exit tools. This change adds EnterPlanMode and ExitPlanMode to the Rust tool registry, stores reversible worktree-local state under .claw/tool-state, and restores or clears the prior local permission override on exit. The round-trip tests cover both restoring an existing local override and cleaning up a tool-created override from an empty local state.

Constraint: Must keep the override worktree-local and reversible without mutating higher-scope settings
Rejected: Reuse Config alone with no state file | exit could not safely restore absent-vs-local overrides
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep plan-mode state tracking aligned with settings.local.json precedence before adding worktree enter/exit tools
Tested: cargo test -p tools
Not-tested: interactive CLI prompt-mode invocation of the new tools
2026-04-02 10:01:33 +00:00
YeonGyu-Kim
93d98ab33f fix: suppress WIP dead_code/clippy warnings in rusty-claude-cli
CLI binary has functions from multiple parity branches that aren't fully
wired up yet. Allow dead_code and related clippy lints at crate level
until the wiring is complete.
2026-04-02 18:38:47 +09:00
YeonGyu-Kim
6e642a002d Merge branch 'dori/commands-parity' into main 2026-04-02 18:37:00 +09:00
YeonGyu-Kim
b92bd88cc8 Merge branch 'dori/tools-parity' 2026-04-02 18:36:41 +09:00
YeonGyu-Kim
ef48b7e515 Merge branch 'dori/hooks-parity' into main 2026-04-02 18:36:37 +09:00
YeonGyu-Kim
12bf23b440 Merge branch 'dori/mcp-parity' 2026-04-02 18:35:38 +09:00
YeonGyu-Kim
d88144d4a5 feat(commands): slash-command validation, help formatting, CLI wiring
- Add centralized validate_slash_command_input for all slash commands
- Rich error messages and per-command help detail
- Wire validation into CLI entrypoints in main.rs
- Consistent /agents and /skills usage surface
- Verified: cargo test -p commands 22 passed, integration test passed, clippy clean
2026-04-02 18:24:47 +09:00
YeonGyu-Kim
73187de6ea feat(tools): error propagation, REPL timeout, edge-case validation
- Replace NotebookEdit expect() with Result-based error propagation
- Add 5-minute guard to Sleep duration
- Reject empty StructuredOutput payloads
- Enforce timeout_ms in REPL via spawn+try_wait+kill
- Add edge-case tests: excessive/zero sleep, empty output, REPL timeout
- Verified: cargo test -p tools 35 passed, clippy clean
2026-04-02 18:24:39 +09:00
YeonGyu-Kim
3b18ce9f3f feat(mcp): add toolCallTimeoutMs, timeout/reconnect/error handling
- Add toolCallTimeoutMs to stdio MCP config with 60s default
- tools/call runs under timeout with dedicated Timeout error
- Handle malformed JSON/broken protocol as InvalidResponse
- Reset/reconnect stdio state on child exit or transport drop
- Add tests: slow timeout, invalid JSON response, stdio reconnect
- Verified: cargo test -p runtime 113 passed, clippy clean
2026-04-02 18:24:30 +09:00
YeonGyu-Kim
f2dd6521ed feat(hooks): add PostToolUseFailure propagation, validation, and tests
- Hook runner propagates execution failures as real errors, not soft warnings
- Conversation converts failed pre/post hooks into error tool results
- Plugins fully support PostToolUseFailure: aggregation, resolution, validation, execution
- Add ordering + short-circuit tests for normal and failure hook chains
- Add missing PostToolUseFailure manifest path rejection test
- Verified: cargo clippy --all-targets -- -D warnings passes, cargo test 94 passed
2026-04-02 18:24:12 +09:00
YeonGyu-Kim
29530f9210 Merge remote-tracking branch 'origin/dori/plugins-parity' 2026-04-02 18:16:07 +09:00
YeonGyu-Kim
c9ff4dd826 Merge remote-tracking branch 'origin/dori/hooks-parity' 2026-04-02 18:16:07 +09:00
YeonGyu-Kim
97be23dd69 feat(hooks): add hook error propagation and execution ordering tests
- Add proper error types for hook failures
- Improve hook execution ordering guarantees
- Add tests for hook execution flow and error handling
- 109 runtime tests pass, clippy clean
2026-04-02 18:16:00 +09:00
YeonGyu-Kim
46853a17df feat(plugins): add plugin loading error handling and manifest validation
- Add structured error types for plugin loading failures
- Add manifest field validation
- Improve plugin API surface with consistent error patterns
- 31 plugins tests pass, clippy clean
2026-04-02 18:15:37 +09:00
YeonGyu-Kim
485b25a6b4 fix: resolve merge conflicts between commands-parity and stub-commands branches
- Fix Commit/DebugToolCall variant mismatch (unit variants, not struct)
- Apply cargo fmt
2026-04-02 18:14:09 +09:00
YeonGyu-Kim
cad4dc3a51 Merge remote-tracking branch 'origin/dori/integration-tests' 2026-04-02 18:12:34 +09:00
YeonGyu-Kim
ece246b7f9 Merge remote-tracking branch 'origin/dori/stub-commands'
# Conflicts:
#	rust/crates/commands/src/lib.rs
2026-04-02 18:12:34 +09:00
YeonGyu-Kim
23c8b42175 Merge remote-tracking branch 'origin/dori/commands-parity' 2026-04-02 18:12:10 +09:00
YeonGyu-Kim
cb72eb1bf8 Merge remote-tracking branch 'origin/dori/tools-parity' 2026-04-02 18:12:10 +09:00
YeonGyu-Kim
65064c01db test(cli): expand integration tests for CLI args, config, and slash command dispatch
- Add 8 new integration tests for resume slash commands
- Test CLI arg parsing, slash command matching, config defaults
- All 102 tests pass (94 unit + 4 + 4 integration), clippy clean
2026-04-02 18:11:25 +09:00
YeonGyu-Kim
6c5ee95fa2 feat(cli): implement stub slash commands with proper scaffolding
- Add implementations for Bughunter, Commit, Pr, Issue, Ultraplan, Teleport, DebugToolCall
- Add helper functions for git operations, file handling, and progress reporting
- Refactor command dispatch for cleaner match arms
- 96 CLI tests pass + 1 integration test pass
2026-04-02 18:10:32 +09:00
YeonGyu-Kim
54fa43307c feat(runtime): add tests and improve error handling across runtime crate
- Add 20 new tests for conversation, session, and SSE modules
- Improve error paths in conversation.rs and session.rs
- Add SSE event parsing tests
- 126 runtime tests pass, clippy clean, fmt clean
2026-04-02 18:10:12 +09:00
YeonGyu-Kim
731ba9843b feat(commands): add slash command argument validation with clear error messages
- Add SlashCommandParseError type for structured parse failures
- Validate arguments for all arg-taking commands (permissions, config, session, plugin, agents, skills, teleport, resume)
- No-arg commands now reject unexpected arguments
- Error messages include help text with usage/summary/category
- 21 commands tests pass, clippy clean
2026-04-02 18:09:48 +09:00
YeonGyu-Kim
f5fa3e26c8 refactor(tools): replace panic paths with proper error handling
- Convert permission_mode_from_plugin panic to Result-based error
- Add input validation for tool dispatch edge cases
- Propagate signature changes to main.rs caller
- 29 tools tests pass, clippy clean
2026-04-02 18:04:55 +09:00
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