mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
🐛 fix(gateway): route approve/reject via lab flag, not transient server op state After the coordinator fix for `waiting_for_human` (#13860) the paused `execServerAgentRuntime` op is marked `completed` client-side as soon as the server emits `agent_runtime_end`. `startOperation` then runs `cleanupCompletedOperations(30_000)`, which deletes any op completed more than 30 seconds ago — so by the time the user sees the InterventionBar and clicks approve/reject, the running (or recently completed) server op is gone. The previous `#hasRunningServerOp` check therefore kept returning false against a live Gateway backend, flipping approve/reject into the client-mode `internal_execAgentRuntime` branch and stranding the server-side paused conversation. Switch the helper to `#shouldUseGatewayResume`, which checks the same `isGatewayModeEnabled()` lab flag used to route the initial send. The signal now mirrors how the conversation was dispatched and survives the op-cleanup window. New regression test exercises the post-coordinator-fix state: the paused `execServerAgentRuntime` op is explicitly `completed` before the approve call runs, and we still expect the Gateway branch to fire with `decision='approved'`. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| business | ||
| components | ||
| config | ||
| const | ||
| envs | ||
| features | ||
| helpers | ||
| hooks | ||
| layout | ||
| libs | ||
| locales | ||
| routes | ||
| server | ||
| services | ||
| spa | ||
| store | ||
| styles | ||
| types | ||
| utils | ||
| auth.ts | ||
| initialize.ts | ||
| instrumentation.node.ts | ||
| instrumentation.ts | ||
| proxy.ts | ||
| vite.d.ts | ||