Skip to content

feat: fixed with cloud#80

Merged
sawradip merged 3 commits into
mainfrom
sawra/util_fix
Nov 7, 2025
Merged

feat: fixed with cloud#80
sawradip merged 3 commits into
mainfrom
sawra/util_fix

Conversation

@sawradip
Copy link
Copy Markdown
Contributor

@sawradip sawradip commented Nov 7, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved error messages for deploy and upload operations now display structured error codes with actionable suggestions
    • Enhanced error handling for execution failures with better diagnostics
  • Chores

    • Removed database capacity monitoring flag from status command and related capacity checks during agent operations
    • Simplified agent management by removing capacity-based limitations and constraints

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removes capacity and limit management features across CLI, SDK, and schema layers while enhancing error handling with structured error objects containing code, message, and suggestion fields. Updates socket communication with cloud/local URL routing and debug logging.

Changes

Cohort / File(s) Summary
Capacity/Limit System Removal
runagent/cli/commands/db.py, runagent/cli/commands/delete.py, runagent/cli/commands/serve.py, runagent/sdk/db.py, runagent/utils/schema.py
Removes capacity flag from status command, eliminates post-delete capacity display, removes pre-startup capacity check, deletes 7 capacity-related methods from DBService (_load_system_constraints, _get_default_limit, _should_check_api_before_adding, _check_enhanced_limits_with_fallback, clear_limits_cache, get_current_tier_info, get_database_capacity_info), and removes CapacityInfo schema class.
Structured Error Handling Enhancement
runagent/cli/commands/deploy.py, runagent/cli/commands/upload.py, runagent/cli/commands/run.py, runagent/sdk/rest_client.py, runagent/client/client.py
Adds RunAgentExecutionError exception class with code/message/suggestion fields; updates error formatters in deploy/upload to extract and display structured errors; CLI run command adds dedicated RunAgentExecutionError handler; rest_client returns structured error objects with code, message, and suggestion instead of plain strings.
Client Streaming & Error Improvements
runagent/client/client.py
Introduces streaming-aware execution detection, implements error helpers (_build_suggestion, _build_error_from_string), routes streaming entrypoints to run_stream automatically, and wraps errors with descriptive messaging.
Socket Communication Enhancements
runagent/sdk/socket_client.py
Adds cloud/local URL routing for WebSocket connections, introduces Authorization header for cloud endpoints, adds internal _debug method for conditional debug output based on environment variables, standardizes logging through debug pathway.
UI Polish
runagent/cli/commands/init.py
Refactors "Next Steps" display to use path string representation and adds suggestion to run runagent serve from current directory.

Sequence Diagram(s)

sequenceDiagram
    participant CLI
    participant rest_client as REST Client
    participant client as RunAgent Client
    participant remote as Remote Service

    rect rgb(240, 248, 255)
    note over CLI,remote: Previous: Generic error handling
    CLI->>rest_client: Deploy/Upload
    rest_client-->>CLI: Error string or generic message
    end

    rect rgb(240, 255, 240)
    note over CLI,remote: New: Structured error handling
    CLI->>rest_client: Deploy/Upload
    rest_client->>rest_client: Build structured error<br/>{code, message, suggestion}
    rest_client-->>CLI: Structured error object
    CLI->>CLI: Extract code, message, suggestion<br/>Display formatted output
    end
Loading
sequenceDiagram
    participant CLI
    participant client as RunAgent Client
    participant streamer as Stream Handler

    rect rgb(240, 248, 255)
    note over CLI,streamer: New: Streaming-aware execution
    CLI->>client: run(entrypoint)
    alt is_streaming detected
        client->>client: Route to run_stream
        client->>streamer: Initialize stream
        streamer-->>client: Stream generator
        client-->>CLI: Stream for iteration
    else standard execution
        client->>streamer: Standard request
        streamer-->>client: Response
        client-->>CLI: Result
    end
    Note over CLI,streamer: On error: Wrap with<br/>RunAgentExecutionError
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • SDK-level changes: Removal of 7 capacity-related methods from DBService requires careful verification that dependent code paths handle removal correctly
  • Error handling refactoring: Structured error objects flow across rest_client → client → CLI; verify code/message/suggestion extraction and formatting logic in deploy.py, upload.py, and run.py
  • Socket client communication: Cloud/local URL routing and authorization header logic requires validation for both endpoint types
  • Cross-file consistency: Ensure CapacityInfo removal doesn't break schema imports elsewhere; verify RunAgentExecutionError visibility across modules
  • Streaming detection logic: Verify is_streaming behavior routes correctly to run_stream and handles edge cases

Possibly related PRs

Poem

🐰 A Rabbit's Ode to Clean Removal
Away with limits, be they constraints!
Structured errors now clearly paint,
Socket roads both near and far,
A schema purged, errors on par—
Simpler flows make the system shine ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawra/util_fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c02b2d and b845d7e.

📒 Files selected for processing (12)
  • runagent/cli/commands/db.py (3 hunks)
  • runagent/cli/commands/delete.py (0 hunks)
  • runagent/cli/commands/deploy.py (2 hunks)
  • runagent/cli/commands/init.py (1 hunks)
  • runagent/cli/commands/run.py (2 hunks)
  • runagent/cli/commands/serve.py (0 hunks)
  • runagent/cli/commands/upload.py (2 hunks)
  • runagent/client/client.py (4 hunks)
  • runagent/sdk/db.py (2 hunks)
  • runagent/sdk/rest_client.py (4 hunks)
  • runagent/sdk/socket_client.py (8 hunks)
  • runagent/utils/schema.py (0 hunks)

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.

@sawradip sawradip merged commit 0e56a2b into main Nov 7, 2025
1 of 2 checks passed
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