-
Notifications
You must be signed in to change notification settings - Fork 125
Description
Problem
Two issues:
-
Resume is off by default. The module has full resume wiring (
--continue,--session,--type opencodeall present instart.sh) but thecontinuevariable inmain.tfdefaults tofalse. Out of the box, sessions are never resumed. -
Prompt is re-sent on resume. In
build_opencode_args(), the initial prompt is added toAGENTAPI_ARGSvia-I "$PROMPT"unconditionally whenARG_AI_PROMPTis set, regardless of whetherARG_CONTINUEis true. When a session is resumed, the task prompt gets re-injected into an already-active conversation, potentially re-triggering the original task.
To reproduce: set continue = true and ai_prompt = "some task". Start the module, have a conversation, stop, restart. The agent resumes the session but the task prompt is re-sent as a new message.
OpenCode's --continue gracefully creates a new session when no prior sessions exist, so the default flip is safe for first-run scenarios.
Desired outcome
continuedefaults totrue.- The initial prompt is only sent on cold start, not when resuming an existing session.
- After feat(coder/modules/agentapi): add state persistence #736 lands:
enable_state_persistence = trueso the UI matches the agent's memory.
Version bump
minor