MCPcopy Create free account
hub / github.com/GCWing/BitFun / updateAgentConfig

Method updateAgentConfig

src/web-ui/src/app/services/AppManager.ts:96–123  ·  view source on GitHub ↗
(agentId: string, config: Partial<AgentConfig>)

Source from the content-addressed store, hash-verified

94 }
95
96 async updateAgentConfig(agentId: string, config: Partial<AgentConfig>): Promise<void> {
97 const agentIndex = this.state.availableAgents.findIndex(a => a.id === agentId);
98 if (agentIndex === -1) {
99 throw new Error(`Agent not found: ${agentId}`);
100 }
101
102 const updatedAgents = [...this.state.availableAgents];
103 const currentAgent = updatedAgents[agentIndex];
104 updatedAgents[agentIndex] = {
105 ...currentAgent,
106 config: {
107 ...currentAgent.config,
108 ...config
109 } as AgentConfig
110 };
111
112 this.updateState({ availableAgents: updatedAgents });
113
114 // Also update currentAgent when it matches
115 if (this.state.currentAgent?.id === agentId) {
116 this.updateState({ currentAgent: updatedAgents[agentIndex] });
117 }
118
119 this.emitEvent({
120 type: 'agent:changed',
121 payload: updatedAgents[agentIndex]
122 });
123 }
124
125 // Chat management
126 async createChatSession(agentId: string): Promise<ChatSession> {

Callers

nothing calls this directly

Calls 2

updateStateMethod · 0.95
emitEventMethod · 0.95

Tested by

no test coverage detected