v0.3.0: Fix runtime protocol, add production features and API complet…#2
Merged
ajit-zer07 merged 1 commit intomainfrom Mar 21, 2026
Merged
v0.3.0: Fix runtime protocol, add production features and API complet…#2ajit-zer07 merged 1 commit intomainfrom
ajit-zer07 merged 1 commit intomainfrom
Conversation
…eness Phase 1 (P0) — Fix StreamSession integration: - Add RuntimeSessionHandle and openSession() for unified bidirectional gRPC streams - Rewrite RunExecutor to create session + send kickoff through single stream - Update StreamConsumer to accept session handle, fall back to streamSession() on reconnect - Update MockRuntimeProvider with openSession() implementation Phase 2 (P0) — Fix Signal & ContextUpdate: - Send signals with empty session_id/mode per runtime validation rules - Remove POST /runs/:id/context (runtime doesn't support ContextUpdate) - Add Ack error checking in send() and startSession() Phase 3 (P1) — Production correctness: - Fix StreamConsumer.isHealthy() to track per-stream connected state - Set schemaVersion on control-plane-emitted events - Add .unref() to StreamHub cleanup timer - Add RuntimeCapabilities storage in provider registry - Add expires_at column to runtime_sessions (migration 0004) Phase 4 (P2) — API completeness: - Add pagination metadata (data/total/limit/offset) to GET /runs and GET /audit - Add DELETE /runs/:id (terminal only), POST /runs/:id/archive - Add GET /audit with filtering - Add POST /admin/circuit-breaker/reset - Add POST /runs/:id/clone Phase 5 (P2-P3) — Observability & notifications: - Add webhook system with HMAC-SHA256 signing, retry, and management endpoints - Fire webhooks on run.started/completed/failed/cancelled - Add batch cancel/export endpoints - Add JSONL export format (?format=jsonl) - Add Prometheus circuit breaker metrics (failures_total, success_total) Phase 6 (P3) — Tech debt: - Add npm run proto:sync script - Fix InlineArtifactStorageProvider.retrieve() to read from DB - Improve normalizer deriveSubject() to extract entity IDs from decoded payloads - Update normalizer schemaVersion to use PROJECTION_SCHEMA_VERSION Migrations: 0004_session_ttl.sql, 0005_webhooks.sql
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.
PR description:
Summary
unary Send + read-only StreamSession RPCs, but the runtime expects a single bidirectional stream.
Introduced
openSession()which opens one bidi stream for session creation, kickoff messages,and event consumption.
session_idandmodefor Signal messages.Removed unsupported
POST /runs/:id/contextendpoint.timer cleanup, session TTL persistence, runtime capability storage.
circuit breaker admin reset, run cloning.
retry on run state changes, batch cancel/export, JSONL export format, Prometheus circuit breaker
metrics.
entity ID extraction.
Changes
42 files changed, 1249 insertions, 140 deletions
New files (12)
drizzle/0004_session_ttl.sqlexpires_atto runtime_sessionsdrizzle/0005_webhooks.sqlscripts/proto-sync.shsrc/controllers/admin.controller.tssrc/controllers/audit.controller.tssrc/controllers/webhook.controller.tssrc/dto/clone-run.dto.tssrc/dto/list-audit-query.dto.tssrc/dto/paginated-response.dto.tssrc/dto/webhook.dto.tssrc/webhooks/webhook.repository.tssrc/webhooks/webhook.service.tsKey modified files
src/contracts/runtime.tsRuntimeSessionHandle,openSession(),RuntimeCapabilitiessrc/runtime/rust-runtime.provider.tsopenSession(), add ack error checkingsrc/runs/run-executor.service.tsopenSession()flow, fix signal sending, add clonesrc/runs/stream-consumer.service.tssrc/runs/run-manager.service.tssrc/storage/run.repository.tssrc/controllers/runs.controller.tsTest plan
npx tsc --noEmit— 0 errorsnpm run lint— 0 errors (98 pre-existing warnings)npm test— 247 tests passed across 20 suites (up from 244)