Skip to content

fix(engine): Builder and Autopilot agent steps still run when NEAR AI's embedder does not - #301

Merged
Lexirieru merged 1 commit into
mainfrom
fix/engine-workflow-recall-when-embedder-down
Nov 12, 2026
Merged

Lexirieru merged 1 commit into
mainfrom
fix/engine-workflow-recall-when-embedder-down

Conversation

@Lexirieru

Copy link
Copy Markdown
Contributor

Follow-up to #296. That PR keeps chat alive while NEAR AI's embeddings endpoint hangs, but Builder and Autopilot agent steps still failed. Workflow agent steps take no per-call memory options, and Mastra still tried to embed:

Failed to determine the embedder's output dimension

Fix

  • The Mind agent's memory is now a function (memoryFor() in engine/src/mastra.ts):
    • while embedderReady() is false, it returns the same Memory settings with semanticRecall: false and no vector or embedder;
    • when the embedder answers again, it returns the usual Memory.
  • The agent hands both instances Mastra's storage, so threads, messages and working memory are shared. Chat is unchanged.
  • I tried turning recall off in the agent's defaultOptions first. It did not help, because Mastra reads that setting from the Memory in the workflow path.

Tests

NEAR AI's embedder was still down. Live tests ran with the embedder marked down, which is what the probe does on the server.

  • test/workflows.test.ts: before 7/9 (the agent steps failed on the embedder), after 9/9.
  • test/autopilot.test.ts: all pass.
  • test/threads.test.ts: all pass except the one test that embeds through NEAR AI, which needs the embedder.
  • New memory.test.ts case: embedder down gives the Memory without recall; embedder up gives the usual one.
  • typecheck clean; test:unit 188/188.
  • Load:
    • k6 load/workflow.js -e AGENT=1, 2 VUs for 30 s: 202/202 checks, 0% failed;
    • load/chat.js for 20 s: 60/60 checks, 0% failed.
  • Not run: the full live suite. Its recall tests need NEAR AI's embedder.

Approved by Axel. Merging deploys to the hosted demo.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e

…'s embedder does not

#296 turned semantic recall off per chat call while the embedder hangs,
but workflow agent steps take no per-call memory options. With the
embedder down, a Builder agent step and its Autopilot fires kept failing
with "Failed to determine the embedder's output dimension". Turning recall
off in the agent's defaultOptions was tried first and did not help: Mastra
reads it from the Memory there.

So the agent's memory is a function: while embedderReady() is false it
returns the same Memory settings with semanticRecall: false and no vector
or embedder. The agent hands it Mastra's storage, so threads, messages and
working memory are shared. Chat behaviour is unchanged.

Tests (NEAR AI's embedder still down; live tests run with the embedder
marked down, as the probe does):
- test/workflows.test.ts: before 7/9 (agent steps failed on the embedder),
  after 9/9.
- test/autopilot.test.ts: pass. test/threads.test.ts: all pass except the
  one that embeds through NEAR AI (needs the embedder).
- New memory.test.ts case: down -> Memory without recall, up -> the usual.
- typecheck clean; test:unit 188/188.
- Load: k6 load/workflow.js AGENT=1, 2 VUs 30 s: 202/202 checks, 0% failed;
  load/chat.js 20 s: 60/60 checks, 0% failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
@Lexirieru
Lexirieru merged commit 039ccb3 into main Nov 12, 2026
1 check passed
@Lexirieru
Lexirieru deleted the fix/engine-workflow-recall-when-embedder-down branch November 12, 2026 20:11
@Lexirieru

Copy link
Copy Markdown
Contributor Author

Merged (Axel's approval). @Lin1er @AncungAulia it deploys to the hosted demo automatically. While NEAR AI's embedder is down, Builder and Autopilot agent steps now run without semantic recall instead of failing, the same way chat already did after #296. Nothing changes in FE, BE or env.

@Lin1er

Lin1er commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Live on the hosted demo: main 039ccb3 (automatic deploy after the merge).

  • Before: 2c3da3e, and the box matched git at that revision. CI: passed: test.
  • GET /v1/health → {"ok":true,"engine":true,"revision":"039ccb3"}. No rollback.
  • Rollback target: 2c3da3e (/opt/hellonear/release-old).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants