Skip to content

feat: Chatbot State Management - #1276

Draft
Ayush8923 wants to merge 5 commits into
feat/kaapi-chatbot-flowfrom
feat/chatbot-state-management
Draft

Ayush8923 wants to merge 5 commits into
feat/kaapi-chatbot-flowfrom
feat/chatbot-state-management

Conversation

@Ayush8923

@Ayush8923 Ayush8923 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Closes #1278

Summary

  • chatbot conversation history is now stored on the server, the caller doesn't need to send the full history every time
  • create a session once (POST /chatbot/sessions), you'll get a session_id
  • send every message using that session_id (POST /chatbot/sessions/{session_id}/message), the server tracks history itself
  • on sending a message the API immediately returns 202; the bot's reply is processed in the background and POSTed to the caller webhook_url.
  • system prompt and config get locked while creating the session, the same settings stay throughout the conversation

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

@Ayush8923
Ayush8923 added this pull request to stack #1277 October 20, 2026 06:41
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: ProjectTech4DevAI/kaapi-backend/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4761cadf-5cf3-4b57-8c8b-431ae5575344

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ayush8923 Ayush8923 self-assigned this Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

OpenAPI changes   🟢 4 non-breaking changes

Tip

Safe to merge from an API-contract perspective.

Full changelog  ·  4
Method Path Change
🟢 POST /api/v1/chatbot/message endpoint added
🟢 GET /api/v1/chatbot/sessions endpoint added
🟢 POST /api/v1/chatbot/sessions endpoint added
🟢 POST /api/v1/chatbot/sessions/{session_id}/message endpoint added

main ↔ b0002eba · generated by oasdiff

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.75862% with 54 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/app/api/routes/chatbot/session.py 41.66% 28 Missing ⚠️
backend/app/crud/chatbot.py 36.66% 19 Missing ⚠️
backend/app/celery/utils.py 20.00% 4 Missing ⚠️
backend/app/celery/tasks/job_execution.py 57.14% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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.

Chabot: Server-side chatbot state management

1 participant