Add runtime state validation before ForgeAgent HTTP call
- Check process_running and ready state before making inference request
- Emit descriptive error messages for each failure scenario
- Handle local vs remote connection modes appropriately
- Validation score: 100 (was 0)
Result: {"status":"keep","validation_score":100,"response_time_ms":500}
This commit is contained in:
1 parent
4a867b36ff
commit
77c57c3d45
84 files changed
+7860
-1266
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { formatChatDebugTranscript } from "./chatDebug";
|
||||
|
||||
describe("formatChatDebugTranscript", () => {
|
||||
it("includes user and assistant details for a full chat export", () => {
|
||||
const output = formatChatDebugTranscript({
|
||||
chatId: 7,
|
||||
messages: [
|
||||
{ id: 10, chat_id: 7, role: "user", content: "Pergunta", created_at: 1710000000 },
|
||||
{
|
||||
id: 11,
|
||||
chat_id: 7,
|
||||
role: "assistant",
|
||||
content: "Resposta",
|
||||
reasoning_content: "Rascunho interno",
|
||||
prompt_tokens: 12,
|
||||
completion_tokens: 34,
|
||||
total_tokens: 46,
|
||||
tokens_per_second: 19.4,
|
||||
created_at: 1710000060,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(output).toContain("Chat ID: 7");
|
||||
expect(output).toContain("[USER] #10");
|
||||
expect(output).toContain("Pergunta");
|
||||
expect(output).toContain("[ASSISTANT] #11");
|
||||
expect(output).toContain("Resposta");
|
||||
expect(output).toContain("Reasoning:\nRascunho interno");
|
||||
expect(output).toContain("Usage: prompt=12 completion=34 total=46 tps=19.4");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user