Skip to content

feat: SDK sessions, async queue processing with HITL support#5

Open
TiGz wants to merge 2 commits intomainfrom
feature/sdk-sessions-async-hitl
Open

feat: SDK sessions, async queue processing with HITL support#5
TiGz wants to merge 2 commits intomainfrom
feature/sdk-sessions-async-hitl

Conversation

@TiGz
Copy link
Copy Markdown
Owner

@TiGz TiGz commented Jan 3, 2026

Summary

This PR adds three major features to the Claude Code Plugin REST API:

SDK Sessions

  • Add sessionId and forkSession support to agent requests
  • Enable multi-turn conversations via session resume/fork
  • Return sessionId in agent responses for future continuation

Async Queue Processing (QueueModule)

  • PostgreSQL-backed job queue via pg-boss for async agent execution
  • PgBossService for queue operations (send, work, fetch, complete, fail)
  • AsyncWorkerService for processing agent requests from queues
  • HITLService for human-in-the-loop tool approval with pattern matching
  • ChannelResolverService for routing responses via reply channels
  • Support for queue:// and webhook:// reply channel URIs

Queue E2E Tests

  • Testcontainers-based e2e tests for queue infrastructure
  • PostgreSQL service added to docker-compose for development
  • Graceful test skipping when Docker is unavailable
  • Tests verify job lifecycle, batch processing, and channel integration

Test plan

  • All 43 e2e tests pass (with Docker running)
  • Queue tests skip gracefully when Docker unavailable
  • Unit tests pass for HITL service
  • Manual testing of session resume/fork
  • Manual testing of queue-based async agent execution

🤖 Generated with Claude Code

TiGz and others added 2 commits January 3, 2026 12:37
…2e tests

SDK Sessions:
- Add sessionId and forkSession support to agent requests
- Enable multi-turn conversations via session resume/fork
- Return sessionId in agent responses for future continuation

Async Queue Processing (QueueModule):
- Add pg-boss backed job queue for async agent execution
- PgBossService for queue operations (send, work, fetch, complete, fail)
- AsyncWorkerService for processing agent requests from queues
- HITLService for human-in-the-loop tool approval with pattern matching
- ChannelResolverService for routing responses via reply channels
- Support for queue:// and webhook:// reply channel URIs

Queue E2E Tests:
- Add testcontainers-based e2e tests for queue infrastructure
- PostgreSQL service added to docker-compose for development
- Graceful test skipping when Docker is unavailable
- Tests verify job lifecycle, batch processing, and channel integration

Documentation:
- Updated CLAUDE.md with QueueModule architecture and testing docs
- Updated README.md with queue testing section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The QueueModule expects factory instances that can create ReplyChannel
objects, not ReplyChannel instances directly. Updated the type definition
to use ReplyChannelFactory consistently across:
- QueueModuleOptions.replyChannels
- QueueModule.createProviders()
- Exported types from index.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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