Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Please choose versions by [Semantic Versioning](http://semver.org/).
* MINOR version when you add functionality in a backwards-compatible manner, and
* PATCH version when you make backwards-compatible bug fixes.

## Unreleased

- fix: session-close Phase 5 no longer flags background processes from sibling sessions — candidates come from this conversation's `run_in_background` / `Monitor` calls, not a machine-wide `ps aux` scan; each session cleans up only its own daemons

## v0.102.2

- fix(agent): `work-on-goal-assistant`'s batch status call now passes the goal in wikilink form (`--goal "[[Name]]"`). `task list --goal` matches the task's `goals:` frontmatter verbatim, so the bare name shipped in v0.102.1 returned `null` for every real goal — silently, since `null` is not an error. Correctness was preserved by the per-task fallback, but the batch path never fired, so the "one call instead of N reads" claim in v0.102.1 did not hold. Also documents the asymmetry with `goal set`, which takes the bare name, and tells the agent to treat `null` on a goal that lists task refs as a failed call rather than an empty goal.
Expand Down
23 changes: 19 additions & 4 deletions commands/session-close.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,32 @@ Do not collapse failures into a generic warning — each unverified task is its

### Phase 5: Check for orphaned background processes

**Scope: THIS session's processes only.** Build the candidate list from the conversation, not from the process table — a machine-wide `ps` scan cannot tell a sibling session's daemon from your own, and flagging someone else's is a false positive that makes the verdict untrustworthy.

Enumerate background work **this session started**:

- Bash calls made with `run_in_background: true` in this conversation
- `Monitor` watches armed in this conversation
- Long-running foreground commands this session backgrounded explicitly

If that list is empty → **skip this phase silently. Do NOT run `ps aux`.**

Only for PIDs already on that list, confirm liveness:

```bash
jobs -l 2>/dev/null
ps aux | grep -E '(dark-factory|daemon|watch)' | grep -v grep | head
ps -p <pid> -o pid=,etime=,command= 2>/dev/null
```

If anything is still running that the user spawned this session, call it out. Don't kill anything without confirmation.
Report only those that are still alive. Don't kill anything without confirmation.

**Never flag a process this session didn't spawn** — including `dark-factory daemon`, watchers, or dev servers belonging to sibling Claude sessions. Each session cleans up its own; another session's daemon is that session's business, and its `session-close` will handle it.

### Phase 6: Check for in-flight dark-factory work

If `DARK_FACTORY` is absent OR no project in scope has a `.dark-factory.lock` file → skip silently.

"In scope" means a repo **this session touched** (Phase 1's `Repos` list). A dark-factory project this session never edited belongs to another session — skip it, even if its daemon is running.

Otherwise, check daemon status:

```bash
Expand Down Expand Up @@ -356,7 +371,7 @@ Omit any line with zero entries. If nothing was touched (e.g. talk-only session)
1. <repo>: N uncommitted file(s) — <first path>
2. ~/.claude: untracked <file>
3. Orphan worktree: ~/Documents/workspaces/<name> (branch <feat>, deleted from remote) — `git worktree remove ../<name>`
4. dark-factory daemon (pid X) running in <project>
4. dark-factory daemon (pid X) — spawned by THIS session, still running in <project>
5. Link hygiene: [[<new page>]] orphaned — add backlink from [[<hub>]]
6. Consider /vault-cli:reflect — N knowledge file(s) created, org-level decisions captured
7. Consider /coding:self-improve — N friction signal(s): general correction, command misfire
Expand Down
Loading