Skip to content

feat: add chatbot webhook flow and tests#1

Merged
suissa merged 1 commit intomainfrom
codex/add-fastify-api-module-with-webhook-route
Nov 12, 2025
Merged

feat: add chatbot webhook flow and tests#1
suissa merged 1 commit intomainfrom
codex/add-fastify-api-module-with-webhook-route

Conversation

@suissa
Copy link
Owner

@suissa suissa commented Nov 12, 2025

Summary

  • add a Fastify webhook server that hands WhatsApp messages to the chatbot orchestrator
  • implement chatbot agents, memory, classification, and OpenAI LLM services with a mocked external appointment API
  • configure Jest with new unit tests and a CI workflow to run them

Testing

  • CI=true npm test
  • npm run check-types

Codex Task

@suissa suissa merged commit b99aed1 into main Nov 12, 2025
1 check passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

https://github.com/suissa/sdk-evolution-chatbot/blob/c2526043cbf665f187139c2523cfdbae888c7eaf/src/chatbot/orchestrator.ts#L52-L54
P1 Badge Send appointment to API only after payment collected

In ChatbotOrchestrator.handleIncomingMessage the integration call is gated on nextAgentName === "appointmentPayment" (lines 52‑54), which refers to the following agent. This means the external API is triggered as soon as the current agent is appointmentProfessional—before a payment response exists—and it is never triggered once the user actually replies to the appointmentPayment prompt (because nextAgentName is then undefined and the method returns). Consequently the external service never sees the completed snapshot and receives incomplete appointment data. The condition needs to check the current agent (agent.name) so the payload is sent after payment information has been collected.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant