fix: allow slow Pi protocol probes

This commit is contained in:
Ryder Sun committed 2026-09-11 07:51:21 +08:00
1 parent 411d0f92d1
commit 2c0857a85b
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -66,7 +66,7 @@ const AGENT_COMPATIBILITY = Object.freeze({
const event = JSON.parse(line)
return event?.type === 'session' || event?.type === 'message_update' || event?.type === 'message_end'
} catch { return false }
})),
}), 60000),
]),
kimi: profile('0.19.2', '0.32.0', [
probe('kimi-stream', ['--help'], [
@@ -108,12 +108,13 @@ const AGENT_COMPATIBILITY = Object.freeze({
]),
})
function probe(id, args, requiredText, validateOutput = null) {
function probe(id, args, requiredText, validateOutput = null, timeout = null) {
return Object.freeze({
id,
args: Object.freeze([...args]),
requiredText: Object.freeze([...requiredText]),
validateOutput,
timeout,
})
}
+1 -1
View File
@@ -350,7 +350,7 @@ async function probeAgentCapabilities(kind, executable, options = {}) {
const recentCompatible = identity && prior?.identity === identity
&& Date.now() - prior.checkedAt < CAPABILITY_CACHE_TTL_MS
const results = await Promise.all(capabilityProbes(kind).map(async (probe) => {
for (const timeout of [8000, 16000]) {
for (const timeout of probe.timeout ? [probe.timeout] : [8000, 16000]) {
try {
const command = prepareCommandFn(executable, probe.args, options)
const result = await execFileFn(command.command, command.args, {