Code Q&A agent for frontend/backend repositories, built on top of Chat SDK and Codex SDK.
This service receives Slack mentions, synchronizes two local repositories (frontend and backend), asks Codex for an answer in read-only mode, and replies in the same Slack thread.
The architecture is channel-agnostic: Slack is the active adapter in v1, but core logic is isolated so other adapters can be added later.
- Runtime: Node.js 20+
- Language: TypeScript
- HTTP server: Hono +
@hono/node-server - Channel layer:
chat(Vercel Chat SDK) - Slack integration:
@chat-adapter/slack - Thread state:
- In-memory state:
@chat-adapter/state-memory - Optional Redis state:
@chat-adapter/state-redis
- In-memory state:
- Inference:
@openai/codex-sdk
- Node.js 20+
codexinstalled and authenticated (codex login status)- Slack app configured with webhook/events
- Valid absolute paths for frontend and backend repositories
Create a local .env file from the template:
npm install
cp .env.example .envRequired environment variables:
FRONTEND_REPO_PATHBACKEND_REPO_PATHSLACK_SIGNING_SECRET- Slack auth:
- Single-workspace:
SLACK_BOT_TOKEN - Multi-workspace OAuth:
SLACK_CLIENT_ID+SLACK_CLIENT_SECRET(+SLACK_ENCRYPTION_KEY)
- Single-workspace:
Common optional variables:
BOT_USERNAMEPORTREDIS_URLCODEX_MODELCODEX_REASONING_EFFORT
Development:
npm run devType-check:
npm run checkBuild:
npm run build- The bot responds to Slack mentions.
- On the first mention in a thread, it subscribes to that thread.
- In subscribed threads, follow-up messages must still mention the bot.
- Before every answer, it synchronizes both repos from
main:git fetch origin --prunegit checkout maingit pull --ff-only origin maingit rev-parse HEAD
- Codex runs in read-only mode against local repositories.
- User-facing answers are in Spanish and avoid code snippets/blocks, file references, and sync metadata.
- While processing, Slack status text is updated through staged/rotating progress messages.
- Healthcheck:
GET /health - Slack webhook:
POST /api/webhooks/slack - Slack OAuth callback (multi-workspace only):
GET /api/slack/install/callback
src/server: HTTP/webhook entrypointssrc/bot: channel event handlerssrc/core: orchestration and response policysrc/repos: repository sync servicessrc/inference: Codex client and promptssrc/context: prompt context builders
To add another channel adapter:
- Register the adapter in
src/bot/chat.ts. - Add its webhook entrypoint in
src/server. - Reuse
QAOrchestratorfromsrc/core.