Repository navigation
Give Hackbot agents a tool to report problems - #7249
ayoubdiourin7 wants to merge 3 commits into
Conversation
suhaibmujahid
left a comment
There was a problem hiding this comment.
Thank you! It looks nice and clean! Please see my comments.
| async def report_problem( | ||
| recorder: ActionsRecorder, | ||
| severity: Annotated[ | ||
| Literal["info", "warning", "error"], |
There was a problem hiding this comment.
The options aren't a great fit here, they are matching logging levels, not severity. Maybe we could use something like High / Medium / Low. Or maybe something clear that that.
We might also want a field for type, with values along the lines of Blocker, Improvement, Error, etc.
| @cache | ||
| def _client() -> sentry_sdk.Client: | ||
| return sentry_sdk.Client( | ||
| dsn=settings.agents_sentry_dsn, environment=settings.environment |
There was a problem hiding this comment.
Since they will be mixed with other crashes and errors, we need to make sure that they are easy to filter. I guess "kind": "agent_feedback" would help with that.
| event_id = _client().capture_event( | ||
| { | ||
| "message": params["title"], | ||
| "level": params["severity"], |
There was a problem hiding this comment.
Is this limited to "info", "warning", "error"?
| "run_id": ctx.run_id, | ||
| }, | ||
| "fingerprint": ["agent-feedback", params["title"]], | ||
| "contexts": {"feedback": {"message": params["message"]}}, |
There was a problem hiding this comment.
Once we have the agent version, we should proved it here.
Fixes #7150