Commit graph

4 commits

Author SHA1 Message Date
jifeng
858c900af9
feat(serve): add daemon idle detection to GET /health?deep=true (#4934)
* docs(design): add daemon idle detection API design for machine reclamation

When qwen daemon is deployed across multiple machines, an external
scheduler needs a reliable signal to determine if a daemon is idle
and the machine can be reclaimed. This design proposes enhancing
GET /health?deep=true with activePrompts, connectedClients,
channelAlive, lastActivityAt, and idleSinceMs fields.

* feat(serve): add idle-detection fields to GET /health?deep=true

* fix(test): add activePromptCount and lastActivityAt to fakeBridge

Update the test helper to satisfy the expanded AcpSessionBridge
interface so /health?deep=true tests pass with the new fields.

* test(idle-detection): add unit tests for activePromptCount, lastActivityAt and /health?deep=true new fields

* refactor(bridge): replace activePromptCount iteration with O(1) counter

* fix(bridge): move idleSinceMs computation into bridge to eliminate race window

* fix(idle-detection): keep daemon health state consistent

Guard prompt teardown so activePromptCount only decrements once and compute deep health idle fields from the same activity snapshot.

* fix(acp): prevent active prompt leak after channel crash

Reject queued prompts after their session entry has been torn down so daemon health does not report phantom active prompts.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-18 06:55:03 +00:00
Dragon
3408c32110
docs: fix MCP token path, daemon UI event count, add Feishu channel (#5172)
* docs: fix MCP token path, daemon UI event count, add Feishu channel

- mcp.md: update OAuth token storage path to v2 encrypted file
  (mcp-oauth-tokens-v2.json with AES-256-GCM, keychain preferred)
- daemon/00-index.md: fix UI event type count (36 → 37)
- daemon/01-architecture.md: add Feishu to channel bots diagram
- daemon/15-channel-adapters.md: add Feishu adapter (WebSocket/webhook,
  config keys, permission UX, reverse-call caveat)

* docs: correct Feishu config keys and permission UX caveat

Address review feedback on 15-channel-adapters.md:
- Feishu config keys are clientId/clientSecret (not appId/appSecret),
  per FeishuAdapter.ts:116-118; add encryptKey (required for webhook
  mode, enforced at FeishuAdapter.ts:165-168).
- Note that channel permission UX currently auto-approves via AcpBridge
  (AcpBridge.ts:111); interactive approval is planned.

* docs: fix missed sibling references for audit consistency

Address review feedback (wenshao) — apply the same corrections to other
doc locations that referenced the stale values:
- MCP token path: also fix docs/developers/tools/mcp-server.md (was still
  ~/.qwen/mcp-oauth-tokens.json).
- UI event type count 36 -> 37: also fix 14-cli-tui-adapter.md (3 spots),
  13-sdk-daemon-client.md.
- Feishu channel: add Feishu rows to both tables in 15-channel-adapters.md
  (Per-channel adapters + Adapter matrix) and the package-level Adapters
  subgraph in 01-architecture.md, so prose/tables/diagrams all agree.
- Add a note under the Adapter matrix clarifying that Permission UX /
  approvalMode are not wired yet (all channels auto-approve via AcpBridge).
2026-06-16 11:37:43 +08:00
jinye
1d2ee34f44
docs(daemon): Refresh daemon docs in English (#5144)
* docs: Translate daemon developer docs to English

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* docs: Align daemon docs with main implementation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* fix: apply auto-fixes from /review

- eventRingSize default: 1024 → 8000 (01-architecture.md)
- Restore full 8-step middleware chain in HTTP lifecycle diagram
- Hysteresis re-arm condition: <= → < (06-mcp-budget-guardrails.md)
- permissionMediator.ts line range: 1-1292 → 1-1198
- FsErrorKind count: 13 → 14 (07-workspace-filesystem.md)
- Remove broken links to design/f2-mcp-transport-pool.md

* docs: Smooth daemon developer docs language

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* docs: Sync daemon capability docs

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* codex: address PR review feedback (#5144)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* codex: address PR review feedback (#5144)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* codex: address PR review feedback (#5144)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-06-15 22:38:01 +08:00
jinye
75e8f259c4
docs: Refresh daemon developer docs (#4412)
* docs: Refresh daemon developer docs

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* docs: Address daemon review feedback

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* docs: Address daemon review suggestions

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* codex: address PR review feedback (#4412)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* codex: address PR review feedback (#4412)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* codex: address PR review feedback (#4412)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-06-15 02:01:37 +08:00