@theokit/sdk 4.2.9 → 4.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -16335,7 +16335,7 @@ function detectPrimaryProvider() {
16335
16335
 
16336
16336
  // src/a2a/subagent.ts
16337
16337
  init_agent_factory_registry();
16338
- var INHERIT_CREDENTIALS = /* @__PURE__ */ Symbol("theokit.subagent.inheritCredentials");
16338
+ var INHERIT_CREDENTIALS = /* @__PURE__ */ Symbol.for("theokit.subagent.inheritCredentials");
16339
16339
  function inheritSubAgentCredentials(tool, creds) {
16340
16340
  const sink = tool[INHERIT_CREDENTIALS];
16341
16341
  if (typeof sink === "function") sink(creds);
@@ -16398,6 +16398,13 @@ async function runChildAgent(spec, input, signal, maxSteps, inherited) {
16398
16398
  };
16399
16399
  const run = await agent.send(input, sendOptions);
16400
16400
  const result = await run.wait();
16401
+ if (result.status === "error") {
16402
+ const cause = result.error;
16403
+ throw new Error(
16404
+ `subagent "${spec.name}" run failed: ${cause?.message ?? "unknown error"}`,
16405
+ cause !== void 0 ? { cause } : void 0
16406
+ );
16407
+ }
16401
16408
  const text = result.result ?? "(no response)";
16402
16409
  return spec.includeToolResults === true ? text + await collectChildToolResults(run) : text;
16403
16410
  } finally {