Skip to content
Closed
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
dbe9950
feat(cli): list managed Agent View sessions in qwen sessions ps
yiliang114 Sep 3, 2026
8879852
docs(skills): stop the recency gate from silencing a stalled wiring
yiliang114 Sep 3, 2026
06741f4
feat(cli): start a background Agent View session with --bg
yiliang114 Sep 3, 2026
eaa0a23
test(cli): pin the id a background worker registers under
yiliang114 Sep 3, 2026
9b14578
fix(cli): keep non-owned supervisor snapshots out of sessions ps
yiliang114 Sep 3, 2026
94610b3
fix(cli): verify managed session pids before listing them
yiliang114 Sep 3, 2026
3e3dac5
test(cli): pin LF and TAB stripping on the ps store-failure note
yiliang114 Sep 3, 2026
4d84fbc
docs(commands): warn that the jq -r example renders session text raw
yiliang114 Sep 3, 2026
29a69d0
fix(cli): route Agent View intercepts after bootstrap routing and scrub
yiliang114 Sep 3, 2026
993944c
fix(cli): decline --bg launches carrying flags they would silently drop
yiliang114 Sep 3, 2026
02b87ee
docs(settings): list --bg in the command-line arguments table
yiliang114 Sep 3, 2026
6b2c711
fix(cli): keep the sessions ps JSON contract off display wording
yiliang114 Sep 4, 2026
e5e0b6d
Merge branch 'feat/agent-view-first-consumer' into feat/agent-view-bg…
yiliang114 Sep 4, 2026
cd68e10
fix(cli): import the task-state type the row test annotates
yiliang114 Sep 4, 2026
1077718
Merge branch 'feat/agent-view-first-consumer' into feat/agent-view-bg…
yiliang114 Sep 4, 2026
853d57b
fix(cli): hold managed session rows to the registry's identity standard
yiliang114 Sep 4, 2026
d02752f
test(cli): give ps.test.ts the identity helpers its subject now calls
yiliang114 Sep 4, 2026
524a0fb
fix(cli): make --bg actually spawn its worker and harden the entry ar…
yiliang114 Sep 4, 2026
558bd25
fix(cli): correct sessions ps comment claims and pin every STATE label
yiliang114 Sep 4, 2026
32295e3
chore: merge main into feat/agent-view-first-consumer
yiliang114 Sep 4, 2026
b5cf6d9
fix(cli): finish sessions ps review cleanup
yiliang114 Sep 4, 2026
4c8b903
fix(cli): surface error-like rejection reasons from --bg dispatch
yiliang114 Sep 4, 2026
50e75a0
fix(cli): close the --bg gate's missed entrances and flag position
yiliang114 Sep 4, 2026
b3309dc
fix(cli): make the --bg gate value-slot-aware like its twin scan
yiliang114 Sep 4, 2026
35785e0
test(cli): witness the bare --bg argv through the entry gate
yiliang114 Sep 4, 2026
eb7642b
fix(cli): guard sessions ps managed pids by boot id like the registry
yiliang114 Sep 4, 2026
79ca2fc
fix(cli): report the resumable session id spelling in sessions ps
yiliang114 Sep 4, 2026
59bebf1
fix(cli): intercept the internal pty-host flag at the entry
yiliang114 Sep 4, 2026
c0e20c3
fix(cli): keep the help-word bounce off flag-led --bg launches
yiliang114 Sep 4, 2026
1b6310c
fix(cli): keep a broken pipe from flipping a --bg success into failure
yiliang114 Sep 4, 2026
c0d4eaf
fix(cli): leave help-flag launches with an attached --bg to the parser
yiliang114 Sep 4, 2026
c370250
test(cli): witness the last-positional help bounce in the --bg gate
yiliang114 Sep 4, 2026
0093956
fix(cli): name the -- prompt spelling in the --bg decline advice
yiliang114 Sep 4, 2026
d1f46f0
docs: say --bg returns once the worker has started, not immediately
yiliang114 Sep 4, 2026
357084c
style(docs): re-align the --bg table row after the wording change
yiliang114 Sep 4, 2026
0783984
fix(cli): carry a deduped record's spelling and pid onto a degraded m…
yiliang114 Sep 5, 2026
f95d21e
fix(cli): keep a --bg launch out of the internal Agent View intercepts
yiliang114 Sep 5, 2026
93ef1d0
fix(cli): report a --bg dispatch timeout as in flight, not failed
yiliang114 Sep 5, 2026
aefdf88
test(cli): witness the broken-pipe ordering inside the --bg dispatch
yiliang114 Sep 5, 2026
075b47d
Merge main into feat/agent-view-first-consumer
yiliang114 Sep 5, 2026
294cbe2
fix(cli): refuse managed pids from a worker file written on another OS
yiliang114 Sep 5, 2026
2c4d520
fix(cli): bound the --bg argv scans and stop certifying an in-flight …
yiliang114 Sep 5, 2026
074599a
test(cli): date the recorded session inside the dispatch window
yiliang114 Sep 5, 2026
3b772f1
Merge origin/main (00fe690482) into feat/agent-view-first-consumer
yiliang114 Sep 6, 2026
7c3e095
Merge origin/main into feat/agent-view-first-consumer
yiliang114 Sep 7, 2026
9d891f9
docs: normalize the sessions table padding prettier asks for
yiliang114 Sep 7, 2026
5fc3162
fix(cli): close the remaining --bg review findings
yiliang114 Sep 8, 2026
662923e
Merge origin/main into feat/agent-view-first-consumer
yiliang114 Sep 9, 2026
38e77c9
fix(cli): validate resumeSessionId before it becomes a row identity
yiliang114 Sep 19, 2026
10d09db
Merge remote-tracking branch 'origin/main' into pr-10942-sweep
yiliang114 Sep 19, 2026
83b98c1
fix(cli): import process-liveness and session-registry symbols from t…
yiliang114 Sep 19, 2026
8a95fe3
test(cli): intercept the deep process-liveness module in the sessions…
yiliang114 Sep 19, 2026
6a88aab
Merge the base branch feat/agent-view-first-consumer into feat/agent-…
yiliang114 Sep 19, 2026
6efd0c1
Merge origin/main into feat/agent-view-bg-dispatch
yiliang114 Sep 25, 2026
55b39f3
fix(cli): pin the --bg gate to all 11 commands and bound the spawn-sh…
yiliang114 Sep 25, 2026
6182a99
fix(cli): require a spawned PTY host before certifying a --bg launch …
yiliang114 Sep 25, 2026
74642c5
fix(cli): make the --bg store fixture and the wiring survey recipe co…
yiliang114 Sep 26, 2026
af8b5d8
refactor(cli): narrow the --bg PR to the entry wiring it actually needs
yiliang114 Sep 26, 2026
14435f4
Merge origin/main into feat/agent-view-bg-dispatch
yiliang114 Sep 26, 2026
0164cc9
test(cli): cover the batch command in the --bg gate pin
yiliang114 Sep 26, 2026
587767e
fix(cli): make --bg actually start a session, and stop guessing at argv
yiliang114 Sep 26, 2026
51a435b
fix(cli): close the --bg version-token cancel, spawn-hijack, and the …
yiliang114 Oct 1, 2026
ee479d9
Merge origin/main into feat/agent-view-bg-dispatch
yiliang114 Oct 1, 2026
1dc3f76
Merge origin/main into feat/agent-view-bg-dispatch
yiliang114 Oct 2, 2026
b838798
Merge branch 'main' into feat/agent-view-bg-dispatch
yiliang114 Oct 2, 2026
bad11e8
fix(cli): close the bg-dispatch review round on routing, listing, and…
yiliang114 Oct 3, 2026
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
1 change: 1 addition & 0 deletions .qwen/skills/find-simplifications/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ the issue comment.
| Several strong candidates in one run | File them all; land at most one |
| Report-only territory | File with evidence, marked report-only. Never a PR |
| Path or symbol younger than ~90 days | Drop **silently** — unwired new feature, not rot |
| A young **subsystem** unwired, its wiring PR open and stale | Not a deletion. Report the stall to that PR stack |
| A never-called migrator, validator, guard, or dropped wire-up | Not cleanup. It may be a defect → `/bugfix` or `/review` |
| Any consumer cannot be named | Drop |
| Correct but tiny (one dead import, a typo) | Reject on the ledger: below both skills' intake bar |
Expand Down
47 changes: 41 additions & 6 deletions .qwen/skills/find-simplifications/references/survey.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,27 @@ feature someone is still wiring up. (90 days is a heuristic, not a measured
threshold; widen it for a large subsystem.) Proposing deletion of something
that landed last week is the fastest way to lose a reviewer for good.

