Skip to content

feat: add client-driven session support with AgentLoop#2

Merged
JacobFV merged 8 commits intomainfrom
feature/desktop-agent-support
Jan 19, 2026
Merged

feat: add client-driven session support with AgentLoop#2
JacobFV merged 8 commits intomainfrom
feature/desktop-agent-support

Conversation

@JacobFV
Copy link
Copy Markdown
Contributor

@JacobFV JacobFV commented Jan 14, 2026

  • Add AgentSessionType for desktop, android, quantum session types
  • Add step() method to SessionsResource for client-driven execution
  • Add listModels() method with optional filter parameter
  • Add AgentLoop class for async event loop management
    • Supports start/pause/resume/stop control
    • Callbacks for screenshot capture, action execution, thinking
  • Add DesktopAction, StepDesktopResponse, ModelsResponse types
  • Add requestUrl() to HTTPClient for arbitrary URL requests
  • Update README with client-driven sessions documentation
  • Add test script for integration testing

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvement

Related Issues

Closes #
Fixes #
Relates to #

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

Test Plan

  • All existing tests pass (npm test)
  • Added new tests for new functionality
  • Tested manually in development environment
  • Tested with different Node.js versions (if applicable)

Test Commands Run

npm run build
npm test
npm run lint
npm run typecheck

Screenshots (if applicable)

Checklist

Code Quality

  • Code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Lint passes (npm run lint)
  • Type checking passes (npm run typecheck)

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally (npm test)
  • I have tested the changes manually

Documentation

  • I have updated the README.md (if applicable)
  • I have updated the CHANGELOG.md
  • I have added/updated JSDoc comments for public APIs
  • I have updated examples (if applicable)

Git

  • My commits follow the project's commit message conventions
  • I have rebased/merged from the latest main branch
  • My branch is up to date with the main branch

Breaking Changes

Before:

// Old API

After:

// New API

Migration Guide (if applicable)

Additional Notes

Reviewer Notes

JacobFV and others added 6 commits January 12, 2026 13:50
- Add AgentSessionType for desktop, android, quantum session types
- Add step() method to SessionsResource for client-driven execution
- Add listModels() method with optional filter parameter
- Add AgentLoop class for async event loop management
  - Supports start/pause/resume/stop control
  - Callbacks for screenshot capture, action execution, thinking
- Add DesktopAction, StepDesktopResponse, ModelsResponse types
- Add requestUrl() to HTTPClient for arbitrary URL requests
- Update README with client-driven sessions documentation
- Add test script for integration testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Read response body as text before attempting JSON parsing to prevent "body already consumed" errors.
- Update error handling to ensure proper fallback to text response if JSON parsing fails.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… for improved routing

- Introduced sessionId parameter in AgentLoopOptions and updated AgentLoop class to utilize it.
- Modified step method in SessionsResource to accept sessionId for routing in shared sandbox.
- Updated related documentation comments for clarity.
JacobFV and others added 2 commits January 19, 2026 10:05
… API

Only expose managed-cdp, external-cdp, and desktop session types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@NamanGarg20 NamanGarg20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JacobFV JacobFV merged commit c1cca00 into main Jan 19, 2026
6 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.

2 participants