Commit Graph

127 Commits

Author SHA1 Message Date
Ollie Agent 058d7aed0d elevate-adapter: direct CreateSession for token refresh
Replace subprocess-based token refresh (superpowers run-session --child-session)
with direct SEQPACKET CreateSession RPC to superpowerd. This fixes:

1. Session PID mismatch: old approach registered session to short-lived sh
   subprocess PID, causing immediate pidAlive() failure on next use
2. Child session failure: --child-session fails when superpowerd restarts
   (parent session gone)
3. Gentoo python-exec2c exec chain: replace os.execvp startup with direct
   CreateSession call

The adapter now owns its session directly (peerPID = adapter PID), so the
session stays valid for the adapters entire lifetime.
2026-07-21 07:42:54 +02:00
Levi Neely a65178f936 elevate-adapter: retry on exit 255 with no output, add diagnostic logging
When superpowerd returns exit 255 with no output streamed, treat it as a
suspicious session failure (same as auth error) and retry with a refreshed
token. This addresses intermittent elevated command failures where the
session silently expires mid-conversation.

Also adds stderr logging at key decision points: token refresh attempts,
retry signals, RPC errors, and non-JSON responses from superpowerd.
2026-07-20 15:49:58 +02:00
Levi Neely cf6fe52fc4 update core, 9p submodules; agent configs and prime script 2026-07-20 13:37:22 +02:00
Ollie Agent b7623db619 prompt: unified PRIME_* env, prime is pure renderer
prime script no longer detects platform/git locally. All PRIME_*
variables are set by BuildRuntime callers and stored in the agent
for /agent reloads. Templates use PRIME_CWD instead of PWD.
2026-07-19 20:37:37 +02:00
Ollie Agent 2e55e30795 elevate: move adapter auto-start from sandboxed client to Go server
Remove _start_adapter() from x/elevate (ran inside sandbox, could not
function). The Go executeElevated() now calls ensureElevateAdapter()
which runs outside the sandbox and can properly start the adapter.

core: update submodule.
2026-07-19 11:34:05 +02:00
Ollie Agent e47bb9e2ff elevate-adapter: catch-all exception handler in handle()
Wrap _handle_inner() in try/except so unhandled exceptions always
produce an error frame instead of silently closing the connection
(which caused exit 255 with no output on the client).
2026-07-19 10:28:38 +02:00
Ollie Agent 6bc4ab6745 elevate: auto-start adapter + refresh stale session token
elevate-adapter-superpowerd: detect auth errors from superpowerd and
automatically refresh the session token via "superpowers run-session
--child-session", retrying the request once.

x/elevate: auto-start the adapter if the socket is not available,
removing the dependency on the agentSpawn hook for adapter lifecycle.

core: update submodule (hook run/fail summary).
2026-07-19 10:25:34 +02:00
Ollie Agent cbc4eb4f48 u/complete: use /complete endpoint instead of copilot session 2026-07-18 23:24:23 +02:00
Ollie Agent 8fe10813ee b: use /generate endpoint for foreground mode, sessions only for -bg 2026-07-18 23:20:15 +02:00
Ollie Agent 83ca936c8c elevate: streaming protocol for real-time output
Replace the batch JSON request/response protocol with a streaming
frame protocol. The adapter now uses superpowerd ExecuteCommandStreaming
with SCM_RIGHTS fd-passing to stream stdout/stderr in real-time.

Protocol: client sends {cmd,cwd}+newline, server streams frames
(type byte + 4-byte length + payload). This enables elevated+detach
to capture live output in the ring buffer.

Also updates core submodule with elevated+detach support.
2026-07-18 00:16:32 +02:00
Levi Neely ab3c32be92 update core (kiro backend fixes), fix prime path resolution
- core: port kiro backend fixes from goq (endpoint, content encoding,
  retry logic, auth robustness, reasoning support)
