Skip to content

fix(agents): unreadable lists start nothing, retitled sessions are found, agents:reset; claude-code additionalDirectories (agents 1.0.1, claude-code 1.8.0, devcontainer-cli 1.14.0) - #85

Merged
nabil-becker merged 7 commits into
mainfrom
fix/agents-session-state-read/1
Oct 28, 2026
Merged

nabil-becker merged 7 commits into
mainfrom
fix/agents-session-state-read/1

Conversation

@nabil-becker

Copy link
Copy Markdown
Owner

What

  • agents 1.0.1: when an adapter's session list fails (any exit but 3), the agent's state is error with the reason; a resident is never started, woken or stopped on it, and the command prints how to resume by hand; on-demand --resume never becomes a new session; on-demand agents show running or none. New optional adapter verb hint.
  • claude-code 1.8.0: agent-adapter-claude reads the JSON array among other lines, retries once only after a timeout or empty answer, and reports the call, exit code and Claude's first line, with a hint when a wrapper may be rewriting arguments. New option additionalDirectories writes permissions.additionalDirectories into a managed-settings drop-in at build time, so a consumer needs no --add-dir wrapper (file access only: unlike --add-dir, the folder's CLAUDE.md and skills are not loaded).
  • Records since feat(agents): one agent list, two kinds, one verb for every agent CLI (agents 1.0.0, claude-code 1.7.0, devcontainer-cli 1.13.0) #84.

Why

A consuming repository's claude wrapper put --add-dir before every argument, so claude agents --json failed; agents 1.0.0 treated the failed list as "cannot list" and started fresh sessions, losing their context. Reproduced against Claude Code 2.1.312.

Checklist

  • Every commit is signed off (Signed-off-by:, DCO) - automatic after task repo:setup
  • version bumped in src/<id>/devcontainer-feature.json (semver): agents 1.0.1, claude-code 1.8.0
  • Downloads remain checksum-verified; nothing unverified is piped into a shell (no downloads added)
  • install.sh is idempotent and does not assume a remoteUser
  • Tests updated (test/<id>/test.sh, scenarios.json) and task test FEATURE=<id> passes: unit tests pass (agents 142; claude-code adapter 51, additional dirs 18, live session 181); the new Docker scenario additional_directories has not run (no daemon in the devhost), CI is its first run
  • taskfile.yml present and registered via installTaskfile (new Features)
  • task lint passes (in a clean worktree)
  • NOTES.md updated if behaviour or options changed, and task docs run so src/<id>/README.md is current

🤖 Generated with Claude Code

devhost agent and others added 4 commits October 28, 2026 11:21
…e-code additionalDirectories (agents 1.0.1, claude-code 1.8.0)

agents-session-state-read, agents-list-on-demand-none, claude-additional-dirs:

- agents 1.0.1: a failed list (any adapter exit but 3) is state "error" with the
  adapter's reason; resident start, --resume, --new and up start, wake and stop
  nothing and print how to resume by hand; on-demand --resume never becomes a
  new session; on-demand agents show running or none. New optional adapter verb
  "hint".
- claude-code 1.8.0: agent-adapter-claude takes the JSON array among other
  lines, reads through files, retries once only after a timeout or an empty
  answer, and reports the call, exit code and the CLI's first line, with a
  wrapper hint on "unknown option"; resume on an unreadable list opens Claude's
  picker. New option additionalDirectories writes permissions.additionalDirectories
  into a managed-settings drop-in at build time (the user's settings untouched).
- Tests for the office's wrapper failure, the retry rules and the option;
  mutation-checked.

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
Backlog and ledger since #84; agents-unreadable-list-fix names claude-code 1.8.0.

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
agents-session-state-read: the default and with_task scenarios hard-code the
Feature version and still said 1.0.0 (CI on #85).

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
… 1.0.1, claude-code 1.8.0, devcontainer-cli 1.14.0)

agents-retitle-check and the reset asked by the Operator:

- agent-adapter-claude records each agent's session (job id and session id) in
  CLAUDE_CONFIG_DIR/agent-adapter-claude/agents.tsv (600) and looks it up there
  first, then by name and folder, because Claude Code retitles a background
  session after its first prompts; a live session always beats ended ones and
  start-bg refuses while the recorded one runs. No setting makes a name sticky.
- agents reset <name>... | --all [--purge] [--include-unlisted] [--yes] [--force]:
  a dry run by default; stops an agent's duplicates (conversations kept),
  re-records, starts a resident with nothing running; --purge also removes the
  agent's ended sessions; only listed agents in their folders; refuses on
  uncommitted changes or inside a Claude Code session without --force. New
  optional adapter verbs record, session-stop, session-remove.
- devcontainer-cli 1.14.0: devcontainer:agent:reset.
- Tests for a retitled session, the reset's scope and refusals; mutation-checked.

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
@nabil-becker nabil-becker changed the title fix(agents): a session list that cannot be read starts nothing; claude-code additionalDirectories (agents 1.0.1, claude-code 1.8.0) fix(agents): unreadable lists start nothing, retitled sessions are found, agents:reset; claude-code additionalDirectories (agents 1.0.1, claude-code 1.8.0, devcontainer-cli 1.14.0) Oct 28, 2026
devhost agent and others added 3 commits October 28, 2026 11:50
agents-retitle-check: with no claude on PATH the adapter's list error read
'timeout: failed to run command'. It now says claude is not installed, and the
agents with_claude_code scenario expects state error with that reason (CI on #85).

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
…e only a purge

agents-retitle-check, the Operator's decision on the reset refusals (2026-10-28):
stopping a session is refused while it is mid-turn (status busy or state
working), not because its folder is dirty; uncommitted changes warn on a plain
reset and refuse --purge; --force overrides both. New optional adapter verb
session-busy (exit 3 = cannot tell, counted as not busy with a note).

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
ADR 0032 (extra working folders in managed settings) and ADR 0033 (the adapter
remembers the session id; reset refusals as the Operator decided), accepted;
backlog and ledger since #84.

Co-Authored-By: Claude Opus 5.5 <claude-opus-5-5@noreply.invalid>
Signed-off-by: devhost agent <devhost-agent@noreply.invalid>
@nabil-becker
nabil-becker merged commit 2163cd2 into main Oct 28, 2026
77 checks passed
@nabil-becker
nabil-becker deleted the fix/agents-session-state-read/1 branch October 28, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant