Skip to content

fix(ui): harden dogfood task execution - #384

Merged
delete-cloud merged 1 commit into
mainfrom
fix/dogfood-task-execution
May 28, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
fix/dogfood-task-execution

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • normalize bash_run timeout arguments and improve simple-command/workspace guidance
  • include workspace root in file/shell path escape errors
  • keep session failure status/details when adapters return error outcomes
  • update stale REPL tests after TUI refactor so full tests are green

Verification

  • uv run pytest tests/ -q
  • uv run ruff check src/coding_agent/tools/shell.py src/coding_agent/tools/file_ops.py src/coding_agent/server/session_manager.py tests/tools/test_shell.py tests/coding_agent/tools/test_file_ops.py tests/ui/test_session_manager_runtime.py tests/coding_agent/test_cli_pipeline.py
  • git diff --check -- .

Summary by CodeRabbit

  • Bug Fixes

    • Improved error messages for file operations and shell commands to better guide users on workspace-path requirements.
    • Enhanced timeout validation for shell commands with clearer error reporting.
    • Refined session failure-status tracking to consistently record error details across different execution scenarios.
  • Tests

    • Added coverage for timeout handling and error messaging in shell operations.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 463f38e0-1033-44ee-96e9-8a814d4fc2dd

📥 Commits

Reviewing files that changed from the base of the PR and between 3c8439f and e483868.

📒 Files selected for processing (7)
  • coding-agent/src/coding_agent/server/session_manager.py
  • coding-agent/src/coding_agent/tools/file_ops.py
  • coding-agent/src/coding_agent/tools/shell.py
  • coding-agent/tests/coding_agent/test_cli_pipeline.py
  • coding-agent/tests/coding_agent/tools/test_file_ops.py
  • coding-agent/tests/tools/test_shell.py
  • coding-agent/tests/ui/test_session_manager_runtime.py

📝 Walkthrough

Walkthrough

This PR refactors session turn-failure state handling to compute and apply turn_status consistently, strengthens workspace-path validation messages to guide users toward correct workspace roots, adds timeout validation for shell commands, expands tool descriptions to clarify workspace constraints, and simplifies test mocking infrastructure.

Changes

Core Infrastructure: Failure State, Validation, and Tool Clarity

Layer / File(s) Summary
Session turn failure state handling
src/coding_agent/server/session_manager.py, tests/ui/test_session_manager_runtime.py
run_agent now computes turn_status once from TurnOutcome and applies it consistently to update session failure metadata conditionally based on runtime store presence and outcome shape. Tests verify session state is marked failed with correct last_failure_details for both runtime-backed and non-backed outcomes.
Workspace path validation and error messaging
src/coding_agent/tools/file_ops.py, src/coding_agent/tools/shell.py, tests/coding_agent/tools/test_file_ops.py, tests/tools/test_shell.py
Error messages for workspace-path escapes now explicitly mention the configured workspace root in both file operations and sandbox commands. Test assertions verify that workspace paths appear in error messages to help users understand constraints.
Timeout validation and wired execution
src/coding_agent/tools/shell.py, tests/tools/test_shell.py
New _positive_int helper validates and normalizes timeout arguments. Validated timeout_seconds is consistently wired into subprocess and sandbox execution paths and reported in error messages. Tests verify timeout normalization from numeric strings and clear error messages for invalid inputs.
Tool description updates for workspace and command guidance
src/coding_agent/tools/file_ops.py, src/coding_agent/tools/shell.py, tests/tools/test_shell.py, tests/coding_agent/tools/test_file_ops.py
Tool decorator descriptions for file operations and shell commands expanded to clarify "under the workspace root" constraints and safe command patterns. Tests verify description content includes required guidance strings.
Test infrastructure simplification and import cleanup
tests/coding_agent/test_cli_pipeline.py, tests/coding_agent/tools/test_file_ops.py
REPL tests no longer patch CodingAgentTUI; they patch adapter methods directly. PipelineAdapter patch binding simplified. Headless pipeline output filtering adjusted. Unused session variables changed to _. Unused imports and return value captures removed.

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 With turn states now clear and timeouts held tight,
Workspace paths guide the agent aright.
Errors now speak where the root truly lies,
Tests simplified, mocks retired—no surprise!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dogfood-task-execution

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@delete-cloud
delete-cloud merged commit e14543f into main May 28, 2026
1 check was pending
@delete-cloud
delete-cloud deleted the fix/dogfood-task-execution branch May 28, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant