Improve NOFXi agent product handling

This commit is contained in:
lky-spec
2026-05-02 22:55:10 +08:00
parent 25d0b30ea9
commit 159f27dfdd
19 changed files with 449 additions and 54 deletions

View File

@@ -421,6 +421,9 @@ func (a *Agent) handleMessageForStoreUser(ctx context.Context, storeUserID strin
if reply, handled := a.handleTradeConfirmation(ctx, userID, text, lang); handled {
return reply, nil
}
if reply, handled := a.handleModelWalletBalanceQuestion(storeUserID, lang, text); handled {
return reply, nil
}
// Everything else goes through the planner and tool system.
return a.thinkAndAct(ctx, storeUserID, userID, lang, text)
@@ -468,6 +471,12 @@ func (a *Agent) handleMessageStreamForStoreUser(ctx context.Context, storeUserID
}
return reply, nil
}
if reply, handled := a.handleModelWalletBalanceQuestion(storeUserID, lang, text); handled {
if onEvent != nil {
emitStreamText(onEvent, reply)
}
return reply, nil
}
return a.thinkAndActStream(ctx, storeUserID, userID, lang, text, onEvent)
}