-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(integrations): Add POST endpoint for coding agent launch #97983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jenn/coding-agent-seer-autofix-state
Are you sure you want to change the base?
feat(integrations): Add POST endpoint for coding agent launch #97983
Conversation
"""Extract repository names from autofix state solution.""" | ||
repos = set() | ||
solution_step = next(step for step in autofix_state.steps if step["key"] == "solution") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solution_item["relevant_code_file"] | ||
and solution_item["relevant_code_file"]["repo_name"] | ||
): | ||
repos.add(solution_item["relevant_code_file"]["repo_name"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: Unsafe dictionary access on solution_item["relevant_code_file"]
may cause a KeyError
. Frontend types show this field is optional, but the backend doesn't handle its absence, risking a server crash.
-
Description: The code directly accesses
solution_item["relevant_code_file"]
within a loop. Evidence from corresponding frontend TypeScript types (AutofixSolutionTimelineEvent
) indicates that therelevant_code_file
field is optional. If the Seer API, which provides this data, returns asolution_item
where this key is missing, the direct dictionary access will raise an unhandledKeyError
. This will cause the API endpoint to crash and return a 500 error, preventing the extraction of repository information from the autofix state. -
Suggested fix: Use the
.get()
method for safe dictionary access to prevent aKeyError
when therelevant_code_file
key is missing. The code should be changed tosolution_item.get("relevant_code_file")
and include a check for the result before attempting to access nested keys likerepo_name
.
severity: 0.65, confidence: 0.9
Did we get this right? 👍 / 👎 to inform future reviews.
b82a980
to
cf6e830
Compare
- Add POST method to OrganizationCodingAgentsEndpoint for launching coding agents - Implement autofix state retrieval and coding agent prompt generation - Support launching agents for multiple repositories from autofix solutions - Add comprehensive validation and error handling - Include branch name sanitization and Seer state storage - Add extensive test coverage for POST functionality - Update autofix utilities with coding agent state models and prompt functions This completes the coding agent framework by adding the ability to trigger coding agents from Seer UI with autofix context.
a3594bd
to
3c63d92
Compare
…agent-framework-post-endpoint
Context
This PR completes the coding agent framework by adding the POST endpoint that enables launching coding agents from the Seer UI. The endpoint:
The endpoint supports both
root_cause
andsolution
trigger sources, and includes comprehensive error handling and logging.Stacked on: #97986
Architecture
organizations:seer-coding-agent-integrations