Repository navigation
feat(loop): agent list + enforce --agent-id on run (parallel-safety) - #125
Merged
Merged
Conversation
added 2 commits
August 8, 2026 10:56
Add `future loop agent list --goal G`: lists every registered agent with its current execution status, so parallel workers check who is already registered before registering/launching (avoid duplicate ids). - status derived from the live task-lease ledger: running = holds a live lease on a todo right now (todo id + lease remaining); idle = registered but holding no lease. - also shows declared capabilities (agent_profiles) and the agent's most recent activity (from agent/lease events). - onboard now accepts both --capability and --capabilities (docs used the plural form; code only parsed the singular). - contract tests: empty goal, registered-only ids, live-lease → running / release → idle; help + registry surface updated. - skill (1.0.3): document agent list in the command reference and the register-once/reuse-ids guidance.
Make run identity mandatory so the lease mechanism always engages: - `run` now REQUIRES --agent-id and fails fast (before any gRPC/session work) with a hint pointing at `agent list`; --anonymous opts back into the legacy uncoordinated one-shot path with a warning. - ensure_run_identity(): auto-registers an unregistered id on first use (replay is idempotent, so no separate register step); already-registered ids pass through without appending duplicate events. - run claims the task lease with --lease-secs (default 4h instead of the hardcoded 1h — long LLM/compute turns routinely exceed 1h, which let another worker steal the todo mid-turn once the lease expired). - --anonymous added to the boolean-flag set in parse_pairs. - run_identity_contract.rs: 5 tests (fail-closed hint, anonymous escape, auto-register once + no duplicate event, existing id passthrough, CLI fail-fast before connecting). - skill 1.0.3: fold in the user's 6.0/6.1 parallel-safety sections (main working-tree copy) and update them for the enforced behavior; document agent list, auto-register, 4h lease, --lease-secs. - agent/src/llm/mod.rs: copy user's LLM timeout change (600→1800s + FUTURE_LLM_TIMEOUT_SECS env override) from main working tree.
huichen
added a commit
that referenced
this pull request
Nov 15, 2026
huichen
added a commit
that referenced
this pull request
Nov 15, 2026
…ogue-lane wait; bump skills (#1625) * feat(cli): pin and unpin conversations and workspaces from the terminal The desktop app's pinned section had no CLI: `future session list` is a gRPC call to the Agent, which has no notion of a pin, and nothing read the flag the app stores on `threads.pinned` / `workspaces.pinned`. So a user could see the section in the app and had no way to inspect or change it from a terminal. Adds both scopes, both directions, and both listings: future session pin|unpin <session-id> future session pinned [--json|--format toon] future workspace pin|unpin <path|id|name> future workspace list --pinned [--json] The writes go through `store::pin_thread` / `store::pin_workspace` — the same calls the app and the remote bridge use — so the catalogue-dirty signal that tells the app and a paired phone to re-read is not bypassed, and `pinned` stays an ordering flag rather than becoming an activity event: neither `updated_at` nor `last_opened_at` is rewritten, which a test asserts at both scopes. The readings use the store's own queries (`list_pinned_threads` with the app's `Recent` scope, `list_pinned_workspaces`), so the terminal, the sidebar and the phone cannot disagree about what is pinned or in which order. Two consequences of the app's existing rules are reported rather than left to be discovered: archiving clears the pin (a pinned row on the shelf would hide behind it), so `unpin` is not the inverse of `archive`; and a pin on an archived row, or on a row inside an archived workspace, is stored while the section keeps it out of sight — the note names whichever restore command applies, read from the row and its workspace. Both are easy to get wrong: the first draft printed that note on a successful *unpin* of a live row, and inferred the cause instead of reading it, which only showed up against the real store. Reads never create the app database (`open_existing` first), so a machine that never ran the app gets `count: 0` and an empty-state line, or `[]` under `--json` — not an error, and not a new file. A store `workspace add` created without a `threads` table lists nothing rather than failing on the missing table. The archive module's shared helpers (`parse_target`, `desktop_store`, `resolve_workspace`, `with_flag`, `pretty`) are now `pub(super)` and its test harness moved to `test_store`, rather than duplicating either in the new module. * test(host): name the packet a catalogue-lane wait is waiting for `catalogue_window_lane_sends_the_newest_rows_and_names_the_rest` failed on Windows (run 43502377622) at assertion `left == right` failed: a deleted conversation is named, not left to be inferred left: Array [] right: Array [String("sesswindowborn-7856-764")] The wait had been satisfied — by the wrong packet. It was `await_publish(&mut tap, &subject, ..)`, which answers with *the next packet on the subject*: the lane publishes one packet per change, so a second packet on `p.{pair}.state.sessions` describing the state *before* the deletion (the same change detected twice, a restarted loop's resync, a second publisher generation) is taken as the answer, and `removed` reads `[]`. The tap is also a 256-slot ring over a 100/s heartbeat, so the same wait loses a change-driven packet outright when the reader is descheduled — the reason the bridge test already reads the broker record instead (#1606). Both waits now do that: `FakeNats::await_publish` reads the record (nothing is dropped, and a packet published before the wait began is still found) and is keyed by `accepts` — the packet that *says* what the caller awaits — not by the next arrival. The window and delta lane tests ask for `full: true`, for the packet naming the row that was born, and for the one naming the removal. The window test also publishes the shift packet once more before deleting: that one repeated packet is the flake's timing, made deterministic. With the old wait it is taken and the test fails with the output above, byte for byte; with the condition-keyed wait it is skipped and the test is green. A wait that times out now names the newest packet on the subject instead of only the budget. host: cargo test -p future-host --lib remote → 715 passed, 0 failed (the window test 5x, the delta lane 1x, the four await_publish tests) * chore(skills): bump future-skills to document pinning (#125)
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.
Summary
Parallel-safety hardening for
future loop run+ an agent-registry inspection command.Commit 1 —
agent list(0ff24a8)New
future loop agent list --goal G: lists every registered agent with liveexecution status —
running(holds a live lease on a todo, with lease timeremaining) vs
idle— plus declared capabilities and last activity. Pre-flightcheck before registering/launching so parallel workers reuse existing ids
instead of re-registering the same one. 3 new contract tests.
Commit 2 — enforce
--agent-idon run (8bea289)runnow REQUIRES--agent-idand fails fast (before any gRPC/session work)with a hint pointing at
agent list;--anonymousopts back into the legacyuncoordinated one-shot path with a warning.
ensure_run_identity()auto-registers an unregistered id on first use(check-then-register, replay idempotent → no duplicate events); registered
ids pass through untouched.
runclaims the task lease with--lease-secs(default 4h instead of thehardcoded 1h — long LLM/compute turns >1h could get the todo stolen
mid-turn once the lease expired).
agent onboardaccepts both--capabilityand--capabilities(docs usedthe plural, code only parsed the singular).
run_identity_contracttests (fail-closed hint, anonymous escape,auto-register once, existing-id passthrough, CLI fail-fast before connect).
Also included
agent/src/llm/mod.rs: LLM call timeout 600→1800s +FUTURE_LLM_TIMEOUT_SECSenv override (long-turn support).
agent list, enforced--agent-id, 4h lease /--lease-secsdocs.Validation
--workspace --all-targets -D warningsclean, fmt clean--libtests green (no desktop files changed; TS checks run in CIwith deps installed — worktree has no node_modules)