-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(autofix): Add first pass at interactive flow #1168
Conversation
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.
1 note, will take a second pass later after long interview
# call LLM separately with the same memory to generate structured output insight cards | ||
insight_sharing = InsightSharingComponent(context) | ||
past_insights = context.state.get().get_all_insights() | ||
insight_card = insight_sharing.invoke( | ||
InsightSharingRequest( | ||
latest_thought=text, | ||
memory=self.memory, | ||
task_description=context.state.get().get_step_description(), | ||
past_insights=past_insights, | ||
) | ||
) | ||
if insight_card: | ||
if context.state.get().steps and isinstance( | ||
context.state.get().steps[-1], DefaultStep | ||
): | ||
step = cast(DefaultStep, context.state.get().steps[-1]) | ||
step.insights.append(insight_card) | ||
with context.state.update() as cur: | ||
cur.steps[-1] = step |
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.
Hmm I think this is worth pulling out of the general agent logic and into a specific AutofixAgent
that inherits from this generic Agent
as codecov will be using this too and we don't need to generate insights there.
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.
Since in many cases we'll want to disable it for Autofix too (e.g. evals, GH Copilot), I'm adding an interactive
flag to the AgentConfig so that these kinds of features are easy to enable/disable whenever we want. It defaults to False
so the unit test gen code will not generate any insights.
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.
couple comments, nothing major, lgtm otherwise
src/seer/automation/autofix/components/insight_sharing/component.py
Outdated
Show resolved
Hide resolved
elif message.role == "tool_use": | ||
new_messages.append( | ||
Message(role="assistant", content=message.content, tool_calls=[]) | ||
) |
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.
tool_use
is for anthropic right, we don't need to use this hack on anthropic calls right?
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.
I believe I did need to use this hack for Claude, I can't recall the exact error that was occurring though
This supports insight card generation, user interjection, and a root cause flow that makes sense for the new design. (#450 )