Skip to content

fix: rebootstrap request should not send JSON null body#71

Merged
kalinon merged 1 commit intomainfrom
fix/rebootstrap-null-body
Mar 18, 2026
Merged

fix: rebootstrap request should not send JSON null body#71
kalinon merged 1 commit intomainfrom
fix/rebootstrap-null-body

Conversation

@moltar-bot
Copy link
Copy Markdown
Contributor

Summary

Fix re-bootstrap API calls that were sending JSON null and failing in production with:

Unexpected token 'n', "null" is not valid JSON

Root Cause

Frontend helper rebootstrapAgent() posted null as request body:

  • api.post('/openclaw/agents/config/:id/rebootstrap', null, ...)

With strict JSON parsing on the API stack, primitive null payloads are rejected.

Fix

  • Changed request body from null to {} in web/src/api/client.js
  • Added regression coverage in web/src/api/client.test.js to assert the helper posts {}

Validation

  • npm run test:run -- src/api/client.test.js passes

- avoid posting JSON null to rebootstrap endpoint
- express.json strict mode rejects null payloads as invalid JSON
- send {} so production rebootstrap succeeds consistently
- add client API test coverage for rebootstrap helper

Co-authored-by: Holden Omans <holden.omans@gmail.com>
@kalinon kalinon merged commit fbfc595 into main Mar 18, 2026
9 checks passed
@kalinon kalinon deleted the fix/rebootstrap-null-body branch March 18, 2026 22:31
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.

2 participants