Skip to content

fix(zapier): send the create-memory request body - #13542

Merged
kodjima33 merged 4 commits into
BasedHardware:mainfrom
ajanraj:fix/zapier-create-memory-body
Sep 25, 2026
Merged

kodjima33 merged 4 commits into
BasedHardware:mainfrom
ajanraj:fix/zapier-create-memory-body

Conversation

@ajanraj

@ajanraj ajanraj commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Create Memory Zapier action could never work: its request shorthand defined body as an async function that never returned, so Zapier's request pipeline resolved it to undefined and every Zap run POSTed /zapier/action/memories with an empty body — rejected with HTTP 422 because text and source are required by ZapierActionCreateConversation (plugins/zapier/models.py).

Replaced the dead function with the shorthand's declarative body map covering every declared input field (text, source, language, started_at, finished_at, geolocation). zapier-platform-core substitutes whole-value {{bundle.inputData.*}} references with their raw values (objects survive as objects), and removeMissingValuesFrom.body drops unsupplied optionals.

The same PR closes the residual 422 paths the now-live body exposed: source has no backend default and Geolocation requires latitude/longitude (backend/models/geolocation.py), so those fields are now required at the Zap form boundary; the message value the backend accepts is now selectable.

Test plan

  • Regression test intercepts the POST with nock and asserts the full JSON body — required fields, finished_at, and a whole-value geolocation object — plus that unset optionals are omitted. It fails on the old code (request arrived with no body) and passes after.
  • npm test in plugins/zapier/omi-zap: 3 tests, 2 suites green (jest --testTimeout 10000, parallel and --runInBand both verified).
  • Field names, enum values (audio_transcript/message/other_text), and the required/optional split verified against ZapierActionCreateConversation in plugins/zapier/models.py, ExternalIntegrationConversationSource in backend/models/conversation_enums.py, Geolocation in backend/models/geolocation.py, and the handler in plugins/zapier/conversation_created.py — these are the external source for the rewritten test's expectations.

Notes: the replaced placeholder test made a live network call; the new tests are hermetic. No CI lane currently discovers this package's jest tests — they run via npm test in the package directory. Could not exercise a real Zapier run (no app deployment/credentials); the test drives the action through appTester and the real zapier-platform-core HTTP pipeline against a mocked endpoint.

Failure-Class: none

Closes #13541

Review in cubic

Copilot AI lite review requested due to automatic review settings September 11, 2026 23:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Disable unmatched network access in tests and add the test suite to CI.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes the Zapier Create Memory action by sending its request body and aligning input validation with the backend contract.

Changes:

  • Replaces the empty async body with a declarative payload map.
  • Requires valid source and geolocation inputs.
  • Adds Nock regression tests and dependency updates.
File summaries
File Summary
plugins/zapier/omi-zap/test/creates/create_memory.test.js Verifies complete and minimal request payloads.
plugins/zapier/omi-zap/package.json Adds Nock for HTTP mocking.
plugins/zapier/omi-zap/package-lock.json Locks Nock and related dependencies.
plugins/zapier/omi-zap/creates/create_memory.js Defines request serialization and input validation.
Review details

Files not reviewed (1)

  • plugins/zapier/omi-zap/package-lock.json: Generated file
  • Files reviewed: 3/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

ajanraj added a commit to ajanraj/omi that referenced this pull request Sep 12, 2026
…eolocation

