fix(journeys): assign-bot effect re-read parses wrong CRM envelope key → false negative (EVO-1930)#104
Merged
dpaes merged 1 commit intoJun 25, 2026
Conversation
…lope key so assign-bot stops false-failing (EVO-1930)
There was a problem hiding this comment.
Sorry @daniloleonecarneiro, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
dpaes
approved these changes
Jun 25, 2026
dpaes
left a comment
There was a problem hiding this comment.
Approved — deep adversarial review (card + authoritative diff + real code): acceptance criteria met, no blocking findings. Merge intentionally held to land in the coordinated dependency-order pass. Branch is clean vs develop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the EVO-1919 effect-verification hardening. After EVO-1900/D11 made the assign-bot binding actually persist (
agent_bot_inboxesgets a row), the EVO-1919 re-read started reporting a false negative on the assign-bot node:... bot binding does not reflect ... after re-read, failing the node even though the binding was created.Root cause: the re-read already targeted the correct inbox resource (
getInboxBot→GET /inboxes/:id/agent_bot), but theconfirmpredicate parsed the wrong level of the CRM envelope. The CRM (AgentBotSerializer) returns, when a binding exists:{ "success": true, "data": { "agent_bot": { "id": ... }, "configuration": { ... } } }and
data: nullwhen there is no binding. The predicate read.idoff the{ agent_bot, configuration }wrapper (which has noid), so even a present binding yieldedboundBotId === null→ reported as "not persisted".The EVO-1919 unit test masked this because it mocked a divergent shape (
{ data: { data: bot } }) that does not match production.Fix
assign-bot.node.ts: unwrap the bot underdata.agent_bot(tolerating a flattened shape) before readingid; compare string-coerced ids. Re-read still hits the inbox binding, never the conversation.assign-bot.node.spec.ts: mocks now mirror the real CRM envelope ({ success, data: { agent_bot, configuration } | null }). Added EVO-1930 regressions: bound bot confirms success (no false negative), numeric-id coercion, and a different-bound-bot legitimately fails.(This branch also carries the EVO-1919
verifyEffecthelper /journeyVerifyEffectconfig because those are not yet ondevelop; they are byte-identical to EVO-1919 and reconcile cleanly on the integration line.)Test plan
npx tsc -b— clean.npx jest assign-bot— 8/8 pass (incl. new EVO-1930 cases).npx jest crm-client src/modules/temporal/activities/nodes— 135 pass; 3 failures are the pre-existingEVOAI_CRM_API_TOKENctor failures (reproduce ondevelop), none new.Notas
agent_bot_inboxesof the correct inbox.