18 Commits
Author SHA1 Message Date
Emil 933dcdb50f Remove agent-open command
CI / test (22) (push) Waiting to run
CI / test (24) (push) Waiting to run
CodeQL / analyze (push) Waiting to run
2026-08-01 02:47:52 +03:00
Emil ba185d060e feat: pin research subagents to DeepSeek Flash 2026-08-01 02:36:17 +03:00
Emil 029ce743bb feat: /agent opens a subagent's full chat (OpenCode-style), /back returns
- /agent [filter] lists the run's agents (glyphs, elapsed, task) via the
  native selector and switchSession()es to the agent's own session file
- run is restored in the agent session by deriving the run id from the
  session file path (<stateDir>/runs/<runId>/sessions/...)
- main session file recorded in the run manifest so /back works even after
  a reload while viewing an agent chat
- widget re-attach timer guard on session switch
2026-08-01 00:18:47 +03:00
Emil e722900290 chore: untrack generated graphify-out output; add it to .gitignore 2026-08-01 00:05:02 +03:00
Emil 2c2a8f58a2 chore: remove the /agents interactive overlay; keep the live widget 2026-08-01 00:04:19 +03:00
Emil 4f630183fd chore: remove the persistent /agents-panel; keep /agents overlay and live widget 2026-08-01 00:03:11 +03:00
Emil 8f308ecea3 Revert "style: OpenCode Todo-style right agent panel (bg fill, checklist, pinned footer)"
This reverts commit e0f08097ec.
2026-08-01 00:01:09 +03:00
Emil e0f08097ec style: OpenCode Todo-style right agent panel (bg fill, checklist, pinned footer) 2026-07-31 23:58:56 +03:00
Emil 18dc4cbb16 feat: full-height right agent panel with per-agent last activity
The /agents-panel now fills the whole right column (40% width, 100% height,
top-right anchor). Under each running subagent it shows the agent's most
recent activity read from the tail of its session file: the last tool call
with its query (e.g. web_search: "...") or the last assistant text. Reads are
cached by file size so the 1.5s refresh stays cheap.
2026-07-31 23:45:39 +03:00
Emil 7e4146acbc feat: persistent right-side agent panel (OpenCode-style) via /agents-panel
Adds a toggleable non-capturing overlay anchored top-right (36% width,
max 85% height, hidden under 100 columns) that shows the live agent tree:
statuses with icons and colors, elapsed time, auto-refreshed every 1.5s.
Because it is non-capturing, typing in the editor keeps working while the
panel is visible. The panel closes via the toggle or on supervisor shutdown.
The interactive /agents overlay with keyboard navigation and details is
unchanged.
2026-07-31 23:41:55 +03:00
Emil 460cef3d23 fix: anchor the /agents overlay to the top-right corner instead of center 2026-07-31 23:33:33 +03:00
Emil d9bc32d909 feat: interactive agent tree overlay (/agents)
Adds an overlay panel (ctx.ui.custom with overlay options) showing the full
agent tree: tree glyphs, colored statuses and icons, live elapsed time, and
keyboard navigation (up/down, enter toggles a detail pane with the agent's
task and result, esc closes). The panel refreshes itself every 1.5s while
open. Also fixes /research-pause and /research-resume to use the same
loop-state guards as research_control (previously they could desync the tree
from the loop). The live widget header now hints at /agents.
2026-07-31 23:31:18 +03:00
Emil 5ea92990eb feat: keep the main chat responsive while subagents run
The main session and subagents share the same model backend; when that
backend serializes requests (cloud rate limits or a local server), subagent
streams queue the main chat. Adds two config knobs:

- agent_concurrency (default 3): a semaphore in AgentTree.start caps how many
  subagent sessions stream simultaneously (slot is released on completion,
  timeout, or setup error so failures cannot deadlock the queue).
- subagent_model (optional): routes spawned agents to a different model or
  backend, e.g. ollama/gemma4:e4b, so subagents never contend with the main
  session at all. Wired through the spawn tool, the main-session tools, and
  the per-agent runtime tools.

Documents both in .hypothesis-machine.example.yaml and adds a concurrency-cap
test (43 tests passing, tsc clean).
2026-07-31 23:25:52 +03:00
Emil dd8d29bc8a feat: live subagent dashboard widget in the TUI
Adds a widget above the editor (ctx.ui.setWidget) showing the research run
id, loop status, iteration, active agents with elapsed time, and recently
finished agents. Refreshed every 1.5s while work is running, hidden when
idle; timer is cleaned up on shutdown so reloads do not leak intervals.
2026-07-31 23:12:38 +03:00
Emil b53687c2b9 fix: keep pause/resume in sync between loop and tree; close read_artifact symlink escape
- research_control pause/resume now validate the loop state before touching
  the tree, so pausing a stopped loop can no longer leave the tree 'paused'
  while the loop is not (spawn would fail until a restart).
- read_artifact confinement resolves symlinks (realpath) before checking the
  project boundary, preventing symlink-based file leaks.
- Adds confinement tests (42 tests passing, tsc clean).
2026-07-31 23:09:20 +03:00
Emil 4039f7c8f3 fix: pin DNS resolution against SSRF rebinding; enforce reviewer independence; bound caches and logs
- web.ts: outbound downloads resolve DNS once, validate the address, and
  connect to the validated IP directly, closing the DNS-rebinding TOCTOU
  window; malformed SearXNG result URLs are skipped instead of failing the
  whole search; web cache is bounded (evicts oldest past 500 entries).
- experiment.ts: reviewer must not be a descendant of the experiment author
  (tool-level lineage check on top of the author-id check); stdout/stderr
  buffers capped at 512 KB.
- Confirmed Pi's extension tool registry is per-extension-instance, so
  reload re-registration is safe; no change needed there.
- Adds a lineage-independence test (39 tests passing, tsc clean).
2026-07-31 23:03:49 +03:00
Emil 18b8a3247d fix: allow research runs to restart after stop; improve FTS search, agent limits, and timeouts
- AgentTree.restart() revives a stopped run in the same session: resets the
  root, archives old branches, and restores spawnability (stop no longer
  cancels the root).
- ResearchLoop.start() restarts from stopped/completed and resets iteration
  counters; setGoal is allowed in terminal states; supervisor 'start' revives
  the tree when the root is not spawnable.
- Cancelled/failed/archived children no longer count toward the per-agent
  child limit and archived agents are ignored by the duplicate-task guard.
- cancel() no longer overwrites an already recorded agent result.
- Add agent_timeout_seconds (default 1800) so hung agent sessions fail
  instead of blocking wait() forever.
- FTS search now prefix-matches tokens (tolerates inflections) and safely
  handles punctuation/FTS5 metacharacters instead of returning false
  negatives or throwing.
- Add tests for restart semantics, child limits, result preservation,
  agent timeouts, and FTS morphology/special characters (38/38 passing).
2026-07-31 22:57:54 +03:00
Emil 528983ee50 feat: initialize Hypothesis Machine Pi extension 2026-07-31 22:36:16 +03:00