修复: 审批挂起关不了(None分支补emit+恢复对账) + obscura检测区分未装/失败(防误弹)

This commit is contained in:
lxy
2026-08-01 22:26:23 +08:00
parent 31aba79512
commit c76e77bd3c
4 changed files with 163 additions and 34 deletions
+5 -8
View File
@@ -185,7 +185,7 @@
<div class="ai-tool-fetch-line">
<span class="ai-tool-http-method ai-tool-fetch-mode" :class="'ai-tool-fetch-mode--' + (parsed?.render_mode || 'static')">
{{ parsed?.render_mode === 'obscura' ? $t('aiTool.fetchUrlRendered')
: parsed?.render_mode === 'static_fallback' ? $t('aiTool.fetchUrlStatic')
: parsed?.render_mode === 'obscura_failed' ? $t('aiTool.fetchUrlFallback')
: $t('aiTool.fetchUrlStatic') }}
</span>
<code class="ai-tool-http-url">{{ parsed?.url }}</code>
@@ -309,19 +309,16 @@ const grepHitLabel = computed(() => {
})
/**
* fetch_url obscura 未装检测(render=true 但回退静态):
* 后端 render=true 且 obscura 未装/失败/超时 → result.render_mode='static_fallback' + hint 含 obscura 引导。
* 此 computed 供模板显"AI 帮装"按钮 + obscura 未装提示
* 检测条件:render_mode==='static_fallback'(后端保证此值仅 render 分支回退时设,普通静态是 'static')。
* 双重确认 hint 含 obscura(防御后端未来改字段名),任一命中即视为未装。
* fetch_url obscura 未装检测(render=true 但 obscura 未装):
* 后端 render=true 且 obscura 未装 → result.render_mode='obscura_not_installed' + hint 引导。
* 装了但失败/超时 → 'obscura_failed'(不弹引导,只 hint)。此 computed 仅未装弹"AI 帮装"。
*/
const obscuraMissing = computed(() => {
if (props.tc.name !== 'fetch_url') return false
const r = parsed.value
if (!r) return false
const mode = typeof r.render_mode === 'string' ? r.render_mode : ''
const hint = typeof r.hint === 'string' ? r.hint : ''
return mode === 'static_fallback' || hint.toLowerCase().includes('obscura')
return mode === 'obscura_not_installed'
})
/**