But "young" is not the fact the gate is reaching for — "still being wired
up" is, and the two come apart. A directory can keep growing for months
while its consumer never lands, and then every re-run of this survey dates
it young again and drops it again, which is how a subsystem gets to five
figures with nothing calling it. So when the gate fires on a **subsystem**
(not a single symbol), date the wiring rather than the code:

```bash
# has anything outside it ever referenced it?
"$RG" -l '<dir>/' --glob '!<dir>/**' packages
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
# and are the PRs that would wire it still open?
gh pr list --repo QwenLM/qwen-code --search '<feature> in:title' --state all
```

Recent commits inside the directory plus no external reference plus an open,
stalled wiring PR is **not** a deletion candidate and **not** a drop. It is a
different finding with a different owner: the wiring stalled. Report it to
that stack — the merged infrastructure has no entry point — and never as a
deletion PR. The code is wanted; the review that would connect it is what is
missing.

**3 — Published-surface escape.** Is the surface reachable from outside the
repo? SKILL.md § Territory is the authoritative list; keep the two in step.
Everything under `packages/core/src` is, via that package's `"./src/*"`
Expand Down Expand Up @@ -262,13 +283,27 @@ registry entry), not in `packages/core`, and `git log` puts it well past the
recency gate. Deletion is the component, its test, and its snapshot entry, in
one commit. This is what a filed candidate should look like.

