Skip to content

(MOT-3868) fix(harness): publish typed request schema for harness::react - #405

Merged
ytallo merged 1 commit into
mainfrom
fix/harness-react-schema
Jul 3, 2026
Merged

(MOT-3868) fix(harness): publish typed request schema for harness::react#405
ytallo merged 1 commit into
mainfrom
fix/harness-react-schema

Conversation

@ytallo

@ytallo ytallo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a typed ReactEvent wire-schema wrapper for harness::react while preserving the lossless serde_json::Value runtime payload (same pattern as NotifyAgentEvent in harness::notify_agent).
  • Register harness::react with that typed request shape so release interface collection no longer publishes AnyValue for its request schema.
  • Add harness::react to the harness schema catalog and commit the new golden snapshot.

Root Cause

The harness release publish gate collected worker-interface.json successfully, then failed because harness::react.request_schema was the permissive AnyValue schema. The handler was registered with a raw serde_json::Value event payload even though the registry publish gate requires typed function request/response schemas.

Validation

  • UPDATE_GOLDENS=1 cargo test --manifest-path harness/Cargo.toml --test schemas
  • cargo test --manifest-path harness/Cargo.toml
  • cargo clippy --manifest-path harness/Cargo.toml --all-targets -- -D warnings
  • git diff --check

Fixes MOT-3868

Summary by CodeRabbit

  • New Features

    • Added support for a new reactive event handler in the harness.
    • Event payloads now accept and preserve any valid JSON value, improving compatibility with a wider range of inputs.
  • Bug Fixes

    • Registration now uses a concrete request schema, avoiding issues with unsupported untyped payload definitions.
    • Updated the published function catalog and schema expectations to include the new handler.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 3, 2026 10:56pm
workers-tech-spec Ready Ready Preview, Comment Jul 3, 2026 10:56pm

Request Review

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 32 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c2c97b55-0d92-4443-bf40-2147ea79cf87

📥 Commits

Reviewing files that changed from the base of the PR and between 9b1dd79 and 5f167a4.

📒 Files selected for processing (5)
  • harness/src/functions/mod.rs
  • harness/src/functions/react.rs
  • harness/src/surface.rs
  • harness/tests/golden/schemas/harness.react.json
  • harness/tests/schemas.rs

📝 Walkthrough

Walkthrough

The harness::react function registration now uses a typed ReactEvent(pub Value) wrapper implementing JsonSchema instead of a generic Value, with corresponding catalog wiring, golden schema file, and registration-order test updates.

Changes

ReactEvent typed schema integration

Layer / File(s) Summary
ReactEvent type and schema
harness/src/functions/react.rs
Adds ReactEvent(pub Value) wrapper implementing schemars::JsonSchema covering all JSON value types.
Registration and catalog wiring
harness/src/functions/mod.rs, harness/src/surface.rs
Updates register_all to use typed ReactEvent and pass ev.0 to react::handle; imports and registers ReactEvent/ReactResult in the catalog under REACT_ID.
Golden schema and tests
harness/tests/golden/schemas/harness.react.json, harness/tests/schemas.rs
Adds golden request/response schema for harness::react and updates expected registration order to include the new function id.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • iii-hq/workers#333: Both PRs modify the same register_all function-registration wiring to add new handlers to the harness catalog.

Poem

A rabbit hops with schema in paw,
ReactEvent typed, no more raw!
Catalog updated, tests all align,
Golden JSON schemas, oh so fine,
Hop, hop, hooray for react::handle's new law! 🐇

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/harness-react-schema

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ytallo
ytallo merged commit 5a484fd into main Jul 3, 2026
70 of 73 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