Skip to content

chore(release): staging to production - 2026.05.20#1085

Merged
maxtechera merged 1 commit into
productionfrom
staging
May 21, 2026
Merged

chore(release): staging to production - 2026.05.20#1085
maxtechera merged 1 commit into
productionfrom
staging

Conversation

@github-actions
Copy link
Copy Markdown

🚀 Release: Staging to Production

Release Date: 2026-05-20

Changes in this release


This PR is automatically created/updated when commits are pushed to staging.
Merging this PR will trigger the release workflow to create a new GitHub release.

…#1084)

## Problem

The MCP `query_vector_store` / `query_vector_store_with_filter` tools
(used by the Kumello agent) intermittently fail with `MCP error -32603:
timeout of 5000ms exceeded`.

Two separate root causes:

1. **5s client timeout with no margin.** `@answerai/answeragent-mcp`'s
axios client defaults to `timeout: 5000`. The `AnswerAgentMCP` node
spawns the MCP as a stdio subprocess, and `MCP/core.ts` spawns it with
`env: { ...serverParams.env, PATH }` — the subprocess does **not**
inherit `process.env`, so setting `API_TIMEOUT` on the service has no
effect.
2. **A slow post-query loop.** `queryVectorStore` reports only
`retriever.invoke()` as `timeTaken` (~0.3–0.5s), but then runs one
`DocumentStoreFileChunk.findOneBy({ storeId, pageContent })` per result
doc — N unindexed lookups on a `text` column. The full request takes
1–4s and the tail crosses 5s under load.

## Changes

- **`AnswerAgentMCP.ts`** — pass `API_TIMEOUT` into the subprocess `env`
(default `30000`, overridable via the `ANSWERAGENT_MCP_API_TIMEOUT`
service env var). 30s is below the MCP SDK's 60s request timeout, so a
genuinely slow call still fails cleanly.
- **`documentstore/index.ts` (`queryVectorStore`)** — replace the
per-doc lookup loop with a single batched `In()` query, guarded against
an empty `docs` array (`In([])` is undefined behavior in TypeORM).
Behavior-equivalent; `In` was already imported.

## Verification

- `pnpm --filter flowise-components build` ✅
- `pnpm --filter flowise build` (server) ✅
- Behavior-equivalent: `doc.id` / `doc.chunkNo` outcomes unchanged,
including the `else` fallback branch.
- `doc.id` / `doc.chunkNo` are consumed only by the Flowise UI "Test
Query" view — the MCP/agent path never reads them, so the loop change
cannot alter agent behavior.

## Risk

Low and contained. Edit 1 only supplies a value to an already-supported
knob and only affects the AnswerAgent MCP subprocess. Edit 2 only
touches data used by an internal UI view, never the agent path.

## Deploy

Requires a redeploy of the Kumello Flowise service after merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
answerai-docs Building Building Preview May 20, 2026 8:28pm
the-answerai Building Building Preview May 20, 2026 8:28pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants