feat: add interruptConversation method to ConversationClient#174
Conversation
Add interruptConversation() to ConversationClient which calls
POST /api/conversations/{id}/interrupt. Unlike pauseConversation
which waits for the current LLM call to finish, interrupt cancels
the in-flight request so the effect is immediate. The conversation
transitions to paused and can be resumed later.
This aligns with the new interrupt endpoint added in
software-agent-sdk feat/async-llm-completions branch.
Co-authored-by: openhands <openhands@all-hands.dev>
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Implementation is clean and follows existing patterns.
[TESTING GAPS]
- Missing unit test: The test suite in
src/__tests__/api-clients.test.ts(lines 352-394) validates otherConversationClientmethods likepauseConversation, but the newinterruptConversationmethod isn't tested. Add a test call between lines 364-365:await client.pauseConversation('c1'); await client.interruptConversation('c1'); // Add this await client.runConversation('c1');
- No evidence in PR description: Missing concrete proof that the endpoint works (command output, screenshot, or agent conversation link)
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
Simple method addition following established pattern. No breaking changes, no security concerns. The endpoint will be server-validated.
VERDICT:
✅ Worth merging with test added
KEY INSIGHT:
Perfect example of consistent API design - mirrors pauseConversation exactly. Just needs test coverage to match the quality bar set by existing code.
Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:
- Add a
.agents/skills/custom-codereview-guide.mdfile to your branch (or edit it if one already exists) with the/codereviewtrigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.- Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
- When your PR is merged, the guideline file goes through normal code review by repository maintainers.
Resolve with AI? Install the iterate skill in your agent and run
/iterateto automatically drive this PR through CI, review, and QA until it's merge-ready.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/typescript-client/actions/runs/26199033603
- Add interruptConversation call and assertion to ConversationClient unit test (addresses review feedback on missing test coverage) - Update integration test server image to v1.23.0 (b1235d0-python) which includes the /interrupt endpoint - Update AGENTS.md to reflect new server version Co-authored-by: openhands <openhands@all-hands.dev>
|
Addressed the review feedback in 6edcadb:
This comment was created by an AI agent (OpenHands) on behalf of the user. |
- Add HealthStatus interface: /health now returns {status: 'ok'} instead
of plain 'OK' string
- Update ServerClient.getHealth() return type to HealthStatus
- Export HealthStatus from package index
- Fix trajectory download test: v1.23.0 serves real conversation ZIP
archives, so verify ZIP magic bytes instead of a manually created file
Co-authored-by: openhands <openhands@all-hands.dev>
Summary
Adds
interruptConversation(conversationId)toConversationClient, which callsPOST /api/conversations/{id}/interrupt.Motivation
The
software-agent-sdkfeat/async-llm-completionsbranch introduces an/interruptendpoint that immediately cancels in-flight LLM requests, unlike/pausewhich waits for the current LLM call to finish. Theagent-canvasfrontend needs a typed client method to call this endpoint for local-mode conversations.Changes
interruptConversation(conversationId: string): Promise<Success>toConversationClientpauseConversationmethodAPI
pauseConversationPOST /conversations/{id}/pauseinterruptConversationPOST /conversations/{id}/interruptBoth transition the conversation to a paused state that can be resumed via
runConversation.This PR was created by an AI agent (OpenHands) on behalf of the user.
@malhotra5 can click here to continue refining the PR