Skip to content

feat(harness): standardize websocket event contract - #131

Merged
07prajwal2000 merged 2 commits into
Fluxify-rest:mainfrom
07prajwal2000:feat/standardize-harness-events
Jul 28, 2026
Merged

feat(harness): standardize websocket event contract#131
07prajwal2000 merged 2 commits into
Fluxify-rest:mainfrom
07prajwal2000:feat/standardize-harness-events

Conversation

@07prajwal2000

Copy link
Copy Markdown
Collaborator

Summary

  • Standardizes the harness websocket event contract emitted by all model provider wrappers (Anthropic, Google, Mistral, Ollama, OpenAI, OpenRouter) so the client can consume a single shape.
  • Adds a shared jsonbColumn helper for Drizzle schema definitions and applies it in agent-harness-schema.ts / schema.ts.
  • Adds an integrations "basic list" API (dto/repository/route/service) for lightweight integration lookups.
  • Adds HarnessStatusAccordion UI to surface per-node/tool run status in the conversation view.
  • Refactors BaseAgentWrapper (ai-gateway) to extract the tool-execution loop and pure JSON-handling helpers into jsonUtils.ts, reducing complexity while preserving behavior.
  • Fixes a store bug where a completed tool call kept the node's toolName set instead of clearing it.

Test plan

  • bun x tsgo --noEmit (ai-gateway) passes
  • bun test — 340 tests pass across 74 files
  • Pre-commit lint/analysis/tests hook passes

07prajwal2000 and others added 2 commits July 28, 2026 15:51
Every harness update now travels as one event shape instead of five
overlapping ones. `phase`/`node`/`status`/`stepId`/`warning` are replaced by
`currentNode`, `nodeId`, `nodeStatus` (started|running|ended),
`executionType` (agent|tool), `toolName` and `plainTextMessage`.

`nodeId` (`blockBuilder:task-7`) is the client's key: sub-agents run several
instances of the same node concurrently, which `stepId` could not express and
`currentNode` collides on.

Tool calls are no longer a silent gap inside an agent. The tool loop in
models/base.ts dispatches a `tool_call` custom event around every invocation;
HarnessCallbacks renders it as an `executionType: tool` event on the parent's
nodeId, with a result summary (found 3 routes). Sub-agents pass `agentId` so
those events stay attributable.

Runs are now bookended on a synthetic `run` node: an opening event emitted
before the AI-provider probe (so even a dead-provider run has a full log), and
a closing event carrying the complete result -- final markdown, artifactId and
error -- for completed, awaiting_hitl, failed, interrupted and rejected alike.
That closing event is the only termination signal; a terminal `runStatus` on
its own no longer implies one.

Redis already queued events per run and replayed them as `full_state` on
connect; the cap moves 200 -> 500 since tool pairs double the volume.

Documented in apps/ai-gateway/src/harness/harness_events.md, which replaces
harness-client-implementation-guide.md (it described the old contract in full
and would have misled the UI work).

The portal store is migrated to the new contract and its reducer tests
rewritten; the AI components are only patched to compile -- nothing yet renders
tool progress, per-instance sub-agent rows, or run.result.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ons list

Unify harness websocket event contract across model providers, add a
shared jsonbColumn helper for db schema, expose integrations basic-list
API, and add a status accordion UI for harness runs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@07prajwal2000
07prajwal2000 added this pull request to the merge queue Jul 28, 2026
Merged via the queue into Fluxify-rest:main with commit 1681960 Jul 28, 2026
9 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.

1 participant