Review feedback on BasedHardware#13542: nock only intercepts matching requests, so
without disableNetConnect a URL or query drift would have POSTed to the
live Modal endpoint instead of failing. Also adds the case where the
geolocation carries only its required children (latitude/longitude are
the contract's sole required fields) and the optional children must be
absent from the posted body rather than nulled into it.

Verified: npm test in plugins/zapier/omi-zap — 4 tests pass.
ajanraj added a commit to ajanraj/omi that referenced this pull request Sep 12, 2026
Review feedback on BasedHardware#13542: the new request-body regression tests were
not discovered by any CI lane. Registers the suite in
checks-manifest.yaml through a wrapper that reuses an installed
dependency tree when it satisfies package.json and otherwise falls back
to a lockfile-pinned npm ci, so the local lane needs no network once
provisioned.

Verified: python3 .github/scripts/run_checks.py --lane ci --check-id
omi-zap-tests --base origin/main -> PASS; --lane local --list selects
omi-zap-tests via plugins/zapier/omi-zap/** on this diff;
.github/scripts/test_run_checks.py -> 52 passed.
@Git-on-my-level

Copy link
Copy Markdown
Member

Verified end to end — this is a complete, correct fix for the create-memory action. Per file:

  • plugins/zapier/omi-zap/creates/create_memory.js — the old const body = async (z, bundle) => { { bundle.inputData.source; } } was dead code resolving to undefined, so every run POSTed empty and 422'd; the declarative body map now covers all six declared inputs. Cross-checked names and requiredness against ZapierActionCreateConversation (plugins/zapier/models.py) and Geolocation (backend/models/geolocation.py) — exact match, including the newly selectable message value, which exists in ExternalIntegrationConversationSource.
  • Making source required and latitude/longitude required inside the (still optional) geolocation group is right: the backend has no default for source, and Geolocation requires the coordinates. Since every prior run failed with 422, tightening the form contract cannot break working Zaps — there were none.
  • test/creates/create_memory.test.js — ran the suite in a clean container: 2 suites / 4 tests green. Reverting create_memory.js to base makes all three new tests fail, so the regression pin is real. The suite also proves the two subtle claims: whole-value {{bundle.inputData.geolocation}} posts as an object, and removeMissingValuesFrom.body drops unset optionals.
  • package.json / package-lock.json — [email protected] (+ json-stringify-safe, propagate) is dev-only and all three integrity hashes match the public npm registry. Standard HTTP-mocking tooling for this kind of test.
  • run-tests.sh — clean: set -euo pipefail, cd to the script dir, reuses an installed tree when valid, falls back to lockfile-pinned npm ci, then exec npm test.
  • .github/checks-manifest.yaml — the omi-zap-tests entry follows the existing schema and conventions (including the manifest self-trigger pattern used by many other entries) and registers both local and ci lanes.
  • plugins/README.md — accurate; both claims (run-tests.sh existence, omi-zap-tests registration) are true at this head.

Great first contribution — fix, regression coverage, and CI registration together fully close #13541.

Since this adds a devDependency and registers a new CI check, those two surfaces need a human maintainer's sign-off before merge; both verified clean from my side.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution dependency-review Touches dependencies or lockfiles; needs dependency review workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior javascript JavaScript or TypeScript implementation work labels Sep 12, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legit zapier create-memory body fix with checks-manifest test wiring; holding at approve (dependency-review + workflow-review gate labels touch package-lock.json/checks-manifest.yaml) per standing policy to not auto-merge gated PRs.

@ajanraj
ajanraj force-pushed the fix/zapier-create-memory-body branch from 32ffea0 to de73cd1 Compare September 12, 2026 20:32
ajanraj added a commit to ajanraj/omi that referenced this pull request Sep 12, 2026
…eolocation

Review feedback on BasedHardware#13542: nock only intercepts matching requests, so
without disableNetConnect a URL or query drift would have POSTed to the
live Modal endpoint instead of failing. Also adds the case where the
geolocation carries only its required children (latitude/longitude are
the contract's sole required fields) and the optional children must be
absent from the posted body rather than nulled into it.

Verified: npm test in plugins/zapier/omi-zap — 4 tests pass.
ajanraj added a commit to ajanraj/omi that referenced this pull request Sep 12, 2026
Review feedback on BasedHardware#13542: the new request-body regression tests were
not discovered by any CI lane. Registers the suite in
checks-manifest.yaml through a wrapper that reuses an installed
dependency tree when it satisfies package.json and otherwise falls back
to a lockfile-pinned npm ci, so the local lane needs no network once
provisioned.

Verified: python3 .github/scripts/run_checks.py --lane ci --check-id
omi-zap-tests --base origin/main -> PASS; --lane local --list selects
omi-zap-tests via plugins/zapier/omi-zap/** on this diff;
.github/scripts/test_run_checks.py -> 52 passed.
@Git-on-my-level

Copy link
Copy Markdown
Member

Re-verified after the rebase (head is now de73cd1) — the conclusion from my earlier review still holds. New facts worth recording:

  • The rebase carried the same four commits (identical subjects and author dates), and I re-checked the substance at the new head: the jest suite runs green in a clean container (2 suites / 4 tests, test/creates and test/triggers both). Swapping creates/create_memory.js back to main's version makes the three body tests fail with a posted body of "" — the regression pin is real and specific to the dead async-body bug.
  • The new omi-zap-tests CI lane has now actually executed on this PR: Hygiene selected it from the manifest and reported PASS omi-zap-tests (7.01s) with a cold npm ci install and 4/4 tests. The registration is proven live in CI, not just schema-valid.
  • The three failing checks are unrelated to this PR. Dart Analyze & Tests fails on compile errors in app/test/providers/deletion_consistency_test.dart (this PR touches nothing under app/); Desktop Swift Static & Test Contracts fails on a wall-clock budget overrun (2320s vs the 1800s macOS suite budget) and Desktop Swift Build & Tests is that lane's downstream gate. None of the seven changed files can affect those lanes.
  • One bookkeeping note: the approval on this PR was recorded against the pre-rebase commit, which the rebase replaced. Since the carried changes are identical, a quick re-confirm on the current head should be trivial.

dependency-review and workflow-review remain the two surfaces needing maintainer sign-off (devDependency addition + CI check registration); both re-verified clean here.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@ajanraj
ajanraj force-pushed the fix/zapier-create-memory-body branch from de73cd1 to 2906b06 Compare September 13, 2026 16:57
ajanraj added a commit to ajanraj/omi that referenced this pull request Sep 13, 2026
…eolocation

Review feedback on BasedHardware#13542: nock only intercepts matching requests, so
without disableNetConnect a URL or query drift would have POSTed to the
live Modal endpoint instead of failing. Also adds the case where the
geolocation carries only its required children (latitude/longitude are
the contract's sole required fields) and the optional children must be
absent from the posted body rather than nulled into it.

Verified: npm test in plugins/zapier/omi-zap — 4 tests pass.
ajanraj added a commit to ajanraj/omi that referenced this pull request Sep 13, 2026
Review feedback on BasedHardware#13542: the new request-body regression tests were
not discovered by any CI lane. Registers the suite in
checks-manifest.yaml through a wrapper that reuses an installed
dependency tree when it satisfies package.json and otherwise falls back
to a lockfile-pinned npm ci, so the local lane needs no network once
provisioned.

Verified: python3 .github/scripts/run_checks.py --lane ci --check-id
omi-zap-tests --base origin/main -> PASS; --lane local --list selects
omi-zap-tests via plugins/zapier/omi-zap/** on this diff;
.github/scripts/test_run_checks.py -> 52 passed.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genuine bug fix: create_memory's request body was a dead async function that never returned, so every Zap POSTed an empty body and 422'd against the backend model. Root cause verified, replaced with correct declarative body map, CI green, hermetic tests added.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open on 2906b0644a53.

DIRTY zapier create-memory request body + tests; kodjima APPROVE ≠ merge while conflicting.

kodjima APPROVE is the size gate, not maintainer merge.

I am not approving or merging this SHA.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Zapier create_memory on main still uses an async body function, so the POST body is empty. This head sends text, source, language, and the time fields, and the jest test records that body. 2906b0644a53 conflicts, so rebase it. This stays open and unapproved.

— Astar, on behalf of @aryanorastar

The Create Memory action's request shorthand held `body` as an async
function that never returned, so Zapier's request pipeline received
undefined and every Zap run POSTed /zapier/action/memories with an
empty body — rejected 422 because `text` and `source` are required by
ZapierActionCreateConversation (plugins/zapier/models.py).

Replace the dead function with the shorthand's declarative body map so
each declared input field reaches the wire; zapier-platform-core
substitutes whole-value {{bundle.inputData.*}} references with their
raw values and removeMissingValuesFrom.body drops unsupplied
optionals.

Tests: new nock-based regression test intercepts the POST and asserts
the input fields land in the JSON body while unset optionals are
omitted; it failed before the fix (request arrived with no body) and
passes after. `npm test` in plugins/zapier/omi-zap: 3 tests, 2 suites
green.

Failure-Class: none
With the body now actually sent, a Zap configured without a required
key still 422s: source has no backend default, and Geolocation needs
latitude/longitude (backend/models/geolocation.py). Mark all three
required at the form boundary and expose the `message` source value the
backend accepts but the Zap could not select.

Tests: nock regression test now asserts the whole posted body,
including a whole-value geolocation object and finished_at.
`npm test` in plugins/zapier/omi-zap: 3 tests, 2 suites green.

Failure-Class: none
…eolocation

Review feedback on BasedHardware#13542: nock only intercepts matching requests, so
without disableNetConnect a URL or query drift would have POSTed to the
live Modal endpoint instead of failing. Also adds the case where the
geolocation carries only its required children (latitude/longitude are
the contract's sole required fields) and the optional children must be
absent from the posted body rather than nulled into it.

Verified: npm test in plugins/zapier/omi-zap — 4 tests pass.
Review feedback on BasedHardware#13542: the new request-body regression tests were
not discovered by any CI lane. Registers the suite in
checks-manifest.yaml through a wrapper that reuses an installed
dependency tree when it satisfies package.json and otherwise falls back
to a lockfile-pinned npm ci, so the local lane needs no network once
provisioned.

Verified: python3 .github/scripts/run_checks.py --lane ci --check-id
omi-zap-tests --base origin/main -> PASS; --lane local --list selects
omi-zap-tests via plugins/zapier/omi-zap/** on this diff;
.github/scripts/test_run_checks.py -> 52 passed.
@ajanraj
ajanraj force-pushed the fix/zapier-create-memory-body branch from 2906b06 to 75cdff6 Compare September 22, 2026 14:46
@ajanraj

ajanraj commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (e9ece01). The only conflict was in .github/checks-manifest.yaml — upstream added a block of new check entries; ours is appended after them. omi-zap-tests and the manifest self-tests pass locally on the new head.

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create Memory on main still uses an async body that never returns, so the POST to /zapier/action/memories goes out empty and 422s. 75cdff696a6e sends the declarative map (text, source, language, times, geolocation). source is required and includes message; latitude/longitude are required only inside the optional geolocation group. That matches ZapierActionCreateConversation and Geolocation.

Hygiene on this SHA ran omi-zap-tests and passed both Jest files. nock is dev-only. The manifest only appends that check. The two queued Desktop Swift jobs do not touch these files.

Not merging. kodjima’s approval is on 2906b06, not this head. #14369 is a later mixed copy and stays open.

@aryanorastar

Copy link
Copy Markdown
Collaborator

The Zapier create-memory body is still empty on main. Hygiene is green on 75cdff696a6e, and the Desktop Swift checks are still queued. This stays open and unapproved.

— Astar, on behalf of @aryanorastar

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genuine bug fix (dead async body -> 422 on every Zap run), scoped diff, CI green, tests added, trusted reviewer aryanorastar confirmed — confidence 5/5, merging.

@kodjima33
kodjima33 merged commit a52689c into BasedHardware:main Sep 25, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency-review Touches dependencies or lockfiles; needs dependency review javascript JavaScript or TypeScript implementation work positive-signal Automation verified a genuine fix/quality contribution workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty proposal] fix(zapier): Create Memory action sends empty body (every run 422s)

5 participants