Real-world feedback from 20+ V2 goal runs: waiting for user input, Esc -> resume, and >50-token refusal loops
Hi! First off, thanks for building and maintaining this plugin — especially the recent #109 fix in 0.1.72 for background Shell deferral, which solved a huge pain point for long test runs on OpenCode V2.
We've been using @prevalentware/opencode-goal-plugin (zh-CN locale on OpenCode V2, macOS) heavily over the past couple of weeks. After going through our ~/.local/share/opencode-goal-plugin/goals.json history across 24 real goals (14 sessions) to see why some multi-turn runs succeeded smoothly while others got stuck or cancelled, we noticed a few workflow friction points that we wanted to share with some thoughts on how they might be improved.
1. When the agent needs to wait for the user (login, screenshot, or a quick decision), it has nowhere recoverable to park the goal
In day-to-day work, a long goal often hits a moment where the agent genuinely needs a human in the loop for 30 seconds:
- Example A (Waiting for browser login): In one session (
ses_e9da660...), the agent opened a browser to automate an internal OA workflow and stopped at the login screen waiting for me to type my password. Because the turn ended cleanly, auto-continue kicked in a few seconds later. While I was still logging in, the plugin auto-continued the agent 6–8 times in a row, and the agent just kept re-checking the same login page and burning ~40M cached input tokens until I cancelled it. - Example B (Waiting for a design confirmation or screenshot): In two other sessions (
ses_e9cf8e...andses_e9ce5f...), the agent finished its read-only investigation and stopped to ask me a quick architecture trade-off question (or asked me to paste a Word screenshot) before mutating files. Right after it asked the question,Auto-continue 1fired. Caught between waiting for my answer and being told to keep going, the agent ended up closing the goal asunmet.
Looking at src/server.ts, this happens because update_goal_status(paused) tells the model to only pause when the user explicitly asks to pause or stop, while EVIDENCE_INSTRUCTIONS (Blocked audit) tells the model:
"Use status 'unmet' only when you are truly at an impasse and cannot make meaningful progress without user input or an external-state change."
Since unmet is a closed terminal state, the goal dies as soon as the agent asks the user a blocking question.
Thought / suggestion: What if the agent is allowed to call update_goal_status({ status: "paused" }) (perhaps with a reason / stopReason: "awaiting user") when it asks the user a direct question, waits for login/credentials, or needs manual confirmation? Then, in the V2 prompt hook, when the user sends their next normal reply in that session, a goal paused with stopReason === "awaiting user" could automatically flip back to active and continue seamlessly. That way unmet stays strictly for tasks that are actually impossible.
2. Pressing Esc to steer the agent mid-turn marks the goal cancelled permanently, so /goal resume can't reopen it
When watching an agent work in the TUI, probably 80% of the time I hit Esc, I don't actually want to abandon the whole goal — I just see it heading down a slightly wrong path (editing the wrong config file or using the wrong port), so I hit Esc to say "wait, use port 8080 instead, then keep going."
Right now, interrupt / session.execution.interrupted (reason: "user") calls cancelActiveGoal, which transitions the goal to terminal cancelled (isClosed === true). When I run /goal resume afterward, setGoalStatus rejects it because the goal is already closed. Out of habit, I end up typing /goal 继续 ("continue"), which instructs the model to create a brand-new goal from $ARGUMENTS without inferring from session context — resulting in a new goal whose literal objective is just "继续".
Thought / suggestion: I read PR #64 and completely understand why Esc shouldn't leave the goal active (otherwise an unrelated prompt or a reload would unexpectedly trigger auto-continue). Could we keep #64's guarantee that an interrupted goal never auto-continues on its own, while allowing an explicit /goal resume command to reopen a user-interrupted (cancelled / stopReason: "interrupted") goal?
3. A refusal loop ran for 18 auto-continue turns (~5.87M tokens) with noProgressTurns: 0
In one session (ses_e9cfcd0...), I stepped away from my desk while a goal was running. The model hit a step it refused to perform and asked me to run /goal stop (since the tool description forbids the model from calling stop_goal on its own).
Over the next 30 minutes, it auto-continued 18 times (autoTurns: 18, tokensUsed: 5,869,243), and noProgressTurns stayed at 0 the entire time. Each turn, the model wrote a ~70-token reply along the lines of:
- Turn 9: "Auto-continue is now at turn 9, my judgment won't change by re-running. Please run
/goal stop..." - Turn 10: "Auto-continue is now at turn 10, my judgment won't change..."
In recordAssistantProgress, noProgressTurns only increments when:
const lowOutput = outputTokens > 0 && outputTokens < (threshold ?? DEFAULT_NO_PROGRESS_TOKEN_THRESHOLD); // < 50
const changedSinceContinuation = Boolean(summary && summary !== goal.continuationBaselineSummary);
if (lowOutput && !changedSinceContinuation) { ... }
Because a normal refusal or explanation is easily > 50 tokens, and incrementing "turn 9" -> "turn 10" changes summary, noProgressTurns gets reset to 0 every turn.
Thought / suggestion: During continuation turns, if a turn completes with zero substantive tool calls (i.e., no tools called outside NON_PROGRESS_TOOLS / goal tools) and either the normalized summary (stripping numbers/counters) hasn't changed or no plan/todo progress occurred for 2–3 consecutive continuation turns, treating that as low progress would catch refusal or "still waiting" loops early without hurting legitimate long runs.
4. Two smaller observations (accountUsage writes when !goal, and get_goal calls in non-goal chats)
accountUsagefull-file rewrites when no goal exists: InaccountUsage(sessionID, tokensUsed, options), it callsmutate((state) => { const goal = state.goals[sessionID]; if (!goal) return null; ... }). Becausemutate()unconditionally runsyield* writeStateEffect(state, file)before returningresult, every step completion and usage update in ordinary non-goal sessions still rewrites andfsyncs the entiregoals.jsonfile (297KB on our machine across 5+ open OpenCode instances). Returning early when!goalwithout callingwriteStateEffect(and combined with the lock file in#102) would eliminate almost all idle disk writes.- Defensive
get_goalcalls in ordinary non-goal sessions: We saw#13and#74and totally agree thatsystemRemindershould stay static incontextandcompactionhooks so the prompt cache prefix isn't invalidated. One small side effect of the current wording ("Before starting goal work in a new user turn, call get_goal...") is that some models interpret every new user request as potential "goal work" and callget_goalon turn 1 of normal Q&A sessions (we saw up to 11get_goalcalls in a session that never used/goal). Tweaking that sentence slightly to say "When a goal is active in this session or the user invokes/goal, callget_goal..." would keep the static prompt cache intact while stopping unnecessaryget_goalcalls in regular chats.
Thanks again for all the rapid improvements on this project — happy to test any changes or provide sanitized snippets from our goals.json if helpful!
Just a quick note: this is simply from my own personal usage experience. The issue write-up itself was drafted and posted by my AI assistant, so please feel free to discuss and decide on your end whether any of these changes actually make sense to adopt.
I'm really just sharing the bug/friction feedback from my day-to-day usage — I probably can't come up with a fully mature design myself, so I'll leave the exact mechanics to your judgment (and your AI!) to figure out what works best.
Here is the response my AI came up with for reference:
Good point — having the host blindly auto-resume on any user message would definitely backfire if I just ask a quick side question while a login or decision is still pending.
At the same time, requiring a manual
/goal resumeevery time feels a bit unnatural in practice: when the agent asks "Should we go with Option A or B?" or "Let me know once you've logged in", my natural reflex is to just reply "Option A" or "Done, logged in", not/goal resume.What do you think about letting the model pass the resume signal on that turn? Specifically:
- When a goal is paused with
stopReason: "awaiting user", the host plugin does not auto-flip it toactiveon the next user message.- When I send my next message (which runs a normal turn anyway), if the model sees that my reply actually answers its pending question / confirms the login, the model is allowed to call
update_goal_status({ status: "active" })and keep going.- If my message is just an unrelated side question (or "hold on a sec"), the model answers it and leaves the goal
paused, so auto-continue stays off. And/goal resumeremains available as an explicit manual override.