**2. Everything says dead; `git` says five days old.** `packages/cli/src/agent-view`
is ~6,000 lines whose entry flag is passed to a spawned process but parsed
nowhere; every static signal calls it rot. Then:
**2. Everything says dead; `git` says five days old — and says it again a
month later.** `packages/cli/src/agent-view` was ~6,000 lines whose entry flag
is passed to a spawned process but parsed nowhere; every static signal called
it rot. Then:
`git log --follow --diff-filter=A --format=%ad --date=short -- packages/cli/src/agent-view
| tail -1` → `2026-08-01`, five days before HEAD. It is a feature mid-wiring.
**Drop silently.** Do not file it, do not mention it — a "should we delete
your new subsystem?" question costs more trust than the finding is worth.
| tail -1` → `2026-08-01`, five days before HEAD. A feature mid-wiring, so:
**do not file a deletion.** A "should we delete your new subsystem?" question
costs more trust than the finding is worth.

What this example originally got wrong was the second half — "do not mention
it". Measured again on 2026-09-04: **11,004 production lines, still zero
external references**, up ~8,000 in four weeks. The five merged PRs of its
stack shipped the supervisor, the PTY workers and the lifecycle; the two that
would give it an entry point (#7802 commands, #7803 roster TUI) have been
open since 2026-07-27, the second at +31,699 lines across 104 files and
conflicting. The recency gate kept firing and the survey kept dropping it, so
nothing ever said out loud that a five-figure subsystem had no caller.

The deletion verdict was right and stays right. The silence was not: this is
the stalled-wiring finding above, owed to that PR stack, not to a cleanup
list.

**3. The naive count is wrong in both directions.**
`eslint.legacy-filenames.mjs` lists 559 bare basenames. Checking "does a
Expand Down
1 change: 1 addition & 0 deletions docs/users/configuration/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ For sandbox image selection, precedence is:
| `--model` | `-m` | Specifies the Qwen model to use for this session. | Model name | Example: `npm start -- --model qwen3-coder-plus` |
| `--prompt` | `-p` | Used to pass a prompt directly to the command. This invokes Qwen Code in a non-interactive mode. | Your prompt text | For scripting examples, use the `--output-format json` flag to get structured output. |
| `--prompt-interactive` | `-i` | Starts an interactive session with the provided prompt as the initial input. | Your prompt text | The prompt is processed within the interactive session, not before it. Cannot be used when piping input from stdin. Example: `qwen -i "explain this code"` |
| `--bg` | | Experimental. Runs the prompt as a background session owned by a supervisor, and returns once the worker has started, printing the session id. | Your prompt text | Other launch flags are not honored; pass the prompt alone. List background sessions with `qwen sessions ps`. Example: `qwen --bg "audit the release"` |
| `--system-prompt` | | Overrides the built-in main session system prompt for this run. | Your prompt text | Loaded context files such as `QWEN.md` are still appended after this override. Can be combined with `--append-system-prompt`. |
| `--append-system-prompt` | | Appends extra instructions to the main session system prompt for this run. | Your prompt text | Applied after the built-in prompt and loaded context files. Can be combined with `--system-prompt`. See [Headless Mode](../features/headless) for examples. |
| `--output-style` | | Selects the output style that shapes how responses are written for this run. | Style name | `Concise`, `Proactive`, `Explanatory`, `Learning`, or `default` for no style (case-insensitive). Overrides the `general.outputStyle` setting. An unknown name prints a warning and the session starts with the default style. Has no effect when `--system-prompt` or `QWEN_SYSTEM_MD` replaces the built-in prompt. See [Headless Mode](../features/headless) for examples. |
Expand Down
80 changes: 65 additions & 15 deletions docs/users/features/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,10 @@ These commands are run from the shell as `qwen <subcommand>` before starting an

### Session Management

| Command | Description | Usage Examples |
| -------------------- | ------------------------------------------- | ------------------------------------------------------------ |
| `qwen sessions list` | List recent conversation sessions | `qwen sessions list`, `qwen sessions list --json --limit 50` |
| `qwen sessions ps` | List interactive sessions running right now | `qwen sessions ps`, `qwen sessions ps --json` |
| Command | Description | Usage Examples |
| -------------------- | ----------------------------------- | ------------------------------------------------------------ |
| `qwen sessions list` | List recent conversation sessions | `qwen sessions list`, `qwen sessions list --json --limit 50` |
| `qwen sessions ps` | List the sessions running right now | `qwen sessions ps`, `qwen sessions ps --json` |

#### `qwen sessions list`

Expand Down Expand Up @@ -750,14 +750,35 @@ qwen sessions list --limit 50
qwen sessions list --json | jq .
```

