@ynhcj/xiaoyi-channel 0.0.191-next → 0.0.192-next
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.js +9 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { registerSelfEvolutionToolResultNudge } from "./src/self-evolution-tool-
|
|
|
11
11
|
import { createBeforePromptBuildHandler } from "./src/skill-retriever/hooks.js";
|
|
12
12
|
import { normalizeToolRetrieverConfig } from "./src/skill-retriever/config.js";
|
|
13
13
|
import { markSubagentSpawned, markSubagentEnded, } from "./src/subagent-wait-state.js";
|
|
14
|
+
import { logger } from "./src/utils/logger.js";
|
|
14
15
|
/**
|
|
15
16
|
* Register the cron detection hook.
|
|
16
17
|
*
|
|
@@ -177,7 +178,7 @@ function registerSubagentHooks(api) {
|
|
|
177
178
|
return;
|
|
178
179
|
const count = markSubagentSpawned(requesterSessionKey);
|
|
179
180
|
if (count > 0) {
|
|
180
|
-
|
|
181
|
+
logger.log(`[XY-SUBAGENT] spawned, requesterSessionKey=${requesterSessionKey.slice(0, 30)}, expected=${count}`);
|
|
181
182
|
}
|
|
182
183
|
});
|
|
183
184
|
// subagent_ended: fires when a subagent run terminates (complete/error/killed).
|
|
@@ -187,33 +188,33 @@ function registerSubagentHooks(api) {
|
|
|
187
188
|
try {
|
|
188
189
|
const requesterSessionKey = ctx?.requesterSessionKey;
|
|
189
190
|
if (!requesterSessionKey) {
|
|
190
|
-
|
|
191
|
+
logger.log(`[XY-SUBAGENT-END] no requesterSessionKey in ctx`);
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
194
|
const transition = markSubagentEnded(requesterSessionKey);
|
|
194
|
-
|
|
195
|
+
logger.log(`[XY-SUBAGENT-END] ended, targetSessionKey=${event?.targetSessionKey?.slice(0, 30)}, outcome=${event?.outcome}, complete=${transition?.isComplete ?? false}, shouldFinalize=${transition?.shouldFinalize ?? false}, transition=${!!transition}`);
|
|
195
196
|
if (transition?.shouldFinalize) {
|
|
196
|
-
|
|
197
|
+
logger.log(`[XY-SUBAGENT-END] Starting finalization...`);
|
|
197
198
|
const [{ resolveXYConfig }, { deliverSubagentFinalResult }, { getXYRuntime }] = await Promise.all([
|
|
198
199
|
import("./src/config.js"),
|
|
199
200
|
import("./src/outbound.js"),
|
|
200
201
|
import("./src/runtime.js"),
|
|
201
202
|
]);
|
|
202
203
|
const rt = getXYRuntime();
|
|
203
|
-
|
|
204
|
+
logger.log(`[XY-SUBAGENT-END] Runtime config type: ${typeof rt.config}, hasConfig=${!!rt.config}`);
|
|
204
205
|
const cfg = rt.config;
|
|
205
206
|
const config = resolveXYConfig(cfg);
|
|
206
|
-
|
|
207
|
+
logger.log(`[XY-SUBAGENT-END] XY config resolved, wsUrl=${config.wsUrl?.slice(0, 20)}`);
|
|
207
208
|
await deliverSubagentFinalResult({
|
|
208
209
|
config,
|
|
209
210
|
state: transition.state,
|
|
210
211
|
reason: "all-subagents-ended-after-parent-settled",
|
|
211
212
|
});
|
|
212
|
-
|
|
213
|
+
logger.log(`[XY-SUBAGENT-END] Finalized A2A session after all subagents ended`);
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
catch (err) {
|
|
216
|
-
|
|
217
|
+
logger.error(`[XY-SUBAGENT-END] Error in subagent_ended hook:`, err);
|
|
217
218
|
}
|
|
218
219
|
});
|
|
219
220
|
}
|