Guard nil confirm card in surface action dispatcher #173

Merged
weichen merged 1 commits from fix/surface-action-nil-card into main 2026-10-12 04:08:58 +00:00
+5 -1
View File
@@ -535,7 +535,11 @@ func Run(opt Options) error {
if resp.Receipt.State != "" {
state = string(resp.Receipt.State)
}
return surfacesvc.ActionOutcome{State: state, CardID: resp.Card.ID, Receipt: resp.Receipt, Payload: resp.Payload}, nil
cardID := ""
if resp.Card != nil {
cardID = string(resp.Card.ID)
}
return surfacesvc.ActionOutcome{State: state, CardID: cardID, Receipt: resp.Receipt, Payload: resp.Payload}, nil
})
// U3:generative-ui 工具注入闸——activation 台账关闭时命令不投影给该 owner
// 的模型(禁用即不注入能力;执行端守卫仍在 surfacesvc)。