#### `qwen --bg "<prompt>"`

Experimental. Runs a prompt as a background session and returns once the worker has started, printing the session id.

The session is owned by a supervisor process that outlives the shell you started it from, so closing that terminal does not stop the work. `qwen sessions ps` lists it, and says whether it is `working` or has stopped to ask you something. It is a full Qwen Code session, so — when `agents.crossSessionMessaging` is on — it also appears in another session's `list_agents` and can be addressed with `send_message` (see [Messaging Another Running Session](#6-messaging-another-running-session)).

```bash
qwen --bg "find out why the release job is flaky"
# Started background session 0f8e...c31
# See it with: qwen sessions ps
```

What it does not do yet: there is no way to attach to a background session, read its transcript, answer its question from the CLI, or stop it. Those land with the Agent View roster.

#### `qwen sessions ps`

Lists the interactive Qwen Code sessions running on this machine right
now. `sessions list` walks saved transcripts ("what have I worked on");
this walks the live-process registry ("what is running at this moment").
Records left behind by a killed session are swept as they are found.
Headless sessions (`qwen -p`) do not register with the live-process
registry, so they are not shown.
Lists the Qwen Code sessions running on this machine right now.
`sessions list` walks saved transcripts ("what have I worked on"); this
answers "what is running at this moment".

Two kinds of session are listed. An **interactive** session is one you
started in a terminal; it registers in the live-process registry, and
records left behind by a killed session are swept as they are found. A
**managed** session is an Agent View session owned by a supervisor: it
writes no registry record, so it used to be invisible here. Managed
sessions are listed first, because one of them may be waiting for an
answer.

Headless sessions (`qwen -p`) register nowhere and are not shown.

**Flags:**

Expand All @@ -767,20 +788,43 @@ registry, so they are not shown.

**Human-readable output (default):**

A table with columns: NAME, PID, AGE, DIRECTORY.
A table with columns: NAME, PID, AGE, STATE, DIRECTORY.

STATE is `interactive` for a session you started yourself. For a managed
session it is what that session is actually doing — `needs input`,
`working`, `ready`, `stopped` or `failed`. Those are display labels; the
`--json` output carries stable tokens instead (see below). PID and AGE print `-` for a
managed session with no process behind it (one that has exited, or has
not started its worker yet).

**JSON output (`--json`):**

Outputs JSON Lines on stdout, newest session first. Each line is a JSON
object with fields:
Outputs JSON Lines on stdout, managed sessions first. Every line carries
a `managed` field saying which kind it is.

An interactive session is emitted as its whole registry record, plus
`managed: false`:

```
schemaVersion, pid, procStart, pidNs, sessionId, cwd, name, startedAt,
qwenVersion
qwenVersion, managed
```

A managed session has no such record and is emitted as the row itself:

```
name, pid, startedAt, cwd, taskState, sessionId, managed
```

`taskState` is the machine-readable form of the STATE column, and is the
field to script against: `running`, `waiting`, `ready`, `stopped` or
`failed`. The column's wording can change; these tokens will not.

Nothing else is written to stdout — an empty listing prints nothing at
all — so `qwen sessions ps --json | jq .` is safe to script against.
all — so `qwen sessions ps --json | jq .` is safe to script against. If
the supervisor's own bookkeeping cannot be read, the interactive half is
still listed and the reason is reported on stderr, which leaves stdout
parseable.

JSON output is raw data: field values are emitted exactly as recorded,
with no terminal sanitization. Treat them as data, and sanitize before
Expand All @@ -796,6 +840,12 @@ qwen sessions ps
# Note: `jq -r` renders the raw recorded value in your terminal (see the
# raw-data note above); pipe through a sanitizer if the path is untrusted.
qwen sessions ps --json | jq -r .cwd

# Which background sessions are waiting on me?
# Note: `jq -r` renders the raw recorded value in your terminal (see the
# raw-data note above); a session name is session-generated text, so pipe
# through a sanitizer if it is untrusted.
qwen sessions ps --json | jq -r 'select(.taskState == "waiting") | .name'
```

## 6. Messaging Another Running Session
Expand Down
Loading
Loading