Mintplex-Labs/anything-llm · warning

no pending help request with that id

Error message

no pending help request with that id

What it means

Returned (HTTP 404) by POST /api/v1/help-response when requestId does not equal workspace.pendingHelp?.id. This is the endpoint's idempotency guard: a successful response sets workspace.pendingHelp = null (api.js:434), so a second submit with the same id no longer matches and 404s. It also fires when no help request is pending at all, or after a session reset (which nulls pendingHelp).

Source

Thrown at open-computer/services/interface-service/routes/api.js:441

      }

      const responseRpc = workspace.pendingHelp.rpc || workspace.piRpc;
      if (responseRpc) {
        responseRpc.write(
          JSON.stringify({
            type: "extension_ui_response",
            id: requestId,
            value: response || "",
          }) + "\n",
        );
        workspace.pendingHelp = null;
        console.log(`[pi] Help response sent: ${response}`);
        return res.json({ status: "ok" });
      }
      return res.status(500).json({ error: "agent not running" });
    }

    return res.status(404).json({ error: "no pending help request with that id" });
  });

  // ── Headless root ──────────────────────────────────────────────────────

  app.get("/", (req, res, next) => {
    if (!HEADLESS) return next();
    res.json({
      service: "interface-service",
      agent: AGENT_NAME,
      status: "ok",
      agent_status: currentAgentStatus(),
      headless: true,
      uptime_seconds: Math.floor(process.uptime()),
      platform: process.platform,
      arch: process.arch,
      memory_mb: Math.floor(process.memoryUsage.rss() / 1024 / 1024),
      port: process.env.PORT || 8080,
      endpoints: {

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Treat the 404 as 'already answered or dismissed' and refresh the pending-help state instead of retrying blindly
  2. Disable the submit control after the first successful POST so the same requestId is never sent twice
  3. If the agent should re-ask, send a new prompt via /api/v1/prompt rather than replaying the old requestId

Example fix

// before
function onSubmit(response) {
  post('/api/v1/help-response', {requestId: this.requestId, response});
}

// after: single-flight submit + tolerate the already-handled case
async onSubmit(response) {
  if (this.submitting) return;
  this.submitting = true;
  try {
    await post('/api/v1/help-response', {requestId: this.requestId, response});
  } catch (e) {
    if (e.status === 404) console.warn('help request already handled');
    else throw e;
  } finally {
    this.submitting = false;
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// Only respond while this requestId is still the active pending request
const {pendingHelp} = await getPendingHelp(); // whatever state feed your UI uses
if (!pendingHelp || pendingHelp.id !== this.requestId) return; // stale dialog — do not POST

Try / catch

try { await postHelpResponse(requestId, response); }
catch (e) {
  if (e.status === 404) return refreshPendingHelp(); // already answered elsewhere
  throw e;
}

Prevention

When it happens

Trigger: Re-POSTing a help response with a requestId that was already answered (double-click, UI retry, page reload resubmitting the dialog); posting an id captured from an older ask_for_help event; posting after POST /api/v1/session/new cleared pendingHelp; answering from a second browser tab after the first tab already responded.

Common situations: Duplicate form submissions without disabling the submit button; two tabs racing to answer the same ask_for_help (first wins, second 404s); reconnect flows replaying stale dialog state after the agent restarted its session.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/4ad909aa402f628b. Report an issue: GitHub.