Make orchestration run input usable: object MCP schema + JSON Logic inputMapping - #240
Merged
Merged
Conversation
The MCP tool schema generator collapsed every OpenAPI `object` body field
to `type: string` because getJsonSchemaType lacked an `object` branch. This
made start-orchestration-run advertise its `input` field as a string, so
object inputs never reached the server and run state was never initialized
from the run input (input: null, state: {}).
Add the missing `object` mapping so object-typed body fields are advertised
correctly across all REST-backed MCP tools. The OpenAPI spec already declared
`input` as object, so no spec/SDK/CLI regeneration is needed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01452qqr3rQwdrBTmGnwtLtc
Deploy Outputs
|
inputMapping values were resolved only as `state.<path>` strings, so there
was no way to pass a literal or compute a derived value inline — every
constant or rename required a dedicated transform node, and run-time input
could not be referenced at all.
Each inputMapping value is now evaluated as JSON Logic against the run
state, reusing the same evaluator as transform and condition nodes:
- single-key objects are expressions — `{var: 'key'}` reads state.key,
`{cat: [...]}`, `{'>': [...]}`, etc. compute derived values
- everything else (string, number, boolean, array, multi-key object) is a
literal, passed through as-is
This makes start-orchestration-run input directly usable: values passed at
run time become initial state and can be referenced with `{var: 'key'}`.
BREAKING CHANGE: inputMapping values are no longer `state.<key>` path
strings. A bare string is now a literal; use `{var: 'key'}` to read from
state. outputMapping is unchanged (still a state path — JSON Logic cannot
express a write target). Tutorial, module docs, smoke tests, and unit tests
migrated to the new syntax.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01452qqr3rQwdrBTmGnwtLtc
arantespp
enabled auto-merge (squash)
June 23, 2026 15:22
Removing resolveFromState dropped orchestrationNodeExecutors.ts branch coverage to 64.13% (below the 65% gate). Add lib tests for the agent and memory_write missing-id DomainError throws, restoring branch coverage to 66.3%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01452qqr3rQwdrBTmGnwtLtc
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.
Two related changes that together make values passed to
start-orchestration-runactually usable downstream.1.
fix(server): MCP tools advertise object-typed body fields as objectsThe MCP tool schema generator (
soatToolsHelpers.ts) collapsed every OpenAPIobjectbody field totype: string, becausegetJsonSchemaTypehad noobjectbranch. Sostart-orchestration-runadvertisedinputas a string and object inputs arrived asnull(state: {}). The OpenAPI spec already declaredinputasobject, so this was purely a generator bug; no spec/SDK/CLI regeneration was needed.if (schemaType === 'array') return 'array'; + if (schemaType === 'object') return 'object'; return 'string';Benefits every object-typed body field across all REST-backed MCP tools, not just orchestration runs.
2.
feat(orchestrations): evaluateinputMappingvalues as JSON LogicinputMappingvalues were resolved only asstate.<path>strings — no literals, no inline computation. Each value is now evaluated as JSON Logic against the run state, reusing the same evaluator astransform/conditionnodes:{"var": "key"}state.key; missing →null)cat,>,if, arithmetic, …)This makes run input directly usable: values passed via
inputbecome initial state and can be referenced with{"var": "key"}— eliminating boilerplatetransformnodes.outputMappingis intentionally unchanged (still astate.<path>write target — JSON Logic is a read-only evaluator and cannot express an assignment destination).inputMappingvalues are no longerstate.<key>path strings. A bare string is now a literal; use{"var": "key"}to read from state. Theorchestrate-a-sonnettutorial, module docs, smoke tests, and affected unit tests are migrated.Tests (red/green TDD)
getJsonSchemaType('object')andbuildInputSchemaobject-prop tests (the red test wasobject → string).applyInputMappingunit suite for JSON Logic semantics; replaced the two obsoleteresolveFromState-branch REST tests with an end-to-end test asserting literal + run-input{var}+ computed expression viarequired_action.context; added a live-server smoke assertion.🤖 Generated with Claude Code