Skip to content

Sawra/sdk_fix_ts#95

Merged
sawradip merged 3 commits into
mainfrom
sawra/sdk_fix_ts
Nov 14, 2025
Merged

Sawra/sdk_fix_ts#95
sawradip merged 3 commits into
mainfrom
sawra/sdk_fix_ts

Conversation

@sawradip
Copy link
Copy Markdown
Contributor

@sawradip sawradip commented Nov 14, 2025

  • Added detailed logging for cases where the requested entrypoint is not found.
  • Included available entrypoints and architecture information in the error log for better debugging.

Summary by CodeRabbit

  • New Features

    • Added support for the /architecture endpoint across server and SDK implementations.
  • Bug Fixes

    • Improved error messaging to display available entrypoints when a requested entrypoint is not found.
    • Enhanced streaming error handling with more informative error messages and actionable suggestions.
  • Chores

    • Bumped version to 0.1.33.
    • Strengthened code quality standards with stricter type checking and expanded linting rules.

- Added RunAgentExecutionError for improved error reporting in run_stream.
- Implemented detailed error classification and suggestions for streaming failures.
- Updated run_stream method to yield chunks and handle exceptions gracefully.
- Added detailed logging for cases where the requested entrypoint is not found.
- Included available entrypoints and architecture information in the error log for better debugging.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR bumps the project version from 0.1.32 to 0.1.33 across all SDKs (Python, TypeScript, Go, Rust), introduces streaming error classification with RunAgentExecutionError for better diagnostics, adds client metadata attributes (dashboard_url, agent_host, agent_port), enhances entrypoint error logging with architecture details, and tightens mypy and Ruff linting rules in Python tooling.

Changes

Cohort / File(s) Change Summary
Multi-SDK Version Bumps
CHANGELOG.md, pyproject.toml, runagent/__init__.py, runagent/__version__.py, runagent-go/runagent/version.go, runagent-rust/runagent/Cargo.toml, runagent-ts/package.json
Version incremented from 0.1.32 to 0.1.33; CHANGELOG documents new Features section for "/architecture endpoint support."
Python Tooling Configuration
pyproject.toml
Expanded mypy strictness with disallow_incomplete_defs, check_untyped_defs, disallow_untyped_decorators, no_implicit_optional, warn_* flags, and pydantic plugin; enlarged Ruff rule set (F, I, C, B, N, UP, ANN, S, BLE, FBT, COM, DTZ, T20, PT, RSE, RET, SLF, SIM, TID, ARG, PIE, ERA, PD, PGH, PL, TRY, RUF).
Streaming Error Handling
runagent/client/client.py
Added dashboard_url, agent_host, agent_port attributes; introduced _classify_stream_error() and _connection_hint() methods for exception wrapping; run_stream now yields wrapped iterator that converts exceptions to RunAgentExecutionError with friendly messages, codes, and suggestions.
CLI Error Reporting
runagent/cli/commands/run_stream.py
Added import of RunAgentExecutionError; now catches and logs streaming errors in red with cyan suggestions and exits with code 1 if DISABLE_TRY_CATCH not set.
Entrypoint Diagnostics
runagent-ts/src/client/index.ts
Enhanced error logging when entrypoint not found to include computed available entrypoints from agent architecture and request details.

Sequence Diagram

sequenceDiagram
    participant CLI as run_stream.py
    participant Wrap as run_stream wrapper
    participant Sock as Socket Iterator
    participant Classify as _classify_stream_error()
    participant User as User Output

    CLI->>Wrap: Call run_stream()
    Wrap->>Sock: Open socket iterator
    loop Streaming
        Sock->>Wrap: Yield data or raise exception
        Wrap->>Wrap: Check for exception
        alt Exception raised
            Wrap->>Classify: Pass raw error message
            Classify->>Classify: Parse & classify error
            Classify->>Wrap: Return (message, code, suggestion)
            Wrap->>Wrap: Wrap in RunAgentExecutionError
            Wrap->>CLI: Raise wrapped exception
            CLI->>User: Log red error + cyan suggestion
            CLI->>User: Exit with code 1
        else Normal data
            Wrap->>CLI: Yield data
            CLI->>User: Output result
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • runagent/client/client.py requires careful review of the new _classify_stream_error() logic, error classification patterns (connection, auth, timeout, server errors), and the iterator wrapping mechanism in run_stream()
  • runagent/cli/commands/run_stream.py needs verification that error/suggestion display and exit handling integrate correctly with the new RunAgentExecutionError
  • pyproject.toml linting rule additions should be validated to ensure they don't conflict with existing codebase patterns
  • Remaining version bumps and changelog entries are straightforward but span multiple files

Possibly related PRs

  • Sawra/sdk fix ts #90: Introduces the same RunAgentExecutionError model and stream error classification logic across Python and TypeScript SDKs
  • Some corner cases fixed #83: Concurrent changes to dashboard_url and agent metadata/entrypoint handling across client code paths
  • Sawra/sdk fix ts #89: Simultaneous version bumps and tooling updates in the same project metadata files

Poem

🐰 Streams now flow with grace so fine,
Errors caught and classified inline,
Versions bumped from point-two-two,
Diagnostics bright—a hoppy brew! ✨

✨ 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/sdk_fix_ts

📜 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 822fd2b and 020139a.

⛔ Files ignored due to path filters (1)
  • runagent-ts/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • pyproject.toml (3 hunks)
  • runagent-go/runagent/version.go (1 hunks)
  • runagent-rust/runagent/Cargo.toml (1 hunks)
  • runagent-ts/package.json (1 hunks)
  • runagent-ts/src/client/index.ts (1 hunks)
  • runagent/__init__.py (1 hunks)
  • runagent/__version__.py (1 hunks)
  • runagent/cli/commands/run_stream.py (2 hunks)
  • runagent/client/client.py (4 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.

- Updated all SDK versions to 0.1.33
- Generated changelog with git-cliff
@sawradip sawradip merged commit 242a84a into main Nov 14, 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