You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sourcegraph-amp: wire thread resume with thread ID persistence #748
Amp stores threads entirely server-side on Sourcegraph's infrastructure. Resume uses amp threads continue [threadId], which is a subcommand rather than a flag. The module currently creates a new thread on every startup by piping the prompt via echo "$PROMPT" | amp. There is no mechanism to capture or reuse a thread ID across restarts.
--type amp is already present. No --type change needed.
Desired outcome
On cold start: Amp starts a new thread. The thread ID is captured and persisted.
On warm start: Amp continues the prior thread via amp threads continue <threadId>. The prompt delivery mechanism changes entirely (from stdin pipe to subcommand).
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.
Investigation needed first
Test these approaches for capturing the thread ID:
Check if Amp sets an AMP_THREAD_ID environment variable.
Parse --stream-json output for a thread/session identifier.
Use amp threads list after the first run. Check if it supports machine-readable output.
Also verify:
What happens with amp threads continue <invalidId>?
Does amp threads continue work reliably in headless mode via agentapi?
Thread resume requires network connectivity to Sourcegraph servers. Air-gapped environments cannot use it.
Activity