Skip to content

fix: add schema_version to writeback method (closes OB1 writeback failure)#290

Open
cosmo-sage wants to merge 1 commit into
NateBJones-Projects:mainfrom
cosmo-sage:fix/schema-version-writeback
Open

fix: add schema_version to writeback method (closes OB1 writeback failure)#290
cosmo-sage wants to merge 1 commit into
NateBJones-Projects:mainfrom
cosmo-sage:fix/schema-version-writeback

Conversation

@cosmo-sage
Copy link
Copy Markdown

Bug Summary

The nbj-ob1-agent-memory plugin v0.1.1 writeback() method silently fails because it doesn't send schema_version in the request body.

The agent-memory-api server expects schema_version: "openbrain.openclaw.writeback.v1" as a required field. Without it, writeback calls fail validation.

The Fix

Added schema_version: "openbrain.openclaw.writeback.v1" to the writeback body object, mirroring the pattern already used in the recall() method.

Impact

  • Affects all 3 nodes: Slate, Clay, Doctor (all running v0.1.1)
  • recall() works because schema_version is included there
  • writeback() broken — session-end capture fails silently
  • Workaround: direct REST calls with correct schema string work fine

Test

curl -X POST "https://gjclaovlofzdmawbbaly.supabase.co/functions/v1/agent-memory-api/writeback" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <access_key>" \
  -d '{"schema_version":"openbrain.openclaw.writeback.v1","workspace_id":"test","memory_payload":{},"provenance":{}}'

@github-actions
Copy link
Copy Markdown

Hey @cosmo-sage — welcome to Open Brain Source! 👋

Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what.

Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days.

If you have questions, check out CONTRIBUTING.md or open an issue.

@github-actions github-actions Bot added the integration Contribution: MCP extension or capture source label May 13, 2026
@jonbjornn
Copy link
Copy Markdown

I would suggest putting schema_version after the ...input parameters from the model. In case the model decides to supply this value and supplies an incompatible string like "v1.0" or "2026.x.x". As my testing showed would sometimes happen. Simply changing the order prevents this issue:

    schema_version: "openbrain.openclaw.writeback.v1",
    ...input,
    provenance: {

vs

    ...input,
    schema_version: "openbrain.openclaw.writeback.v1",
    provenance: {

@alanshurafa alanshurafa added review: needs-author-response Contributor response or clarification needed area: integrations Review area: integrations/MCP/capture sources alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role labels May 20, 2026
@alanshurafa
Copy link
Copy Markdown
Collaborator

Thanks for the contribution, and for tracking down the writeback failure. The fix is on the right track.

Worth folding in before this moves forward: @jonbjornn's comment above is a valid catch. As written, schema_version sits before the ...input spread, so if the model supplies its own schema_version the model's value would override the hardcoded "openbrain.openclaw.writeback.v1". Moving the line to just after ...input makes the intended value always win:

...input,
schema_version: "openbrain.openclaw.writeback.v1",
provenance: {

That is a one-line reorder. Recommend author refresh with that change before this goes to a maintainer.

— Alan (community reviewer; non-binding)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role area: integrations Review area: integrations/MCP/capture sources integration Contribution: MCP extension or capture source review: needs-author-response Contributor response or clarification needed status: superseded-candidate Community reviewer believes newer work may supersede this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants