Commit Graph

7 Commits

Author SHA1 Message Date
Levi Neely b9509a0961 batch: rename status→state, add statewait blocking read
- Rename batchJob.status → .state; update all references
- Add done chan struct{} to batchJob, closed on terminal state
- Add statewait file to b/<id>/: blocks until state leaves "running"
- Add CurrentWaitValue/Wait methods to BatchJobStore
- Extend Topen handler to snapshot waitBase for b/ wait files
- Extend Tread handler for b/ to serve statewait with 5s timeout/retry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 20:45:01 +02:00
Levi Neely 680e2a49bd p9: add x/ plugin namespace; wire elevation via x/elevate
Add PluginStore backed by scripts/x/, exposed read-only at x/ in the
9P filesystem. Remove elevator field and elevation.Detect(); update
execute.Decl() call sites to drop the now-removed elevator parameter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:50:27 +02:00
Levi Neely 8b233c295e p9: wire elevation.Detect() into execute server; remove session env injection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:06:48 +02:00
Levi Neely 0c585b4346 env: session-scoped injection via s/new spec; remove global env file
- createSession parses env.NAME=VALUE from spec, passes sessionEnv to
  BuildAgentEnv for MCP expansion and core.SetEnv for execute subprocesses
- Remove /env root file (was daemon-global and readable)
- No writable s/{sid}/env file needed; spec is the injection point

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:02:27 +02:00
Levi Neely e277937619 batchstore: set result to status message on failure
On failure, result is empty and only status carries the error.
Callers (subagent_spawn, oq) now always have a useful value in
result regardless of success or failure.
2026-04-16 20:54:27 +02:00
Levi Neely 181e629009 batchstore: surface backend errors from Submit as failed job status
executeJob was only capturing 'assistant' events from core.Submit.
Backend errors emit an 'error' event that was silently dropped,
causing jobs with nonexistent models to show status=done with empty
result instead of status=failed.
2026-04-16 20:46:45 +02:00
Levi Neely 793cf6b4fa 9p: add b/ batch namespace for ephemeral one-shot jobs
Introduces b/ as a first-class 9P namespace alongside s/. Writing to
b/new creates one or more ephemeral agent jobs (parallel=N suffix -0..-N)
each running the same prompt in an independent agentCore with no
persistent session state.

Per-job files: spec, status, result, usage, ctxsz.
BatchStore/BatchJobStore mirror SessionStore/SessionFileStore.
rm -r b/{id} cancels and removes the job.

Also removes s/{id}/reply: b/{id}/result is the purpose-built
replacement for one-shot prompt->reply use cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 19:22:39 +02:00