relatedly, I'd love to get eyes on this: <https://...
# proj-agent
w
relatedly, I'd love to get eyes on this: https://github.com/OpenHands/software-agent-sdk/pull/3213 It technically touches the prompts, but conditionally, so I don't think it'll change eval much
l
I like the idea of having controls, but suggested an alternative implementation method
w
asking openhands, but I'm not quite sure I understand the token usage problem current implementation (intended at least) is • description of all the controls goes into system prompt • current settings go into every user message (only a few tokens) ◦ for ACP we have to send with every message (see thread above this one) ◦ for non-ACP this would be better to only send when changed ▪︎ but IME the agent has a tendency to forget, so this might help
OK openhands actually agrees with you but points out this tradeoff:
The one real tradeoff is prompt-cache invalidation on `set_controls()`:
With my current approach, the system prompt is stable across a conversation; changing controls only mutates the user message. With the reviewer's approach,
set_controls()
invalidates the cached system prompt prefix for the next turn — every provider has to re-process ~5–10k tokens of prompt.
I expect people to mess w/ controls for each convo, e.g. deciding halfway through to put it into "PR ready" or "merge" mode
assuming that, I think current implementation might be cheaper
l
hmm, maybe the motivation for this PR wasn't very clear to me. why do we need this in the first place?
w
prior art
I LOVE being able to set the "save" setting in particular. it defaults to "commit", but then I push it to "PR" and openhands automatically creates a PR when its done the controls proposed above also have "PR ready" which would have the agent continue working until CI passes and code review comments have been addressed; and "merge" which would have the agent actually merge the PR when ready
I also like setting Verify to none when I'm doing manual QA, so the agent doesn't waste 5m linting before it pushes and I can actually test on vercel or w/e
usually I just leave plan alone
so goal here is to expose controls inside of Agent Canvas (different treatment than above) that let the user control agent behavior
l
OK, but I don't like it, is there a way I can turn it off?
I guess my point is that this is very opinionated and other people might be opinionated in different ways.
So being able to inject an arbitrary prompts seems simpler and more flexible.
w
good question I was thinking that having default controls for everyone would actually solve a UX issue, where this behavior is undefined and changes from model to model; some LLMs like to commit, others will push; some like to run extensive tests once their work is done, others just make the changes
If we added a setting to remove these controls entirely from the prompt, it definitely complicates things...we'd need to remove the UI controls as well
I don't see why anyone would object to having default defined behavior for planning, verification, and saving
l
my worry is that this will cause the model to be less flexible in its ability to contextually make the right decision based on the task and cause unexpected behavior. to give an example in our slack integration we said "reply in the user's language" which seems very reasonable, but then this caused openhands to reply in Japanese when I asked questions in English but with a Japanese time zone or something
nod 1
in fact, if anything, I think we might want to be going back and looking at our very large system prompt and re-thinking whether we can remove or simplify some things.
i definitely don't object to allowing the user to add additional instructions though, I think that could be very useful functionality to surface!
w
OK that makes sense!
What's your suggestion on how we architect this then?
l
I'd suggest that we have a space for
{personal_system_message}
or something in agent-sdk, and you can set this through
ConversationSettings
or
AgentSettings
(probably the former). Then if a UI wants to create sliders like the one you selected, the UI itself can auto-generate this message (or message prefix/suffix) and stick it in before starting the conversation. If you want adjust halfway through the conversation, then maybe it could be realized as a follow-up message appended to the conversation?
Just an idea, but I think that might be sufficient!
w
I want formal UI controls and settings for this--it's good metadata for us to have too
If the UI is going to have plan/verify/save controls, I think the agent should have an explicit API for this
even if it's off by default
e.g. I might want to programmatically create an agent with a particular save behavior
much easier for me to say
save: "pr_ready"
than to push a custom system prompt
c
FWIW this sounds totally right to me
I'd suggest that we have a space for
{personal_system_message}
or something in agent-sdk, and you can set this through
ConversationSettings
or
AgentSettings
(probably the former). Then if a UI wants to create sliders like the one you selected, the UI itself can auto-generate this message (or message prefix/suffix) and stick it in before starting the conversation.
These controls seem a little too strict and fine-grained..., e.g. it's not obvious to me why I need one that does exactly the same thing as previous one, but also merges. I could just say "merge"? OTOH, it seems nice for a UI to have them and see if people like it, and send it to the LLM as a user message as suggested (I would love it if someday we could set
role=environment
in LLM APIs... alas today it's all "user")
it's good metadata for us to have too
We could detect it in the conversation events FWIW
Just to add, some enforcements will be hooks. What if this contradicts the hook checks?
l
Yeah, @wooden-umbrella-84098 I'm happy to discuss and brainstorm this more in a meeting, but TBH I think you're possibly overfitting a bit to your personal preferences and workflow. This seems like something where we'll need flexibility to fit various ways of working (and prompts/skills are a standard and effective way of doing that).
w
Fair feedback on overfitting. My goal is to give users more control via the UI--let user steer the agent via an explicit contract, rather than typing prompts like
do NOT push to GitHub unless I tell you to
or
KEEP POLLING GITHUB UNTIL THE TESTS PASS
I suppose the user could create skills for each type of agent behavior they want, and then trigger them with a slash command. But it's hard to e.g. switch from one strategy to another--you've now given the agent conflicting instructions
c
sorry, isn't that necessary anyway, since if we replace the instruction in message history, we break prompt caching?
w
the flow I suggest here is: • static system prompt with instructions for different settings ◦ e.g.
save=commit
means just commit locally ◦ e.g.
save=pr_ready
means keep iterating on the PR until it's mergable • initial user message (or maybe system prompt suffix) automatically includes
save=commit
or whatever the user's default is • if the user changes the setting in the UI, a follow-up message is sent saying
save=pr_ready now
c
With Graham's suggestion, I think maybe this flow can be similar? • regular system prompt • +`personal_system_message`, sent from client in agent settings ◦ maybe client sends exactly your instructions with definitions of modes ◦ and current default, e.g.
save=commit
◦ probably all added to system prompt suffix • if the user changes in the UI, UI generates a follow-up message saying ◦ the same, e.g.
save=pr_ready now
?
w
that seems like a good flow to me 🙂
only thing is we'll want something in agent-server settings to store the defaults
and maybe toggle the whole thing on/off