Commit Graph

1645 Commits

Author SHA1 Message Date
Levi Neely a56f9dfe73 chore: update kde submodule (syntax highlighting fix) 2026-08-03 16:07:52 +02:00
Levi Neely 6a32b3afce chore: update kde submodule (agent connection retry fix) 2026-08-03 16:03:07 +02:00
Levi Neely 2dc4098c09 fix(backend): strip tool blocks when no tools defined
Bedrock rejects requests containing toolUse/toolResult content blocks
without a corresponding toolConfig. When agents have zero tools loaded
(e.g., autoload disabled/failed), conversation history containing tool
interactions would cause 'toolConfig field must be defined' errors.

Add kiroStripToolBlocks() to remove tool-related content from messages
when len(tools) == 0, allowing requests to proceed without tool
definitions.
2026-08-03 15:58:29 +02:00
Levi Neely aae307046a fs: ensure tool server on agent creation, retry via keeper
ToolServer is vital infrastructure — it must never be nil. If the
initial dial fails, retry via ProcessKeeper (which respawns
ollie-remote). If still unavailable, fail agent creation with a
clear error asking the user to try again.

Reverted the nil-check band-aid in turn.go — ToolServer is now
guaranteed non-nil for any running agent.
2026-08-03 15:51:23 +02:00
Levi Neely aa84cd1c9f agent: nil-check ToolServer before ListTools in turn
Prevents nil pointer dereference when a newly created agent's
tool server connection failed to establish (keeper.Dial returned
nil, or session was restored with a dead toolsConn).
2026-08-03 15:45:57 +02:00
Levi Neely c9c76d51c0 agent: inject tool documentation + schemas into preamble
Models that ignore native tool schemas (via the API tools parameter)
now see full tool documentation in-context: usage docs, argument
definitions, examples, and the JSON schema.

This is appended as a '# Tool Documentation' section in the system
prompt, below the compact '# Available Tools' listing.
2026-08-03 13:07:26 +02:00
Levi Neely 7189a9fc24 scripts: add 'o write' subcommand 2026-08-03 12:48:08 +02:00
Levi Neely 81e47c8513 fs: add error logging to Kill when session not found in map
Helps trace zombie sessions — if Kill is called with a key that
doesn't match the sessions map, we'll see it in the log.
2026-08-03 12:34:42 +02:00
Levi Neely 5795fe8864 kde: update submodule (fix stale stream spam) 2026-08-03 12:28:46 +02:00
Levi Neely fe2348c0cc toolsrv: add ProcessKeeper for resilient ollie-remote lifecycle
ProcessKeeper maintains a running ollie-remote process and respawns
it on failure. Multiple agents Dial() the same keeper to get
independent connections. If the process dies, the next Dial()
triggers a respawn (up to 3 attempts with backoff).

All session creation and restore paths now use ProcessKeeper.
Kill/Shutdown close the keeper (which closes the current process).
This fixes 'connection closed' errors persisting indefinitely
after ollie-remote crashes — the next tool call respawns it.
2026-08-03 12:21:54 +02:00
Levi Neely c11d513202 kde: update submodule (no-retry agent connections) 2026-08-03 11:33:46 +02:00
Levi Neely ce53f57e4c kde: update submodule (agent disconnect fix) 2026-08-03 11:31:14 +02:00
Levi Neely 256d5177d1 ollie-remote: call env.EnsureDefaults, keep OLLIE_SESSION_ID/OLLIE_UNAME current
- Load ~/.config/ollie/env and set path defaults at startup (same as olliesrv)
- Remove hard exit on missing OLLIE_SESSION_ID; accept it from inherited env
  or via set_env RPC (SSH bootstrap path)
- Wire OnEnvSet to propagate OLLIE_SESSION_ID into tool registry and process
  env when it arrives dynamically; same for OLLIE_UNAME
2026-08-03 11:27:04 +02:00
Levi Neely 8bb4246cde prompts: document tool discovery in session-9p.md
- Global catalog: read /tools
- Loaded tools: read agent/tools
- Load a tool: write tool name to agent/tools
- Added tools to agent directory file table
2026-08-03 11:26:37 +02:00
Levi Neely 8aff88d0a1 ollie-remote: use OLLIE_SESSION_ID for elevate broker identity
ollie-remote was sending 'agent-<pid>' as the session identity to the
elevate broker, which never matches any real session. Now reads
OLLIE_SESSION_ID from inherited environment (set by the parent
olliesrv process) so the broker can validate the session exists.
2026-08-03 11:06:17 +02:00
Levi Neely 45f76c3e01 fs: fix elevate broker session lookup by immutable ID
Lookup() was keyed only by display name, but the elevate broker
passes OLLIE_SESSION_ID (the immutable UUID). Added fallback to
search by sess.id when the name-based lookup misses.

This fixes 'elevate-broker: denied (session not found)' for all
elevated commands.
2026-08-03 11:01:01 +02:00
Levi Neely 40fcae493e kde: update submodule (kate plugin disabled) 2026-08-03 10:59:07 +02:00
Levi Neely d71e3eb8e4 fs: set agent dir UID to agent ID, GID to 'agent'
Agent directories now have proper ownership: UID is the agent's
immutable 12-char hex identity, GID is 'agent'. Consistent with
session directories which use UID(s.Uname()).
2026-08-03 10:56:20 +02:00
Levi Neely 04e1bfa228 agent: persist uname separately, fix OLLIE_UNAME != OLLIE_SESSION_ID
The agent's 12-char hex uname was not persisted. On restore,
fs/persist.go incorrectly used ps.ID (session UUID) as the uname,
making OLLIE_UNAME identical to OLLIE_SESSION_ID.

Fix: add Uname field to PersistedAgent, persist ag.id in SaveFull,
restore from ps.Uname (falls back to nextUname for old files).
2026-08-03 10:55:50 +02:00
Levi Neely 0a24326c7e update kde submodule: remove dead createSession 2026-08-03 10:43:16 +02:00
Levi Neely 9af47864ac update kde submodule: error handling in new agent dialog 2026-08-03 10:41:38 +02:00
Levi Neely 911733bd8a fs: add agent-level kill, remove activeAgentID from session
Add 'kill' command to agent ctl (removes agent from session).
Add Session.RemoveAgent() method.
Remove activeAgentID field, Agent(), SetActiveAgent, and dead
WaitChange — 'active agent' is a GUI concept, not a server one.
All callers updated to iterate Agents() or use FindAgent(id).
2026-08-03 10:37:29 +02:00
Levi Neely 3f1e8bfd8b toolsrv: use ToolsPath() for local ollie-remote bootstrap
Remove hardcoded ~/.config/ollie/tools path and XXX hack.
Local ollie-remote now inherits OLLIE_TOOLS_PATH from the environment
via os.Environ(), same as remote bootstrap sets it explicitly.

ToolsPath() reads OLLIE_TOOLS_PATH with fallback to ~/.config/ollie/tools.
Tools added to the directory are picked up immediately on next
tool_load — no restart needed.

Removed dead appendEnvVar helper.
2026-08-03 10:17:58 +02:00
Levi Neely 8f09aa2060 scripts: enable readline in prompt REPL (read -e)
Supports C-a, C-e, C-u, C-k, M-b, M-f, arrow keys, etc.
Sent prompts and slash commands are added to readline history
so up-arrow recalls previous inputs.
2026-08-03 10:09:32 +02:00
Levi Neely 62cfc06a88 scripts: rename blkread → readloop 2026-08-03 10:07:54 +02:00
Levi Neely e726599f84 scripts: add 'o blkread' — blocking read loop for statewait et al 2026-08-03 10:07:10 +02:00
Levi Neely 9c75c1b9aa scripts: fix tui shell cwd to $HOME (fixes .bashrc not found) 2026-08-03 10:04:56 +02:00
Levi Neely d693bd8071 scripts: add 'o tui exit' to kill tmux session 2026-08-03 10:03:47 +02:00
Levi Neely 89c2c41679 doc: update architecture diagram frontend label to 'o' 2026-08-03 10:00:11 +02:00
Levi Neely d8cca00fd0 doc: add o CLI and o tui documentation to USAGE.md 2026-08-03 09:58:42 +02:00
Levi Neely 30621d2ed9 scripts: add 'o kill', slash commands in prompt REPL
o kill: kills the active session.

Prompt REPL now supports slash commands:
  /stop, /compact, /kill, /clear, /model X, /backend X, /cwd X, /help

Slash commands are handled locally without sending to the agent.
2026-08-03 09:56:34 +02:00
Levi Neely ae556a2a3a scripts: add 'o tui' tmux layout and 'o stop' shorthand
o tui: launches a 4-pane tmux layout with:
  - chat stream (left, large)
  - statewait monitor (top-right, reactive)
  - spare shell with session/agent exported (bottom-right)
  - prompt REPL (bottom, full width)

o stop: shorthand for 'o ctl stop' to interrupt a running agent.
2026-08-03 09:55:06 +02:00
Levi Neely 338358fbf3 scripts: replace individual scripts with unified 'o' dispatcher
Single multi-call script with subcommands: read, ls, ctl, prompt,
tail, env. Replaces prompt, ollieread, sendctl, ollie-ls.

Features:
- Env var fallback chain: OLLIE_SESSION_ID → session → positional arg
- Auto-selects first session/agent when none specified
- Multi-line prompt mode (blank line sends)
- Uses immutable IDs in 9P paths (works with alias resolution)
- eval-able 'o env' for shell integration
2026-08-03 09:49:45 +02:00
Levi Neely 44f173214d fs: add Aliases to FsNodeDecl for immutable ID path resolution
Nodes in the 9P namespace can now declare alternate names (Aliases)
that resolve during Twalk but are invisible in directory listings.
Session dirs alias their immutable RunnableID(), agent dirs alias
their ID(). Clients can use session/{uuid}/agent/{uuid}/... paths
that remain valid across renames.

Changes:
- fs/fsnode.go: Add Aliases []string field, Alias() NodeOption
- fs/builder.go: findChild checks aliases via matchAlias helper
- fs/sessionfiles.go: Session dirs get Alias(s.RunnableID())
- fs/agentfiles.go: Agent dirs get Alias(a.ID())
- fs/spec.go: Add /aliases file (read-only alias→path table)
- fs/rootfiles.go: readAliases handler
- fs/lifecycle.go: buildIndex includes immutable ID in session/idx
- doc/edsl.md: Document Aliases field and behavior
- prompts: Update session/idx format documentation

The KDE GUI submodule now uses immutable IDs in all 9P paths,
fixing disconnected indicators after session rename.
2026-08-03 09:41:26 +02:00
Levi Neely f83b1f0f89 olliesrv: fix double-fire on Request files opened ORDWR
For Request-mode files (session/new, complete, generate, route), the
write handler fires immediately during Twrite. On clunk, the server
was also flushing the (empty) writeBuf to Write(), causing the handler
to fire a second time. This created duplicate sessions.

Skip the clunk-time writeBuf flush for Request-mode files since they
already handle writes inline during Twrite.
2026-08-03 09:20:49 +02:00
Levi Neely 5f1a9a6eab update kde submodule: separate session/agent creation, agent context menu 2026-08-03 09:16:11 +02:00
Levi Neely c17d1d4f7b update kde submodule: fix session kill + path resolution 2026-08-03 09:09:57 +02:00
Levi Neely a3f44bb565 AGENTS.md: add prominent warning to work in source dir, not install targets 2026-08-03 09:05:21 +02:00
Levi Neely 8e2c0a3929 update kde submodule (KF5 GUI parity) 2026-08-03 09:03:19 +02:00
Levi Neely 4094c95587 more qol utils 2026-08-03 08:57:52 +02:00
Ollie Agent 56527598d6 utils for terminal interface 2026-08-03 07:43:50 +02:00
Ollie Agent 261f987c5e move current SLOC table to end of EVOLUTION.md 2026-08-03 01:46:13 +02:00
Ollie Agent fce1e4b4fc restore old SLOC table, add current SLOC table alongside 2026-08-03 01:44:06 +02:00
Ollie Agent 5060ce7d6e update SLOC table in EVOLUTION.md 2026-08-03 01:42:05 +02:00
Ollie Agent d0a3ea2948 ellie README: update for ollie-9p CLI, remove FUSE references 2026-08-03 01:31:41 +02:00
Ollie Agent aeb97621d5 ellie: switch from FUSE file I/O to ollie-9p CLI
ellie.el previously accessed ollie through a FUSE-mounted 9P
filesystem (plain file I/O via insert-file-contents/write-region).
This had several failure modes: stale mounts after suspend/resume,
no error propagation from 9P Rerror, no streaming support.

Now uses the ollie-9p CLI tool which speaks the 9P protocol
directly over the Unix socket. Also removed ellie-dired binding
(C-c C-d) and the ellie-mount-directory customization since
there is no mount point.

The completion subsystem was updated to use ollie-9p rdwr complete
instead of a shell pipeline to a 9P mount path.
2026-08-03 01:30:39 +02:00
Ollie Agent 172b093893 replace $OLLIE/help with ollie-9p read help
ollie-watchdog doesn't need a FUSE mount to probe the server.
ollie-9p speaks the 9P protocol over the Unix socket directly.
2026-08-03 01:22:31 +02:00
Ollie Agent ffccfc57f2 fix plan path: use OLLIE_UNAME via ollie-9p write
session/{id}/agent/{aid}/plan → ollie-9p write
session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/plan

UNAME is the agent's immutable ID, matching the agent directory
name. Using ollie-9p write instead of a mounted filesystem path.
2026-08-03 01:20:50 +02:00
Ollie Agent 0cfb99a747 fix plan path: OLLIE_UNAME is the agent ID
OLLIE_AGENT_NAME doesn't exist. OLLIE_UNAME is the env
var that carries the agent's immutable ID.
2026-08-03 01:19:48 +02:00
Ollie Agent bc4c27b602 demote plan from session level to agent level
plan now lives at session/{id}/agent/{aid}/plan instead of
session/{id}/plan. Moved the Leaf declaration from fs/sessionfiles.go
to fs/agentfiles.go. Updated both prompt docs to match.
2026-08-03 01:06:16 +02:00