- scripts/x/prime: handle colon-separated OLLIE_PROMPTS_PATH
2026-07-10 11:43:29 +02:00
Ollie Agent f11031221e remove $OLLIE mount dependency from agent startup path
- agent JSONs: $OLLIE/x/ -> $OLLIE_CFG_PATH/scripts/x/
- x/prime: use $OLLIE_PROMPTS_PATH instead of $OLLIE/p/
- x/elevate-adapter-start: use $OLLIE_CFG_PATH/scripts/x/
- Update core and 9p submodules

olliesrv and agent sessions now work without FUSE. Mount remains
available as an enhancement when present.
2026-06-16 12:30:48 +02:00
Levi Neely e3dd73ca21 ollie-watchdog: simplify, use ollie-remount 2026-06-15 13:33:09 +02:00
Levi Neely 0c95854c73 move mount ownership to ollie-watchdog 2026-06-15 13:31:12 +02:00
Ollie Agent 68082ad2a6 front-ends: transparent FUSE remount on I/O errors
All front-ends (sh, b, ls, kill, cleanup, ellie.el, ollie-acme, Kmpl)
now retry file operations after running ollie-remount on failure.
contrib target added to 'all' so ollie-remount is always installed.
2026-05-21 09:00:13 +02:00
Ollie Agent 7418114e44 add escalate tools 2026-05-19 15:27:22 +02:00
Levi Neely 2b30e3cc3e add orchestrator/worker agents; update cascade defaults to deepseek v4 2026-05-17 15:04:06 +02:00
Levi Neely e31d1abd1e u/cascade: add session name to results; sync schema with actual fields 2026-05-17 13:36:59 +02:00
Levi Neely 204e0e7a9d u/cascade: validate -retries; add attempts field to results
- Reject non-positive-integer -retries early
- Each worker records attempt count; results JSON includes
  'attempts' field for retry observability
2026-05-17 13:35:39 +02:00
Levi Neely 8895150f94 u/cascade: add -retries N for transient worker failure recovery
Workers retry with linear backoff (attempt*2s). Each retry uses a
unique session name suffix (-r2, -r3, ...) to avoid collisions.
Default: 1 (no retry).
2026-05-17 13:34:37 +02:00
Levi Neely 7f8421691f u/cascade: validate -max-workers; truncate large worker outputs
- Reject non-positive-integer -max-workers early
- Per-worker output capped at OLLIE_CASCADE_MAX_OUTPUT (default 8000 chars)
  to prevent synthesis prompt blowup
2026-05-17 13:33:25 +02:00
Levi Neely 42929b4c57 u/cascade: pass JSON results directly to planner synthesis prompt 2026-05-17 13:32:43 +02:00
Levi Neely 04bed6189f u/cascade: structured JSON results, worker throttling via -max-workers
- Results gathered as JSON array [{id, status, output}]
- Default output is pretty-printed JSON (no synthesis)
- -max-workers N (default 8) throttles concurrent workers
- Synthesis renders JSON to text for planner prompt
2026-05-17 13:31:23 +02:00
Levi Neely 9ca6b9de8a u/cascade: strict plan schema validation; clarify exit code contract
- Validate all entries have non-empty string id and instruction
- No synthesis: exit 1 on worker failures (partial results)
- Synthesis: exit 0 — planner accounts for failures in its answer
2026-05-17 13:27:56 +02:00
Levi Neely 664b9e7f93 u/cascade: invert synthesis default — off unless -synthesize is passed 2026-05-17 13:25:17 +02:00
Levi Neely 77efded76d u/cascade: add -json-output flag for structured synthesis output
Schema: {summary, answer, worker_results[], errors[]}
2026-05-17 13:24:28 +02:00
Levi Neely 8d78c6a7bc u/cascade: validate plan schema (require .id and .instruction per entry) 2026-05-17 13:22:14 +02:00
Levi Neely c29cf7dcdc u/cascade: track per-worker failures, annotate status, exit non-zero 2026-05-17 13:22:00 +02:00
Levi Neely 87fb50f207 u/cascade: use private tmpdir for worker output isolation 2026-05-17 13:21:34 +02:00
Levi Neely 3d513790f9 u/cascade: add -no-synthesize flag to skip expensive synthesis step 2026-05-17 13:21:10 +02:00
Levi Neely b4be3a01d9 add cascade tool and script-driven orchestrator
tools/cascade: fire-and-forget delegation to cheap model; worker
reports back to parent prompt when done. Parallelizable.

