# Wire All 4 Microservice Agents Into Chat
Wires all 4 microservice-backed agents into the chat so the LLM can call real services and return session URLs.
---
## Changes
### New
* `src/routes/chat.ts`
* Added a direct HTTP chat endpoint.
* When the LLM calls:
* `start_interview_session`
* `analyze_resume`
* `start_roleplay_session`
* `compute_qscore`
* The route executes real service probes and returns live session URLs.
---
### Fixed
* `src/index.ts`
* Rivet proxy now forwards requests to the engine at `localhost:6420`
instead of using `registry.handler()`.
* Prevents the:
```txt
Runtime already started as runner
```
conflict.
* `src/actors/user-actor.ts`
* `receiveMessage()` now returns:
```ts
{
reply,
sessions: []
}
```
* Includes per-module session URLs in responses.
* `docker-compose.yml`
* Fixed:
* Gitea health check port
* Port mapping
* `A2A_ALLOWED_KEY` default value
* `src/config.ts`
* Added:
```ts
resumeServiceUrl
```
* Configured to use port `8002`.
---
### Rewritten
* `prompts/system.txt`
* Reworked into a conversational step-by-step flow.
* Added explicit rule:
> CALL THE TOOL IMMEDIATELY
---
### Updated
* `agents/*.md` (6 files)
* Updated:
* Domain descriptions
* Trigger phrases
* Agent boundaries
---
## Verified
| Agent | Service | Result |
| ------------- | ------------------------ | --------------------------- |
| Resume (Mira) | `resume-builder:8002` | Real analysis |
| Sara | `interview-service:8007` | Real Gemini session + URL |
| Emily | `roleplay-service:8008` | Real roleplay session + URL |
| Quinn | `qscore-service:8000` | Real Q-Score (~84) |
---
## Outcome
The chat system can now:
* Trigger real backend agent services directly from LLM tool calls
* Return live session URLs
* Maintain structured multi-agent responses
* Avoid Rivet runtime conflicts
* Support end-to-end conversational workflows across all 4 agents
Reviewed-on: puter/growqr-backend#3
Co-authored-by: NinjasPyajamas <divyansh242805@gmail.com>
Co-committed-by: NinjasPyajamas <divyansh242805@gmail.com>
33 lines
1.7 KiB
SQL
33 lines
1.7 KiB
SQL
-- Migration: Central Gitea + Unified Actor (changes.md Phase 6)
|
|
-- Renames/replaces per-user Gitea fields with central Gitea repo references.
|
|
-- Simplifies actors table for unified user actor model.
|
|
-- Adds version tracking columns.
|
|
|
|
-- 1. Drop old per-user Gitea columns from user_stacks
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_container_id;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_container_name;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_host;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_http_port;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_ssh_port;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_admin_user;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_admin_token;
|
|
ALTER TABLE user_stacks DROP COLUMN IF EXISTS gitea_memory_repo;
|
|
|
|
-- 2. Add central Gitea repo fields
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS gitea_repo_name TEXT;
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS gitea_repo_owner TEXT;
|
|
|
|
-- 3. Add version tracking columns (changes.md §9)
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS image_version TEXT;
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS migration_version TEXT;
|
|
ALTER TABLE user_stacks ADD COLUMN IF NOT EXISTS prompt_version TEXT;
|
|
|
|
-- 4. Simplify actors table for unified model
|
|
ALTER TABLE actors DROP COLUMN IF EXISTS sub_type;
|
|
ALTER TABLE actors DROP COLUMN IF EXISTS channel_id;
|
|
ALTER TABLE actors DROP COLUMN IF EXISTS parent_actor_id;
|
|
-- Change kind enum: was ('grow','sub'), now ('user')
|
|
-- Note: Drizzle handles enum changes via application-level migration.
|
|
-- The application code now only uses kind='user'.
|
|
-- Existing rows with kind='grow' or 'sub' will be left as-is (backward compatible reads).
|