Fix goal update and add /goal edit command in TUI#21954
Fix goal update and add /goal edit command in TUI#21954etraut-openai wants to merge 5 commits intomainfrom
/goal edit command in TUI#21954Conversation
/goal edit command in TUI
/goal edit command in TUI/goal edit command in TUI
|
When testing |
|
@canvrno-oai, good catch! I forgot that my original implementation cleared the goal time/token accounting when the objective was updated. That design decision no longer makes sense for the |
fcoury-oai
left a comment
There was a problem hiding this comment.
Codex found this issue where if we edit the goal, it should reset the token budget.
Right now the replacement UI can strand the user in the old goal’s exhausted budget/accounting unless they know to manually
/goal clearfirst.
And it suggested a manual repro:
- Create a goal with a token budget.
- Let it accumulate usage until it is budget-limited, or set usage over budget through the existing goal accounting path.
- Run
/goal some new objective. - Choose “Replace current goal”.
- Observe the returned goal keeps the previous usage/budget and may remain
budgetLimitedinstead of starting the new objective active with fresh accounting.
However I was unable to start a new goal with a token limit. I tried:
/goal --tokens 8000 find largest rs file by complexity
/goal find largest rs file by complexity, use up to 8000 tokens
But both of them completed the goal with more than 8000 tokens used.
Did we remove the limit?
Why
Users have requested the ability to edit a goal's objective after a goal has been created. This PR exposes a new
/goal editcommand in the TUI to address this request.In the process of implementing this, I also noticed an existing bug in the goal runtime. When a goal's objective is updated through the
thread/goal/setapp server API, the goal runtime didn't emit a new steering prompt to tell the agent about the new objective. This PR also fixes this hole.What Changed
/goal editin the TUI, opening an edit box prefilled with the current goal objective.thread/goal/setbehavior so editing an objective preserves goal accounting instead of resetting it. The older reset-on-new-objective behavior was left over from beforethread/goal/clear; clients that need to reset accounting can now clear the existing goal and create a new one.Validation
/goal editreturns an error if no goal currently exists/goal editdisplays an edit box that can be optionally canceled with no side effects/goalto display the goal summary/goal editdoesn't reset the token budget, time/token accounting on the updated goal