scripts/u/cascade: script-driven hub-and-spoke orchestrator for
terminal use — planner decomposes, workers execute in parallel,
planner synthesizes.
2026-05-17 13:16:18 +02:00
Levi Neely 4888db8e12 u/complete: add -cwd flag; acme submodule update (type resolution) 2026-05-11 16:50:43 +02:00
Levi Neely 6ae476355a u/complete: stronger prompt (no reasoning output); drop :: echo to stderr 2026-05-11 16:15:27 +02:00
Levi Neely bb13c24ef2 u/complete: prompt says implement, not complete; reject stub echoing 2026-05-11 15:48:52 +02:00
Levi Neely 51fc98ccdf u/complete: add -context flag, increase prefix to 12K chars 2026-05-11 14:07:58 +02:00
Levi Neely 1c26a19c0a update acme, scripts 2026-05-08 17:41:55 +02:00
Levi Neely 767a6ab64f sh: simplify sigint handler - just send stop, let rc resume 2026-05-08 14:59:21 +02:00
Levi Neely 2a98363b99 sh: fix signal handler name: sigint not sigintr 2026-05-08 14:58:20 +02:00
Levi Neely 2c4d8a0782 sh: remove statewait read before poll loop 2026-05-08 14:56:45 +02:00
Levi Neely b07fcec765 sh: read state file directly instead of parsing cfg 2026-05-08 14:55:35 +02:00
Levi Neely 284f1969d8 sh: on Ctrl-C during turn, send stop and re-exec to resume 2026-05-08 14:53:27 +02:00
Levi Neely 7265c8202d sh: redefine sigintr during agent turn to interrupt without exiting 2026-05-08 14:46:41 +02:00
Levi Neely dd4e5a677a sh: Ctrl-C interrupts running turn instead of exiting 2026-05-08 14:45:02 +02:00
Levi Neely fb29487a1f revert chatwait changes in sh and acme frontends 2026-05-08 12:45:05 +02:00
Levi Neely ecbb9e240c use chatwait for responsive streaming in sh and acme frontends 2026-05-08 12:08:54 +02:00
Levi Neely ba8f7948bb s/sh: fix case patterns for argument-taking commands
Quoted '*' in rc switch cases is a literal character, not a wildcard.
Replace '/cmd *' patterns with /cmd?* so rc treats them as globs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 08:18:15 +02:00
Levi Neely 3186bb12f2 s/sh: replace readmulti with inline bash readline; fix /model feedback
Replace the Python raw-mode multiline hack (readmulti) with an inline
bash read -e loop using backslash continuation. Add show_new to display
the server response after /model, /agent, /backend cfg writes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 22:47:20 +02:00
Levi Neely 45d1b6b77e readme: add "What you get" section; update submodules
- README.md: add feature summary with bulleted list
- acme: add README documenting ollie-acme and Kmpl
- el: refactor completion to shell out to u/complete
- u/complete: improve prompt and strip leaked tags
2026-05-03 22:03:01 +02:00
Levi Neely ed178dfad0 u/complete: prompt to complete logical unit, not just minimal insertion 2026-05-03 21:32:40 +02:00
Levi Neely 410335cb51 u/complete: split into completion engine + acme glue (Kmpl)
u/complete is now acme-free: reads prefix from stdin, takes -suffix,
-file, -model, -backend flags. Prints completion to stdout.

acme/scripts/Kmpl is the thin acme wrapper that extracts prefix/suffix
from the window and pipes to u/complete.

Also fixes prefix truncation bug (bash substring returning empty when
string is shorter than offset) and updates core submodule with
interrupt handling improvements.
2026-05-03 21:10:57 +02:00