Skip to content

feat(cli): say where commands run and ship a container for unattended runs - #490

Merged
lg2m merged 3 commits into
mainfrom
feat/plan-g-unattended
Oct 29, 2026
Merged

lg2m merged 3 commits into
mainfrom
feat/plan-g-unattended

Conversation

@lg2m

@lg2m lg2m commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Change

Plan section G. Commands QQ runs use the user's account, network and
credentials, and until now nothing said so. This PR says it, and makes it
easy to run QQ in a container instead.

  • qq doctor has two new checks: environment (on the host or in a
    container, and what commands can reach) and snapshots (whether
    qq undo works here; a warning outside Git).
  • The TUI's first screen shows the same two facts under its hints.
  • qq run --goal on the host prints one note: line on stderr that links
    the new guide. It reads no input and changes no exit code. Inside a
    container there is no note.
  • Dockerfile: a small runtime image (git, tini, a non-root agent
    user) that runs qq or qq daemon run with only /workspace mounted.
    Its dev stage backs .devcontainer/, which uses the repository's
    toolchain, puts qq on PATH, and clears SSH_AUTH_SOCK.
  • New guide page docs/guide/running-unattended.md: mount only the
    project, use a fine-grained token per repository, give the agent its own
    Git identity, block commands with managed deny_shell_prefixes, and why
    a machine with production credentials is the wrong host.
  • CI: a new devcontainer smoke job builds the devcontainer and runs
    three smoke scenarios inside it against the loopback fake provider.

Verification

  • cargo xtask check: passed (409.6 s) on the tree before a one-line
    Dockerfile change (USER=agent); fmt and lint rerun clean after it.
  • cargo xtask smoke --only run-tool-call --only run-goal-budget --only doctor-and-config
    passes on the host (one leading host note; doctor says "on the host")
    and inside the devcontainer (no note; doctor says "in a container").
  • New unit tests cover container detection, the exact wording, both
    doctor checks (outside Git, then after git init), and the TUI render
    at two widths.
  • Built the runtime image locally. qq doctor inside it reported
    in a container (/.dockerenv): commands run as agent, … with snapshots
    on, and qq daemon run served at 127.0.0.1:37441 inside the
    container.

Known impact

  • The new CI job adds several minutes, mostly the image build and a cold
    cargo build.
  • The TUI was not driven in a live terminal (no tmux here); the render
    tests cover the first screen.
  • The qq doctor check list grows from 9 to 11; --json consumers see
    two more entries.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-10-29T02:33:02.665797Z 4a21297 New commits
ℹ️ 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: fa55d0e740

ℹ️ 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 src/environment.rs Resolved
Comment thread Dockerfile Resolved
Comment thread docs/guide/running-unattended.md Resolved
Comment thread docs/guide/running-unattended.md Resolved

@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: bdb2014da0

ℹ️ 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 xtask/src/smoke.rs Resolved
lg2m added 3 commits October 28, 2026 19:17
… runs

Commands run as the user with the user's network and credentials, and
nothing told them so. qq doctor gains environment and snapshots checks,
the TUI's first screen states both, and a host qq run --goal prints one
note linking the new running-unattended guide. A Dockerfile and
.devcontainer/ run qq with only the project mounted, and CI smokes qq
inside the devcontainer against the loopback fake provider.
Detect the container off Tokio workers, create the image's data
directory as agent-owned 0700 so a fresh named volume works for the
daemon, and make the guide's examples run as written: pick a model with
QQ_MODEL and show a complete managed.ron.
@lg2m
lg2m force-pushed the feat/plan-g-unattended branch from bdb2014 to 4a21297 Compare October 29, 2026 02:30
@lg2m
lg2m merged commit 40525dc into main Oct 29, 2026
10 checks passed
@lg2m
lg2m deleted the feat/plan-g-unattended branch October 29, 2026 02:38
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