Skip to content

Adopt Roam API 2026-07-07 (envelope, auth errors, chat.message) - #46

Merged
robfig merged 1 commit into
masterfrom
robfig/api-2026-07-07
Jul 17, 2026
Merged

Adopt Roam API 2026-07-07 (envelope, auth errors, chat.message)#46
robfig merged 1 commit into
masterfrom
robfig/api-2026-07-07

Conversation

@robfig

@robfig robfig commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Bring openclaw-roam onto the Roam API 2026-07-07 contract so it is ready for the next minor release.

Changes

  • Pin ROAM_API_VERSION from 2026-06-012026-07-07 (sends Roam-Version / webhook subscribe version).
  • Webhook envelope: unwrap the common v1 shape { type, eventId, timestamp, apiVersion, data } while still accepting bare baseline payloads.
  • chat.message: ignore edit/delete for agent dispatch; only create-path events should wake the agent.
  • Errors: parse v0 (error + code) and v1 (ok:false, code in error); treat token_revoked / invalid_token as permanent auth failures (RoamApiError).
  • Tests for envelope unwrap, dispatch filtering, and error parsing.

Why

Server shipped dated versioning + the 2026-07-07 webhook envelope and structured error codes. Without this pin/parser, a credential created after those versions go live can deliver shapes the plugin cannot parse, or retry forever on revoked tokens.

Test

  • npm test (261 passed in local work)
  • CI green on this PR

Release notes (next minor)

After merge: bump package version (minor), tag/publish. Suggested next version: 0.5.0.

- Pin ROAM_API_VERSION to 2026-07-07 (common v1 webhook envelope).
- Unwrap {type,eventId,timestamp,apiVersion,data} while still accepting bare baseline payloads.
- Parse v0/v1 error bodies; treat token_revoked/invalid_token as permanent auth failures.
- Ignore chat.message edits/deletes for agent dispatch; surface structured RoamApiError.
@robfig
robfig marked this pull request as ready for review July 17, 2026 00:24
@robfig
robfig merged commit e2ba9e9 into master Jul 17, 2026
1 check passed
@robfig
robfig deleted the robfig/api-2026-07-07 branch July 17, 2026 00:24
robfig added a commit that referenced this pull request Jul 17, 2026
Bumps package.json (and lockfile) to 0.5.0.

Since v0.4.3:
- Pin ROAM_API_VERSION to 2026-07-07 and unwrap the common v1 webhook envelope
- Parse v0/v1 error bodies; permanent fail on token_revoked/invalid_token
- Ignore chat.message edits/deletes for agent dispatch (#46)
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