Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions wu-wei/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@
"category": "Wu Wei",
"icon": "$(refresh)"
},
{
"command": "wu-wei.sendAgentRequest",
"title": "Wu Wei: Send Agent Request",
"category": "Wu Wei",
"icon": "$(send)"
},
{
"command": "wu-wei.refreshAgents",
"title": "Wu Wei: Refresh Agents",
Expand Down Expand Up @@ -388,4 +382,4 @@
"url": "https://github.com/your-username/wu-wei.git"
},
"license": "MIT"
}
}
8 changes: 2 additions & 6 deletions wu-wei/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,7 @@ export function activate(context: vscode.ExtensionContext) {
}
});

// Register send agent request command
const sendAgentRequestCommand = vscode.commands.registerCommand('wu-wei.sendAgentRequest', () => {
logger.info('Send agent request command executed');
vscode.window.showInformationMessage('Wu Wei: Use the Agent Panel to send requests');
});


// Register refresh agents command
const refreshAgentsCommand = vscode.commands.registerCommand('wu-wei.refreshAgents', () => {
Expand Down Expand Up @@ -281,7 +277,7 @@ export function activate(context: vscode.ExtensionContext) {
exportLogsCommand,
debugModelsCommand,
forceReloadModelsCommand,
sendAgentRequestCommand,

refreshAgentsCommand,
showModelDetailsCommand,
openPromptStoreCommand,
Expand Down
69 changes: 0 additions & 69 deletions wu-wei/src/providers/agentPanelProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ export class AgentPanelProvider extends BaseWebviewProvider implements vscode.We

protected async handleMessage(message: any): Promise<void> {
switch (message.command) {
case 'sendAgentRequest':
await this.handleAgentRequest(message.agentName, message.method, message.params);
break;
case 'sendAgentRequestWithPrompt':
await this.handleAgentRequestWithPrompt(
message.agentName,
Expand Down Expand Up @@ -521,73 +518,7 @@ export class AgentPanelProvider extends BaseWebviewProvider implements vscode.We
}
}

private async handleAgentRequest(agentName: string, method: string, params: any): Promise<void> {
try {
logger.info(`Processing agent request: ${agentName}.${method}`, params);

const agent = this._agentRegistry.getAgent(agentName);

if (!agent) {
const errorMessage = `Agent '${agentName}' not found`;
logger.error(errorMessage);
this.addMessageToHistory({
id: this.generateMessageId(),
timestamp: new Date(),
type: 'error',
error: {
code: -32000,
message: errorMessage
}
});
return;
}

// Create request
const request: AgentRequest = {
id: this.generateMessageId(),
method,
params,
timestamp: new Date()
};

// Add request to history
this.addMessageToHistory({
id: request.id,
timestamp: request.timestamp,
type: 'request',
method: request.method,
params: request.params
});

// Process request
const response = await agent.processRequest(request);

// Add response to history
this.addMessageToHistory({
id: response.id,
timestamp: response.timestamp,
type: 'response',
result: response.result,
error: response.error
});

logger.info(`Agent request completed: ${agentName}.${method}`, response);

} catch (error) {
logger.error('Error handling agent request', error);

this.addMessageToHistory({
id: this.generateMessageId(),
timestamp: new Date(),
type: 'error',
error: {
code: -32603,
message: 'Internal error processing request',
data: error instanceof Error ? error.message : String(error)
}
});
}
}

private addMessageToHistory(message: AgentMessage): void {
this._messageHistory.push(message);
Expand Down
Loading