Skip to content

Lead desk: deterministic queue watcher, cheap triage subagents, transferable docs - #112

Merged
ThinkOffApp merged 1 commit into
mainfrom
feat/lead-desk
Sep 19, 2026
Merged

ThinkOffApp merged 1 commit into
mainfrom
feat/lead-desk

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

Adds a deterministic queue watcher (scripts/lead-desk.py), two cheap triage subagents (.claude/agents/lead-triage.md, .claude/agents/room-steward.md) and transferable docs (docs/lead-desk.md).

Why each piece exists, from the commit message:

  • Intents live in an in-memory Map in the daemon, so a restart destroys the queue with no message. The watcher reports a vanished intent as "vanished (daemon restart?)", never as a decision it did not witness.
  • Room confirmation cards are clipped at ~300 characters on one host, so the room is not a reliable source of the command being approved. The watcher reads /intents on the daemon and flags [CLIPPED?] on the full text.
  • "Daemon unreachable" and "queue empty" are different facts and are never rendered the same way. The process exits 3 when any daemon was unreachable.
  • Severity tie-break is most-restrictive-wins: AUTH-PATH > DESTRUCTIVE > CREDENTIAL > PAID > LEAD-OK. Classification is a lower bound.

Verified: 29 tests in test/lead_desk_test.py.

Trap the commit calls out, worth knowing before anyone renames the file: the test file must be test/lead_desk_test.py, a valid module name. unittest discover SILENTLY SKIPS filenames that are not identifiers and exits 0 with "NO TESTS RAN" - a check that cannot fail.

Built by an Opus 5 subagent to a spec from the lead; the spec named the wrong model in its trailer and the wrong test filename, both corrected in this branch.

🤖 Generated with Claude Code

…ferable docs

Built by an Opus 5 subagent to a spec from the lead; the spec named the wrong
model in this trailer and the wrong test filename, both corrected here.

WHY each piece exists:
- Intents live in an in-memory Map in the daemon, so a restart destroys the
  queue with no message. The watcher reports a vanished intent as
  "vanished (daemon restart?)", never as a decision it did not witness.
- Room confirmation cards are clipped at ~300 characters on one host, so
  the room is not a reliable source of the command being approved. The
  watcher reads /intents on the daemon and flags [CLIPPED?] on the full text.
- "Daemon unreachable" and "queue empty" are different facts and are never
  rendered the same way; the process exits 3 when any daemon was unreachable.
- Severity tie-break is most-restrictive-wins: AUTH-PATH > DESTRUCTIVE >
  CREDENTIAL > PAID > LEAD-OK. Classification is a lower bound.
- Test file is test/lead_desk_test.py, a valid module name: unittest
  discover SILENTLY SKIPS filenames that are not identifiers and exits 0
  with "NO TESTS RAN", which is a check that cannot fail.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-19T21:53:09.003740Z fe6822a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe6822af1b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lead-desk.py
Comment on lines +180 to +181
target = url.rstrip("/") + "/intents"
req = urllib.request.Request(target, method="GET", headers={"Accept": "application/json"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow polling authenticated confirmation daemons

When mcp.confirmations.auth_token is configured, src/confirmations.mjs applies its bearer-token check to every route, including GET /intents, but this request sends only an Accept header and exposes no way to supply authorization. Such daemons therefore always appear UNREACHABLE (HTTP 401), making the advertised fleet watcher unusable for secured hosts; accept a per-daemon token or another non-hardcoded credential source and send the bearer header.

Useful? React with 👍 / 👎.

Comment thread scripts/lead-desk.py
Comment on lines +224 to +226
"clipped": looks_clipped(prompt),
"prompt_excerpt": excerpt(prompt),
"prompt_len": len(prompt),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return the full prompt from the triage recovery command

When the lead-triage agent receives only the watcher line, its instructions tell it to rerun --once --json to obtain the full prompt, but each JSON row retains only this 100-character prompt_excerpt and the length. Consequently the documented recovery path still cannot inspect content after character 100 (or quote the deciding token as required), forcing escalation or an incomplete judgment for longer intents; include the original prompt in machine-readable output or provide a dedicated full-prompt lookup.

Useful? React with 👍 / 👎.

name: room-steward
description: Read the last N room messages and flag breaches of the room rules - overlong posts, method detail that belongs in DM, re-litigated numbers, duplicate conclusions. Drafts a one-line nudge for the lead to send. Never posts anything itself.
model: haiku
tools: Bash, Read

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Give room-steward access to the read-only room tool

For the documented invocation that passes a room name rather than copied messages, the agent is instructed to fetch mcp__ide-agent-kit__room_recent, but this frontmatter allowlist grants only Bash and Read. The subagent therefore cannot obtain the messages it is supposed to review in the normal <ROOM> workflow; add the read-only room-recent tool to the allowlist while continuing to exclude write routes.

Useful? React with 👍 / 👎.

@ThinkOffApp
ThinkOffApp merged commit c6dd1e6 into main Sep 19, 2026
3 checks passed
@ThinkOffApp
ThinkOffApp deleted the feat/lead-desk branch September 19, 2026 22:34
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