fix(runtime): deep audit fixes — clarification loop termination + callback alignment
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

CRITICAL:
- ask_clarification now terminates Agent Loop in both run() and run_streaming()
  paths, preventing the LLM from continuing after requesting user clarification

HIGH:
- SaaS relay now forwards plan_mode and subagent_enabled to backend
- GatewayClient.chatStream now supports onThinkingDelta, onSubtaskStatus,
  and token-bearing onComplete — aligned with kernel-types StreamCallbacks
- ZclawStreamEvent type extended with thinking_delta, subtask_status variants
  and input_tokens/output_tokens fields for token tracking via Gateway path
This commit is contained in:
iven
2026-04-06 16:50:48 +08:00
parent 9339b64bae
commit 6a13fff9ec
4 changed files with 99 additions and 5 deletions

View File

@@ -125,6 +125,8 @@ export function createSaaSRelayGatewayClient(
if (opts?.agentId) body['agent_id'] = opts.agentId;
if (opts?.thinking_enabled) body['thinking_enabled'] = true;
if (opts?.reasoning_effort) body['reasoning_effort'] = opts.reasoning_effort;
if (opts?.plan_mode) body['plan_mode'] = true;
if (opts?.subagent_enabled) body['subagent_enabled'] = true;
const response = await saasClient.chatCompletion(body);