-
Notifications
You must be signed in to change notification settings - Fork 109
DRAFT: Critic agent that forks generator settings for PR-style review #1706
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: main
Are you sure you want to change the base?
Conversation
|
@OpenHands do a /codereview-roasted and help me address all review comments in this PR. When you are done, you should help me write a script in examples/0 folder that demonstrate this critic work in action. You can refer to the existing delagation example, as well as the example introduced in #1269 |
|
I'm on it! xingyaoww can track my progress at all-hands.dev |
Co-authored-by: openhands <openhands@all-hands.dev>
Final summary (double-checked)✅ Checklist against your request
🔍 Conciseness / extraneous changes check
📌 What changed (since the last state on main)
🚀 Push status
|
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
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.
We should put it under https://github.com/OpenHands/software-agent-sdk/tree/main/examples/01_standalone_sdk
|
|
||
| if __name__ == "__main__": | ||
| raise SystemExit(main()) | ||
| """ |
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.
This seems not ideal. Should we make a hook ideally accepting a callback function as well?
| def _extract_llm(self, events: Sequence[LLMConvertibleEvent]) -> LLM | None: | ||
| for event in events: | ||
| agent = getattr(event, "agent", None) | ||
| llm = getattr(agent, "llm", None) | ||
| if isinstance(llm, LLM): | ||
| return llm | ||
|
|
||
| for event in events: | ||
| if not isinstance(event, SystemPromptEvent): | ||
| continue | ||
| agent = getattr(event, "agent", None) | ||
| llm = getattr(agent, "llm", None) | ||
| if isinstance(llm, LLM): | ||
| return llm | ||
|
|
||
| return None |
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.
We don't need this, since self.llm is already there
| `not_pass`. | ||
| """ | ||
|
|
||
| llm: LLM | None = None |
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.
This should be llm: LLM
It is a required arg
| def _extract_agent(self, events: Sequence[LLMConvertibleEvent]) -> Agent | None: | ||
| for event in events: | ||
| agent = getattr(event, "agent", None) | ||
| if isinstance(agent, Agent): | ||
| return agent | ||
|
|
||
| for event in events: | ||
| if not isinstance(event, SystemPromptEvent): | ||
| continue | ||
| agent = getattr(event, "agent", None) | ||
| if isinstance(agent, Agent): | ||
| return agent | ||
|
|
||
| return None |
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.
Similar to the get planning agent function in the openhands.tools.preset - we should reconstruct an Agent instance ourselves
Summary
AgentReviewCritic, aCriticBaseimplementation that spawns a separate OpenHands agent to review the current git diff.Fixes #1704
Checklist
@xingyaoww can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:de8bb36-pythonRun
All tags pushed for this build
About Multi-Architecture Support
de8bb36-python) is a multi-arch manifest supporting both amd64 and arm64de8bb36-python-amd64) are also available if needed