Commit pending workspace updates
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.codegraph/
|
||||
9
agent.py
9
agent.py
@@ -290,6 +290,7 @@ class BlogOpenapiAgent(A2AAgent):
|
||||
"Call tools to get real results. Do not invent API responses.",
|
||||
"For write, update, or delete operations, explain the intended action before calling the tool.",
|
||||
"If an operation reports missing consumer setup, tell the user which setup field is required.",
|
||||
"If an operation returns 404, 405, 410, or a schema/validation error that suggests the live API no longer matches these tools, tell the user this generated agent may need to be refreshed from the latest OpenAPI spec and ask whether they want to refresh it.",
|
||||
"",
|
||||
"Available operations:",
|
||||
]
|
||||
@@ -346,12 +347,18 @@ class BlogOpenapiAgent(A2AAgent):
|
||||
except ValueError:
|
||||
payload = response.text
|
||||
if response.status_code >= 400:
|
||||
return {
|
||||
out = {
|
||||
"ok": False,
|
||||
"status_code": response.status_code,
|
||||
"operation_id": operation_id,
|
||||
"error": payload,
|
||||
}
|
||||
if response.status_code in {404, 405, 410, 422}:
|
||||
out["stale_openapi_hint"] = (
|
||||
"This generated OpenAPI agent may be stale. Ask the user "
|
||||
"whether they want to refresh it from the latest OpenAPI spec."
|
||||
)
|
||||
return out
|
||||
return {
|
||||
"ok": True,
|
||||
"status_code": response.status_code,
|
||||
|
||||
Reference in New Issue
Block a user