Repository navigation
fix(openai): serialize output schema activity input - #198
zawadzkidiana merged 5 commits into
Conversation
Signed-off-by: zawadzkidiana <dzawa@live.de> Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Gitar is not allowed to push to this forked PR. Please enable "Allow edits from maintainers" to allow Gitar to push. |
Signed-off-by: zawadzkidiana <dzawa@live.de> Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: zawadzkidiana <dzawa@live.de> Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: zawadzkidiana <dzawa@live.de> Co-authored-by: Cursor <cursoragent@cursor.com>
|
The remaining 3/4 objective is intentionally not implemented as written because it describes the earlier converter-level approach:
The revised implementation removes As a result:
So the user-visible outcome is covered, but the literal requirement to avoid constructing a schema is superseded: constructing a valid schema for the concrete transport type is now the intended behavior. The full 11-argument null round trip, non-null structured-output round trip, provider-format equivalence, strict non-null rejection, and credential-free worker-side Activity path are all tested. |
Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: zawadzkidiana <dzawa@live.de> Co-authored-by: Cursor <cursoragent@cursor.com>
6dfc0b3 to
adbe8ce
Compare
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Converting OpenAI output schemas into activity-transport metadata could disrupt structured-output model requests if serialization or reconstruction mishandles schema details. Converts OpenAI ✅ 1 closed✅ Performance: Failed TypeAdapter builds are never cached, so they rerun on every null
Verification Objectives 3/4 Repos 1 inspected · PRs 1 inspectedFunctional validation 3 covered / 4 objectives#197 3 covered / 4 objectives Other objectives on this issue, possibly covered elsewhere:
Rules No rules evaluated Broader impact Repos 1 inspected PRs 1 inspectedCross-repo 1 repository inspected 0 open impacts
Cross-PR 1 PR inspected 0 open impactsFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
Good catch! |
Summary
AgentOutputSchemaBaseinstances into a concrete, data-conversion-friendlyCadenceOutputSchemabefore scheduling the model Activity.PydanticDataConverterunchanged instead of teaching the generic converter about one framework's abstract class.output_schema=Noneand non-null structured output.TypeAdapterconstruction by removing the converter-level fallback entirely.Fixes #197.
Validation
uv run pytest -q: passed; integration tests skipped unless explicitly enabled.uv run ruff check cadence tests: passed.uv run ruff format --check cadence tests: passed.uv run --all-extras mypy cadence/ tests/: passed.CadenceModelhandoff is tested to sendCadenceOutputSchemato the Activity.OpenAIActivities.invoke_modeltest reconstructs a function tool, carries structured-output metadata, and calls a mocked model.PydanticSchemaGenerationError; generic converter strictness is unchanged.cadence-ai-samplesrecipe/profile locations: 12/12 passed.cadence-samplesOpenAI environment compiled, passed Ruff, and passed null and structured-output boundary checks.Limitations
cadence-ai-samplescan replace its SHA requirements.