Note: Amazon Q Developer CLI is deprecated in favor of Kiro CLI (closed-source). The upstream repo is in security-fixes-only mode. Before starting this work, assess whether the module has a future. If it's approaching removal, consider only adding --type amazon-q and skipping resume.
Problem
Amazon Q supports q chat --resume which resumes a prior conversation keyed by working directory (stored in ~/.local/share/amazon-q/data.sqlite3). The module's start.sh always starts fresh. It also doesn't pass --type amazon-q to agentapi.
The module currently appends the task prompt directly to the args array. On resume, this must be skipped.
Desired outcome
- On cold start: Amazon Q starts normally with the task prompt.
- On warm start: Amazon Q resumes the prior conversation. The task prompt is not re-sent.
--type amazon-q is passed to agentapi server.
- Expose
enable_state_persistence in main.tf (default true) and pass it through to the module "agentapi" block so the Coder UI preserves chat history across restarts, matching the agent's resumed session.
Key upstream behaviors
q chat --resume silently starts a new conversation when no prior state exists for the current working directory. No existence check needed (unlike Gemini).
- Amazon Q keys conversations by working directory.
ARG_WORKDIR must be consistent across stop/start cycles.
- Whether
q chat --resume works correctly when wrapped by agentapi's terminal proxy is untested. Verify in a workspace before shipping.
- aws/amazon-q-developer-cli#3622:
ValidationException when conversation history exceeds backend token limits on resume.
- Auth credentials from
auth_tarball at ~/.local/share/amazon-q/ must survive restarts.
Version bump
minor
Refs #696, coder/internal#1258
Note: Amazon Q Developer CLI is deprecated in favor of Kiro CLI (closed-source). The upstream repo is in security-fixes-only mode. Before starting this work, assess whether the module has a future. If it's approaching removal, consider only adding
--type amazon-qand skipping resume.Problem
Amazon Q supports
q chat --resumewhich resumes a prior conversation keyed by working directory (stored in~/.local/share/amazon-q/data.sqlite3). The module'sstart.shalways starts fresh. It also doesn't pass--type amazon-qto agentapi.The module currently appends the task prompt directly to the args array. On resume, this must be skipped.
Desired outcome
--type amazon-qis passed toagentapi server.enable_state_persistenceinmain.tf(defaulttrue) and pass it through to themodule "agentapi"block so the Coder UI preserves chat history across restarts, matching the agent's resumed session.Key upstream behaviors
q chat --resumesilently starts a new conversation when no prior state exists for the current working directory. No existence check needed (unlike Gemini).ARG_WORKDIRmust be consistent across stop/start cycles.q chat --resumeworks correctly when wrapped by agentapi's terminal proxy is untested. Verify in a workspace before shipping.ValidationExceptionwhen conversation history exceeds backend token limits on resume.auth_tarballat~/.local/share/amazon-q/must survive restarts.Version bump
minorRefs #696, coder/internal#1258