Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ca69ac

Browse files
committed
feat(AgentsInsCommand): improve A2A agent message handling and error reporting#451
1 parente9d345d commit2ca69ac

File tree

1 file changed

+18
-8
lines changed
  • exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/agents

1 file changed

+18
-8
lines changed

‎exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/agents/AgentsInsCommand.kt‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,16 +239,26 @@ class AgentsInsCommand(
239239
a2aService.initialize()
240240

241241
if (a2aService.isAvailable()) {
242-
// Check if the agent exists in A2A agents by trying to send a message
243-
try {
244-
val response= a2aService.sendMessage(agentName, input)
245-
if (response!=null) {
246-
return"A2A Agent '$agentName' response:\n$response"
247-
}
248-
// If response is null, continue to try DevIns agents
242+
// Check if the agent exists in A2A agents by checking the available tools
243+
val a2aAgents=try {
244+
A2ASketchToolchainProvider.collectA2ATools(project)
249245
}catch (e:Exception) {
250-
// If error occurs, continue to try DevIns agents
246+
emptyList()
247+
}
248+
249+
val a2aAgent= a2aAgents.find { it.name== agentName }
250+
if (a2aAgent!=null) {
251+
// Agent found in A2A, try to send message
252+
try {
253+
val response= a2aService.sendMessage(agentName, input)
254+
if (response!=null) {
255+
return"A2A Agent '$agentName' response:\n$response"
256+
}
257+
}catch (e:Exception) {
258+
return"${DEVINS_ERROR} Error invoking A2A agent '$agentName':${e.message}"
259+
}
251260
}
261+
// If agent not found in A2A, continue to try DevIns agents
252262
}
253263

254264
// Try to find and invoke DevIns agent

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp