Summary
Deleting an agent profile while a task still has a session leaves that session permanently unusable. The composer then offers no agent/model selection, and sending a message records the message but fails the turn with Failed to send message to agent, marking the session FAILED; every later send fails identically and there is no in-session way to rebind the session to another profile. Adding another agent to the task does not recover the work either: the new session's Context selector offers only Blank and Copy initial prompt, with no way to seed from the failed session's context.
Affected area
Agent lifecycle
Kandev version
v0.94.1-nightly.sha57bbae10ad0f
Install mode
Other (npm global install running as a systemd --user service; KANDEV_INSTALL_KIND=npm, KANDEV_RUNNING_AS_SERVICE=true)
Environment
- OS: Linux (kernel 7.0.0-30-generic), architecture amd64
- Browser: Chrome/Chromium on the same host
- Install: npm global package,
systemd --user service, KANDEV_HOME_DIR=/home/clem/.kandev
- No Docker or Kubernetes in the affected path (worktree executor on the host)
Kandev configuration
- Executor type/profile: worktree executor, profile
b2db8f32-4a2c-48b6-8e9b-4c183618d657 (exec-worktree)
- Agent profile:
OMP DS4 pro (omp-acp, model litellm-fi/deepseek-v4-pro), deleted on 2026-09-18 13:19:05Z
- Repository source: GitHub clone of
kdlbs/kandev, base branch main
- Summarize utility agent:
builtin-summarize-session is disabled (enabled = 0) on this instance
- Relevant env vars: none beyond the defaults (
KANDEV_FEATURES_* are all off); the deletion path does not look feature-gated
Task/session context
- Workspace ID:
2bca24ab-c6c5-4b78-9671-2e3404fa9871 ("Improve Kandev")
- Workflow/step: workflow
7ca5033f-f018-4b3b-ade6-10771f4aed48, step b273db91-70b0-4d43-b243-33d0e0398b83
- Task ID:
20517a31-2c50-4b9c-b19a-b10c19cd59f8
- Session ID:
55a60ef0-38ca-4638-8ff6-9f7364d36078
- Branch/worktree: worktree executor, repository
6e5cf61c-f13c-4a3e-82fb-bb4fd59e0a8c, base branch main
Steps to reproduce
- Keep a task whose session runs on an agent profile (here: an
omp-acp profile named OMP DS4 pro).
- In Settings > Agents, delete that profile while the task still has its session.
- Open the task's existing session. The composer shows no agent/model selection, because the session's profile no longer exists.
- Send any message (observed:
rebase).
- The message is persisted, the turn fails with
Failed to send message to agent, and the session state becomes FAILED. Sending again fails the same way.
- Add a new agent/session to the task: the Context selector offers only
Blank and Copy initial prompt, so the failed session's context cannot be carried over.
Reproducibility
Always
Clean-state check
Not applicable (the failure needs an existing task whose session outlives the deletion of its agent profile)
Expected behavior
- Continuing the session should let me choose another agent/model, or rebind the session to a replacement profile, and resume in place.
- If resuming is impossible, the send should fail with an actionable error and an offered way to recreate or substitute the removed profile, instead of a dead session.
- Adding an agent to the task should be able to seed the new session from the failed session's context, not only from the original prompt.
Actual behavior
The session is bricked. The composer has no agent/model to select, the send is accepted into the transcript and then fails, and the session stays FAILED with no recovery path in the UI. The new-session flow offers only Blank and Copy initial prompt, so the work in the failed session cannot be handed to a working agent.
Logs and artifacts
Session 55a60ef0-38ca-4638-8ff6-9f7364d36078 on task 20517a31-2c50-4b9c-b19a-b10c19cd59f8:
error_message: failed to resume session: failed to resolve agent profile:
agent profile "OMP DS4 pro" (***) was removed
state: FAILED
Timeline for the failing send (2026-09-18, UTC):
20:22:34.240 user message "rebase"
20:22:34.227 turn started, never completed
20:22:34.522 agent error "Failed to send message to agent"
20:22:34.498 session state FAILED
No raw prompts, agent output, tokens, or repository credentials are included. The profile in question is soft-deleted (deleted_at set) rather than hard-deleted, and it no longer appears in the agent-profile list.
Last known good version
N/A
Extra context
Before submitting
Summary
Deleting an agent profile while a task still has a session leaves that session permanently unusable. The composer then offers no agent/model selection, and sending a message records the message but fails the turn with
Failed to send message to agent, marking the sessionFAILED; every later send fails identically and there is no in-session way to rebind the session to another profile. Adding another agent to the task does not recover the work either: the new session's Context selector offers onlyBlankandCopy initial prompt, with no way to seed from the failed session's context.Affected area
Agent lifecycle
Kandev version
v0.94.1-nightly.sha57bbae10ad0f
Install mode
Other (npm global install running as a
systemd --userservice;KANDEV_INSTALL_KIND=npm,KANDEV_RUNNING_AS_SERVICE=true)Environment
systemd --userservice,KANDEV_HOME_DIR=/home/clem/.kandevKandev configuration
b2db8f32-4a2c-48b6-8e9b-4c183618d657(exec-worktree)OMP DS4 pro(omp-acp, modellitellm-fi/deepseek-v4-pro), deleted on 2026-09-18 13:19:05Zkdlbs/kandev, base branchmainbuiltin-summarize-sessionis disabled (enabled = 0) on this instanceKANDEV_FEATURES_*are all off); the deletion path does not look feature-gatedTask/session context
2bca24ab-c6c5-4b78-9671-2e3404fa9871("Improve Kandev")7ca5033f-f018-4b3b-ade6-10771f4aed48, stepb273db91-70b0-4d43-b243-33d0e0398b8320517a31-2c50-4b9c-b19a-b10c19cd59f855a60ef0-38ca-4638-8ff6-9f7364d360786e5cf61c-f13c-4a3e-82fb-bb4fd59e0a8c, base branchmainSteps to reproduce
omp-acpprofile namedOMP DS4 pro).rebase).Failed to send message to agent, and the session state becomesFAILED. Sending again fails the same way.BlankandCopy initial prompt, so the failed session's context cannot be carried over.Reproducibility
Always
Clean-state check
Not applicable (the failure needs an existing task whose session outlives the deletion of its agent profile)
Expected behavior
Actual behavior
The session is bricked. The composer has no agent/model to select, the send is accepted into the transcript and then fails, and the session stays
FAILEDwith no recovery path in the UI. The new-session flow offers onlyBlankandCopy initial prompt, so the work in the failed session cannot be handed to a working agent.Logs and artifacts
Session
55a60ef0-38ca-4638-8ff6-9f7364d36078on task20517a31-2c50-4b9c-b19a-b10c19cd59f8:Timeline for the failing send (2026-09-18, UTC):
No raw prompts, agent output, tokens, or repository credentials are included. The profile in question is soft-deleted (
deleted_atset) rather than hard-deleted, and it no longer appears in the agent-profile list.Last known good version
N/A
Extra context
StoreProfileResolver.ResolveProfilereturns aDeletedProfileError("agent profile %q (%s) was removed") inapps/backend/internal/agent/runtime/lifecycle/profile_resolver.go, and the send/resume path surfaces it asfailed to resume session: failed to resolve agent profile: .... Watchers self-heal from the same error type, but a task session has no equivalent recovery.FAILED, and the summarize-session utility agent is disabled, so even a summarize-based handoff would not have been available.Before submitting