feat: add client-driven session support with AgentLoop#2
Merged
Conversation
- 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.
NamanGarg20
reviewed
Jan 19, 2026
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
Description
Type of Change
Related Issues
Closes #
Fixes #
Relates to #
Changes Made
Testing
Test Plan
npm test)Test Commands Run
npm run build npm test npm run lint npm run typecheckScreenshots (if applicable)
Checklist
Code Quality
npm run lint)npm run typecheck)Testing
npm test)Documentation
Git
Breaking Changes
Before:
// Old APIAfter:
// New APIMigration Guide (if applicable)
Additional Notes
Reviewer Notes