mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 09:29:38 +02:00
fix: resolve FlowProcessor topic collisions, librarian timeout, tests
Fix critical bug where all FlowProcessor services shared the same spec
names ("request"/"response"), causing them to steal each other's NATS
topics. Now each service uses unique spec names matching the flow config
topic keys (e.g., "text-completion-request", "prompt-request",
"agent-request").
Fix librarian NATS consumer timeout (500ms → 2000ms, below NATS minimum).
Update seed-config and test-pipeline with correct flow topic mappings.
Add prompt template runner script.
Smoke test results: 11/11 passing (config CRUD, WebSocket, LLM,
librarian CRUD). Agent routing verified via manual curl test.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
515fc0c264
commit
25d4227cb5
8 changed files with 147 additions and 98 deletions
14
ts/scripts/run-prompt.ts
Normal file
14
ts/scripts/run-prompt.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* Start the prompt template service.
|
||||
*
|
||||
* Usage: pnpm tsx scripts/run-prompt.ts
|
||||
*
|
||||
* Env:
|
||||
* NATS_URL (default: nats://localhost:4222)
|
||||
*/
|
||||
import { run } from "../packages/flow/src/prompt/template.js";
|
||||
|
||||
run().catch((err) => {
|
||||
console.error("Prompt service failed:", err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
@ -96,8 +96,6 @@ async function main(): Promise<void> {
|
|||
default: {
|
||||
topics: {
|
||||
// LLM text completion
|
||||
"request": "tg.flow.text-completion-request",
|
||||
"response": "tg.flow.text-completion-response",
|
||||
"text-completion-request": "tg.flow.text-completion-request",
|
||||
"text-completion-response": "tg.flow.text-completion-response",
|
||||
// Prompt service
|
||||
|
|
@ -112,6 +110,9 @@ async function main(): Promise<void> {
|
|||
// Triples
|
||||
"triples-request": "tg.flow.triples-request",
|
||||
"triples-response": "tg.flow.triples-response",
|
||||
// Agent
|
||||
"agent-request": "tg.flow.agent-request",
|
||||
"agent-response": "tg.flow.agent-response",
|
||||
// Chunking pipeline
|
||||
"input": "tg.flow.chunk",
|
||||
"output": "tg.flow.chunk",
|
||||
|
|
|
|||
|
|
@ -127,15 +127,29 @@ async function testConfigDelete(): Promise<boolean> {
|
|||
|
||||
async function testPushFlowConfig(): Promise<boolean> {
|
||||
try {
|
||||
// Push a flow definition that LLM services will pick up
|
||||
// Push a full flow definition with all service topic mappings
|
||||
const res = await post("/api/v1/config", {
|
||||
operation: "put",
|
||||
keys: ["flows"],
|
||||
values: {
|
||||
default: {
|
||||
topics: {
|
||||
request: "tg.flow.text-completion-request",
|
||||
response: "tg.flow.text-completion-response",
|
||||
"text-completion-request": "tg.flow.text-completion-request",
|
||||
"text-completion-response": "tg.flow.text-completion-response",
|
||||
"prompt-request": "tg.flow.prompt-request",
|
||||
"prompt-response": "tg.flow.prompt-response",
|
||||
"graph-rag-request": "tg.flow.graph-rag-request",
|
||||
"graph-rag-response": "tg.flow.graph-rag-response",
|
||||
"document-rag-request": "tg.flow.document-rag-request",
|
||||
"document-rag-response": "tg.flow.document-rag-response",
|
||||
"triples-request": "tg.flow.triples-request",
|
||||
"triples-response": "tg.flow.triples-response",
|
||||
"agent-request": "tg.flow.agent-request",
|
||||
"agent-response": "tg.flow.agent-response",
|
||||
"input": "tg.flow.chunk",
|
||||
"output": "tg.flow.chunk",
|
||||
"triples": "tg.flow.triples",
|
||||
"entity-contexts": "tg.flow.entity-contexts",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue