iflytek/astron-agent · error · Error

workflow.promptDebugger.nodeDebugRequestFailed

Error message

workflow.promptDebugger.nodeDebugRequestFailed

What it means

useNodeDebugger throws 'workflow.promptDebugger.nodeDebugRequestFailed' when the node to debug cannot be found in the current flow store: manager.getCurrentStore().getState().nodes.find(node => node.id === id) returns undefined, so the debug request is never built.

Solutions

  1. Confirm the node with the given id still exists on the canvas before triggering debug.
  2. Close/reopen the debug panel to refresh the flow reference.
  3. Check for stale closures holding an old node id; read the id from the live store at call time.
  4. Verify manager.currentFlow points at the active workflow, not a stale one.

Example fix

// before
const latestNode = manager.getCurrentStore().getState().nodes.find(node => node.id === id);
if (!latestNode) { throw new Error(t('workflow.promptDebugger.nodeDebugRequestFailed')); }
// after
const latestNode = manager.getCurrentStore().getState().nodes.find(node => node.id === id);
if (!latestNode) {
  console.warn('node not found in flow store', { id, nodeIds: manager.getCurrentStore().getState().nodes.map(n => n.id) });
  throw new Error(t('workflow.promptDebugger.nodeDebugRequestFailed'));
}
Defensive patterns

Strategy: type-guard

Validate before calling

const node = manager.getCurrentStore().getState().nodes.find(n => n.id === id);
if (!node) { message.warning('Node no longer exists'); return; }

Type guard

function nodeExists(nodes: Node[], id: string): nodes is Node[] & { find(n: Node): Node } {
  return nodes.some(n => n.id === id);
}

Try / catch

try {
  await nodeDebugExect(id);
} catch (e) {
  if (e.message.includes('nodeDebugRequestFailed')) {
    message.warning(t('workflow.promptDebugger.nodeDebugRequestFailed'));
  } else { throw e; }
}

Prevention

When it happens

Trigger: handleNodeDebug/nodeDebugExect is invoked with an id that no longer exists in the flow store — the node was deleted, the id is stale from a cached callback, or the store was re-created (flow switched/reset) before the debug ran.

Common situations: Debugging a node after undo/delete, race between canvas re-render and async debug trigger, switching workflow versions while the debug panel is open.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/b5b646848f0a53a3. Report an issue: GitHub.

Appendix: source

Thrown at console/frontend/src/components/workflow/nodes/components/node-operation/index.tsx:158

    const execution = executeNodeDebugRequest({
      workflowIdentity,
      flushCurrentFlow,
      isWorkflowCurrent: identity => {
        const latestFlow = useFlowsManager.getState().currentFlow;
        return (
          currentWorkflowIdentityRef.current === identity &&
          createWorkflowIdentity({ ...latestFlow, routeIdentity }) === identity
        );
      },
      request: signal => {
        const manager = useFlowsManager.getState();
        const latestFlow = manager.currentFlow;
        const latestNode = manager
          .getCurrentStore()
          .getState()
          .nodes.find(node => node.id === id);
        if (!latestNode) {
          throw new Error(t('workflow.promptDebugger.nodeDebugRequestFailed'));
        }
        const requestNode = cloneDeep(
          mergeNodeDebugRequest(latestNode, currentNode, debuggerNode)
        );
        return debugWorkflowNode(
          id,
          {
            flowId: latestFlow?.flowId,
            name: latestFlow?.name,
            description: latestFlow?.description,
            data: {
              nodes: [requestNode],
              edges: [],
            },
          },
          signal
        );
      },

View on GitHub (pinned to 5e758547a8)