MCPcopy Create free account
hub / github.com/astercloud/aster / updateToolRecord

Method updateToolRecord

pkg/agent/processor.go:848–870  ·  view source on GitHub ↗

updateToolRecord 更新工具记录

(id string, state types.ToolCallState, errorMsg string)

Source from the content-addressed store, hash-verified

846
847// updateToolRecord 更新工具记录
848func (a *Agent) updateToolRecord(id string, state types.ToolCallState, errorMsg string) {
849 a.mu.Lock()
850 defer a.mu.Unlock()
851
852 record, ok := a.toolRecords[id]
853 if !ok {
854 return
855 }
856
857 now := time.Now()
858 record.State = state
859 record.UpdatedAt = now
860
861 if errorMsg != "" {
862 record.Error = errorMsg
863 record.IsError = true
864 }
865
866 record.AuditTrail = append(record.AuditTrail, types.ToolCallAuditEntry{
867 State: state,
868 Timestamp: now,
869 })
870}
871
872// handleStreamResponse 处理流式响应(Phase 6C - 提取为独立方法以支持Middleware)
873func (a *Agent) handleStreamResponse(ctx context.Context, stream <-chan provider.StreamChunk) (types.Message, error) {

Callers 2

executeSingleToolMethod · 0.95
controlRunningToolMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected