Repository navigation
feat(cli): observe, configure and control a session from the terminal - #897
Merged
Merged
Conversation
`future session info` reads the persisted journal and `future session set` reached only five options, so a headless caller could start a run and then had no way to see how the session was configured, stop it, or answer an approval it was parked on. This closes those gaps, mostly by wrapping RPCs the TUI and Desktop already used. Observation - `future session status <id> [--json] [--metrics]` reads `get_state`: the effective tool permission, the sandbox tier, context occupancy (tokens/window/percent, as opposed to `session info`'s lifetime totals), the loaded context files and skills, active/queued runs and pending approvals. A session pinned to `workspace` while the global default is `all` is only answerable here; `config get` and `session info` cannot express it. - `session transcript` now carries every entry's run outcome and token usage, and `--runs` prints a one-row-per-run ledger (status, duration, tokens, error). `--counts` gained run-status and token sections. - `--counts`/`--runs` cover the whole session by default: the byte budget only applies when the caller asks for it, so a distribution is never quietly partial. A cut now says to raise `--max-bytes` instead of pointing at `--cursor`, which the summaries reject. Configuration - `session set` gained the live-session group: `--tools`, `--no-tools`, `--no-builtin-tools`, `--system-prompt`, `--append-system-prompt`, `--permission`, `--sandbox`, `--context-files`, `--auto-compact`, `--auto-retry` — each validated here, each scoped to the target session, and readable back with `session status`. `--tools` and the two disable switches are mutually exclusive whichever order they arrive in. Control - `future session abort|cancel|approvals|approve|reject` — the CLI counterpart of the TUI's `/stop`, `/cancel`, `/approve` and `/reject`. `approve --allow <glob>` installs the standing rule *before* the decision (so the approved tool already sees it) and, if the decision then fails, says so rather than hiding the permission it left standing. Lifecycle - `session new|fork|forks|clone|title|export`. `new` returns deliberately: #774 dropped it because "a create path whose result no command consumes", and that premise is now gone — `session set` configures and `session status` reads the session back. `title` is a model call, so it prints the suggestion and only renames with `--apply`; its language defaults to the desktop app's `titleLanguage`. Wire contract - `SessionState` gained `optional string sandbox_tier = 41`. `--sandbox` was write-only: the agent stored the policy but nothing read it back, so a caller could never tell an explicitly chosen tier from the default. Absent means "no policy set", which is not the same as `off`. Additive and optional, so an older agent simply omits it (verified against the running one). Docs updated in both languages (self-inspection, session-history, the CLI wiki).
huichen
enabled auto-merge (squash)
October 3, 2026 13:04
huichen
added a commit
to futuregene/future-skills
that referenced
this pull request
Oct 3, 2026
`future session info` reads the journal and `session set` reached five options, so the skill had no answer for "how is this session configured right now", "stop it" or "it is waiting on an approval". futuregene/future-os#897 added those, and this teaches them: - `future session status <id> [--json] [--metrics]` — the live view: effective permission, sandbox tier, context occupancy, context files, loaded skills, runs and pending approvals. §2 now says explicitly that `info` and `status` answer different questions, because the two are easy to confuse and the wrong one gives a confidently wrong answer (a session at `workspace` while `config get` says `all`). - `session set`'s live-session group (`--tools`, `--no-tools`, `--no-builtin-tools`, `--system-prompt`, `--append-system-prompt`, `--permission`, `--sandbox`, `--context-files`, `--auto-compact`, `--auto-retry`), all readable back with `status`. - `abort` / `cancel` / `approvals` / `approve` / `reject`, with `--allow`. - `session new|fork|forks|clone|title|export`, noting that `title` is a model call and that `new` stays out of `session list` until its first run. - `transcript`: per-entry run outcome and usage, `--runs`, and that the summaries cover the whole session by default. Also corrects two now-stale claims (the tool set *is* settable from the CLI, and reasoning *is* reachable via `transcript --select thinking`) and drops the "would reject the flag" wording. Version 1.6.0 -> 1.7.0.
huichen
added a commit
to futuregene/future-skills
that referenced
this pull request
Oct 3, 2026
…70) `future session info` reads the journal and `session set` reached five options, so the skill had no answer for "how is this session configured right now", "stop it" or "it is waiting on an approval". futuregene/future-os#897 added those, and this teaches them: - `future session status <id> [--json] [--metrics]` — the live view: effective permission, sandbox tier, context occupancy, context files, loaded skills, runs and pending approvals. §2 now says explicitly that `info` and `status` answer different questions, because the two are easy to confuse and the wrong one gives a confidently wrong answer (a session at `workspace` while `config get` says `all`). - `session set`'s live-session group (`--tools`, `--no-tools`, `--no-builtin-tools`, `--system-prompt`, `--append-system-prompt`, `--permission`, `--sandbox`, `--context-files`, `--auto-compact`, `--auto-retry`), all readable back with `status`. - `abort` / `cancel` / `approvals` / `approve` / `reject`, with `--allow`. - `session new|fork|forks|clone|title|export`, noting that `title` is a model call and that `new` stays out of `session list` until its first run. - `transcript`: per-entry run outcome and usage, `--runs`, and that the summaries cover the whole session by default. Also corrects two now-stale claims (the tool set *is* settable from the CLI, and reasoning *is* reachable via `transcript --select thinking`) and drops the "would reject the flag" wording. Version 1.6.0 -> 1.7.0.
huichen
added a commit
that referenced
this pull request
Oct 3, 2026
future-skills#70 teaches future-self the session status/control/lifecycle commands added in #897 (future session status, session set's live options, abort/cancel/approvals/approve/reject, new/fork/clone/title/export, and the transcript run ledger), so the installed skill matches the CLI beside it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
future session inforeads the persisted journal, andsession setreached only five options. So a headless caller could start a run and then had no way to see how the session was configured, stop it, or answer an approval it was parked on. This closes those gaps — mostly by wrapping RPCs the TUI and Desktop already used.Observation
future session status <id> [--json] [--metrics]readsget_state: effective tool permission, sandbox tier, context occupancy, loaded context files and skills, active/queued runs, pending approvals. A session pinned toworkspacewhile the global default isall, or at 40% context while having spent 40M tokens lifetime, is only answerable here.session transcriptnow carries each entry's run outcome and token usage, and--runsprints a one-row-per-run ledger.--countsgained run-status and token sections.Configuration
session setgained the live-session group —--tools,--no-tools,--no-builtin-tools,--system-prompt,--append-system-prompt,--permission,--sandbox,--context-files,--auto-compact,--auto-retry— each validated client-side, scoped to the target session, and readable back withsession status. Contradictory tool options are rejected in either order.Control
future session abort|cancel|approvals|approve|reject— the CLI counterpart of the TUI's/stop,/cancel,/approve,/reject.approve --allow <glob>installs the standing rule before the decision (so the approved tool already sees it) and, if the decision then fails, says so rather than hiding the permission it left standing.Lifecycle
session new|fork|forks|clone|title|export.newreturns deliberately — #774 dropped it because "a create path whose result no command consumes", and that premise is now gone.titleis a model call, so it prints the suggestion and only renames with--apply.Wire contract
SessionStategainedoptional string sandbox_tier = 41.--sandboxwas write-only: the agent stored the policy and nothing read it back, so a caller could never tell an explicitly chosen tier from the default. Absent means "no policy set", which is different fromoff. Additive and optional, so an older agent simply omits it.Two bugs found and fixed while testing
--countssilently truncated at the 256 KiB output budget (84 of 529 entries on a real session). Summaries now cover the whole session unless--max-bytesis passed, and a cut says to raise it instead of pointing at--cursor, which the summaries reject.approve --allowcould leave a standing permission with no indication when the decision failed.Testing
cargo test -p future-rpc/-p future-cli/-p future-agent— 135 + 872 + 2094 pass (34 new transcript, 22 new session, 11 new status, 6 new rpc tests)cargo fmt --all --check;cargo clippy -p future-rpc -p future-cli -p future-tui --no-deps --all-targets -- -D warningsclean. The full-workspace clippy run shows two pre-existingnonminimal_boolhits inagent/src/session/compaction_ops.rsandchannels/src/feishu/feishu_rest.rs— both untouched by this branch, and both a known false positive of the locally-shadowing clippy 1.96 (CI's pinned 1.97 passes);git diff origin/mainon those files is empty.make generate-protois idempotent (identical hash across runs) and leaveschannels/src/generated/feishu_ws.rsuntouched.python3 scripts/docs/check-docs.py(+--strict-pending),check-channel-matrix.py--home /tmp/... --grpc-addr 127.0.0.1:5198x, never the user's):new→set(every live option) →statusreflects them →--no-tools→abortwith nothing running →cancelunknown run →approvals→forks→forkwithout--entry→clone→title(no provider: fails cleanly) →export(real HTML written) → unknown session.(default)with the key absent;manual/sandbox/offeach read back through the CLI, the--jsonform and rawgrpcurl.Sandbox: (default)rather than failing.