29 Commits

Author SHA1 Message Date
kumarabhirup
11478c752e
refactor(workspace): remove chat-slot agent pool to prevent workspace pollution
Chat-slot agents were being persisted as durable entries in openclaw.json,
causing spurious workspace directories (e.g. chat-slot-main-1) to appear.
Only explicit workspace creation via init now creates durable agent entries.
Workspace discovery and session routing ignore chat-slot internals.
2026-03-17 12:35:18 -07:00
kumarabhirup
2c2164ed2c
feat(chat): add stream status labels and partial tool output
Keep a visible streaming status indicator throughout the assistant turn and forward partial tool output to the UI so users see real-time progress.
2026-03-15 00:31:19 -07:00
kumarabhirup
8838cc4e16
feat(chat): add runs API, subagent registry, and cascade stop
Backend support for multi-session chat: /api/chat/runs endpoint for parent/subagent run status, subagent registry for reading run state, and cascade stop to abort child sessions when stopping a parent.
2026-03-15 00:30:43 -07:00
kumarabhirup
2c52012d1e
feat(chat): fix infinite loading and enable concurrent sessions
Chat panel froze because `thinking: "xhigh"` silently killed gateway runs, sessions used mutable global agent state, and OpenClaw's one-run-per-agent limit blocked concurrent chats.
2026-03-09 08:58:50 -07:00
kumarabhirup
039cbe6a43
feat: async I/O, tags field type, rich chat messages, deploy verification
- Convert sync filesystem and DuckDB operations to async across API routes,
  workspace lib, and active-runs to prevent event loop blocking during tree
  discovery, object lookups, and database queries
- Add "tags" field type for free-form string arrays with parse-tags utility,
  TagsBadges/TagsInput UI components, filter operators, and CRM skill docs
- Preserve rich text formatting (bold, italic, code, @mentions) in user chat
  messages by sending HTML alongside plain text through the transport layer
- Detect empty-stream errors, improve agent error emission, and add file
  mutation queues for concurrent write safety in active-runs
- Add pre-publish standalone node_modules verification in deploy script
  checking serverExternalPackages are present
- Extract syncManagedSkills and discoverWorkspaceDirs for multi-workspace
  skill syncing, add ensureSeedAssets for runtime app dir
- Bump version 2.1.1 → 2.1.4
2026-03-08 19:53:18 -07:00
kumarabhirup
36e9cf9517
fix(agent-runner): ensure tool events stream on first chat message
sessions.patch for verboseLevel=full was called before the agent RPC
created the session, so it silently failed on new chats. Tool events
were never emitted and the frontend only showed brief text responses.

Now patches both before (for existing sessions) and after the agent RPC
(for newly created sessions). Also adds SSE keepalive to the POST /api/chat
stream to prevent connection drops during long tool executions, and removes
the unused legacy CLI spawn codepath.
2026-03-06 23:30:31 -08:00
kumarabhirup
f9d454f5c7
feat(web): forward client identity to server and improve feedback traces
Bootstrap posthog-js with the persisted install ID from the server, forward distinctId to API routes, and restructure feedback traces to use chronological conversation order.
2026-03-05 19:09:19 -08:00
kumarabhirup
912e7711bb
fix tests, add telemetry, deploy v2.0.4
- Fix bootstrap-command test: mock ensureManagedWebRuntime to probe
  directly instead of requiring standalone build on disk
- Add PostHog telemetry to CLI and web app with opt-out support
- Add dench alias package (npm rejects name; kept for future use)
- Bump version to 2.0.4 and publish to npm
2026-03-04 17:33:27 -08:00
kumarabhirup
045b73f42e
fix(web): subagent tool events — live streaming + persisted enrichment
Subagent sessions were missing tool call displays because the gateway's
passive subscribe mode (agent.subscribe unsupported) only broadcasts
assistant + lifecycle events, not tool events.

Three fixes:
- Use start-mode GatewayProcessHandle for subagent follow-up messages
  so the agent RPC streams all events (including tools) on the same
  WebSocket connection
- Enrich persisted subagent JSONL at load time from the gateway's
  on-disk session transcript when tool-invocation parts are missing
- Best-effort enrichment at finalization time from gateway transcript
  for subscribe-only runs that didn't receive tool events
2026-03-03 16:26:34 -08:00
kumarabhirup
38f3cb6efe
feat(web): use workspace-aware agent IDs for gateway sessions
Replace hardcoded agent:main: session keys with resolveActiveAgentId() so each workspace routes to its own gateway agent.
2026-03-03 15:38:00 -08:00
kumarabhirup
f6eee0b398
refactor(cli): update workspace-seed with dynamic identity and dench skill
Build identity template with workspace path; add seedDenchSkill for skills/dench.
2026-03-03 13:47:38 -08:00
kumarabhirup
f3fffec97f
fix(web): guard system files in file write route and allow aborting waiting-for-subagents runs 2026-03-02 18:34:27 -08:00
kumarabhirup
52707f471d
refactor!: IronClaw v2.0 - external OpenClaw runtime
BREAKING CHANGE: Convert repository to IronClaw-only package with strict
external dependency on globally installed `openclaw` runtime.

### Changes

- Remove entire OpenClaw core source from repository (src/agents/*, src/acp/*,
  src/commands/*, and related modules)
- Implement CLI delegation: non-bootstrap commands now delegate to global
  `openclaw` binary via external contract
- Remove local OpenClaw path resolution from web app; always spawn global
  `openclaw` binary instead of local scripts
- Rename package.json scripts: `pnpm openclaw` → `pnpm ironclaw`,
  `openclaw:rpc` → `ironclaw:rpc`
- Update bootstrap flow to verify and install global OpenClaw when missing
- Migrate web workspace/profile logic to align with OpenClaw state paths
- Add migration contract tests for stream-json, session subscribe, and profile
  resolution behaviors
- Update build/release pipeline for IronClaw-only artifacts
- Update documentation for new peer + global installation model

### Architecture

IronClaw is now strictly a frontend/UI/bootstrap layer:
- `npx ironclaw` bootstraps OpenClaw (if missing), runs guided onboarding
- IronClaw UI serves on localhost:3100
- OpenClaw Gateway runs on standard port 18789
- Communication via stable CLI contracts and Gateway WebSocket protocol only

### Migration

Users must have `openclaw` installed globally:
  npm install -g openclaw

Existing IronClaw profiles and sessions remain compatible through gateway
protocol stability.

Refs: bootstrap_dev_testing, ironclaw_frontend_split, strict-external-openclaw
2026-03-01 16:11:40 -08:00
kumarabhirup
9ca4263147
👌 IMPROVE: discord fix 2026-02-24 17:20:34 -05:00
kumarabhirup
a046cf2349
refactor(web): unify subagent tracking with parent session system
Subagents now use the same ActiveRun infrastructure as parent sessions:
- startSubscribeRun() creates a subscribe-only ActiveRun when sessions_spawn
  tool results are detected, using the same event buffering, persistence,
  and SSE reconnection as parent runs
- Stream/stop/chat routes no longer branch on subagent vs parent; both
  use getActiveRun/subscribeToRun with the session key as map key
- hasRunningSubagentsForParent moved into active-runs.ts to check the
  unified activeRuns map (+ disk registry fallback)
- Deferred finalization on lifecycle/end with 5s safety timeout
- ev.data.text fallback for assistant events without delta field
- 24h cleanup grace for subscribe-only runs (vs 30s for parent)

Reverts the broken childSessionKey registration from 32cfcf14f.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-22 00:35:07 -08:00
kumarabhirup
7cdcf61639
web: support subagent sessions in chat and stop API routes 2026-02-21 12:32:37 -08:00
kumarabhirup
54d048bfb9
web: merge subagent-stream into unified stream route 2026-02-21 12:32:32 -08:00
kumarabhirup
a2845a321e
fix: type JSON.parse results to avoid Object.values unknown entries 2026-02-21 11:11:47 -08:00
kumarabhirup
149dfb7d50
web: add SSE keepalive and waiting-for-subagents header in stream route 2026-02-21 11:04:32 -08:00
kumarabhirup
ec561894cb
web: activate gateway subscription for rehydrated subagent streams 2026-02-19 21:52:15 -08:00
kumarabhirup
21f60da24d
🚀 RELEASE: Workspaces 2026-02-19 14:59:34 -08:00
kumarabhirup
4965e3ca67
TEST: full frontend web nextjs test suite 2026-02-16 01:01:12 -08:00
kumarabhirup
4d2fb1e2a0
🚀 RELEASE: chat start stop 2026-02-15 23:42:13 -08:00
kumarabhirup
c2a302b582
👌 IMPROVE: chain of thought and live stream 2026-02-12 13:37:40 -08:00
kumarabhirup
8341c6048c
feat(web): full UI redesign with light/dark theme, TanStack data tables, media rendering, and gateway-routed agent execution
Overhaul the Dench web app with a comprehensive visual redesign and several
major feature additions across the chat interface, workspace, and agent
runtime layer.

Theme & Design System
- Replace the dark-only palette with a full light/dark theme system that
  respects system preference via localStorage + inline script (no FOUC).
- Introduce new design tokens: glassmorphism surfaces, semantic colors
  (success/warning/error/info), object-type chip palettes, and a tiered
  shadow scale (sm/md/lg/xl).
- Add Instrument Serif + Inter via Google Fonts for a refined typographic
  hierarchy; headings use the serif face, body uses Inter.
- Rebrand UI from "Ironclaw" to "Dench" across the landing page and
  metadata.

Chat & Chain-of-Thought
- Rewrite the chain-of-thought component with inline media detection and
  rendering — images, video, audio, and PDFs referenced in agent output
  are now displayed directly in the conversation thread.
- Add status indicator parts (e.g. "Preparing response...",
  "Optimizing session context...") that render as subtle activity badges
  instead of verbose reasoning blocks.
- Integrate react-markdown with remark-gfm for proper markdown rendering
  in assistant messages (tables, strikethrough, autolinks, etc.).
- Improve report-block splitting and lazy-loaded ReportCard rendering.

Workspace
- Introduce @tanstack/react-table for the object table, replacing the
  hand-rolled table with full column sorting, fuzzy filtering via
  match-sorter-utils, row selection, and bulk actions.
- Add a new media viewer component for in-workspace image/video/PDF
  preview.
- New API routes: bulk-delete entries, field management (CRUD + reorder),
  raw-file serving endpoint for media assets.
- Redesign workspace sidebar, empty state, and entry detail modal with
  the new theme tokens and improved layout.

Agent Runtime
- Switch web agent execution from --local to gateway-routed mode so
  concurrent chat threads share the gateway's lane-based concurrency
  system, eliminating cross-process file-lock contention.
- Advertise "tool-events" capability during WebSocket handshake so the
  gateway streams tool start/update/result events to the UI.
- Add new agent callback hooks: onLifecycleStart, onCompactionStart/End,
  and onToolUpdate for richer real-time feedback.
- Forward media URLs emitted by agent events into the chat stream.

Dependencies
- Add @tanstack/match-sorter-utils and @tanstack/react-table to the web
  app.

Published as ironclaw@2026.2.10-1.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 11:17:23 -08:00
kumarabhirup
624dc6b91e
Dench workspace: Tiptap markdown editor, subagent sessions, and error surfacing
── Tiptap Markdown Editor ──

- Add full Tiptap-based WYSIWYG markdown editor (markdown-editor.tsx, 709 LOC)
  with bubble menu, auto-save (debounced), image drag-and-drop/paste upload,
  table editing, task list checkboxes, and frontmatter preservation on save.
- Add slash command system (slash-command.tsx, 607 LOC) with "/" trigger for
  block insertion (headings, lists, tables, code blocks, images, reports) and
  "@" trigger for file/document mention with fuzzy search across the workspace
  tree.
- Add ReportBlockNode (report-block-node.tsx) — custom Tiptap node that renders
  embedded report-json blocks as interactive ReportCard widgets inline in the
  editor, with expand/collapse and edit-JSON support.
- Add workspace asset serving API (api/workspace/assets/[...path]/route.ts) to
  serve images from the workspace with proper MIME types.
- Add workspace file upload orkspace/upload/route.ts) for multipart
  image uploads (10 MB limit, image types only), saving to assets/ directory.
- Add ~500 lines of Tiptap editor CSS to globals.css (editor layout, task lists,
  images, tables, slash command dropdown, bubble menu toolbar, code blocks, etc.).
- Add 14 @tiptap/* dependencies to apps/web/package.json (react, starter-kit,
  markdown, image, link, table, task-list, suggestion, placeholder, etc.).

── Document View: Edit/Read Mode Toggle ──

- document-view.tsx: Add edit/read mode toggle; defaults to edit mode when a
  filePath is available. Lazy-loads MarkdownEditor to keep initial bundle light.
- workspace/page.tsx: Pass activePath, tree, onSave, onNavigate, and
  onRefreshTree through to DocumentView for full editor integration with
  workspace navigation and tree refresh after saves.

── Subagent Session Isolation ──

- agent-runner.ts: Add RunAgentOptions with optional sessionId; when set, spawns
  the agent with --session-key agent:main:subagent:<id> ant so
  file-scoped sidebar chats run in isolated sessions independent of the main
  agent.
- route.ts (chat API): Accept sessionId from request body and forward it to
  runAgent. Resolve workspace file path prefixes (resolveAgentWorkspacePrefix)
  so tree-relative paths become agent-cwd-relative.
- chat-panel.tsx: Create per-instance DefaultChatTransport that injects sessionId
  via body function and a ref (avoids stale closures). On file change, auto-load
  the most recent session and its messages. Refresh session tab list after
  streaming ends. Stop ongoing stream when switching sessions.
- register.agent.ts: Add --session-key <key> and --lane <lane> CLI flags.
- agent-via-gateway.ts: Wire sessionKey into session resolution and validation
  for both interactive and --stream-json code paths.
- workspace.ts: Add resolveAgentWorkspacePrefix() to map workspace-root-relative
  paths to repo-root-relative paths for the agent process.

── Error Surfacing ──

- agent-runner.ts: Add onAgentError callback extraction helpers
  (parseAgentErrorMessage, parseErrorBody, parseErrorFromStderr) to surface
  API-level errors (402 payment, rate limits, etc.) to the UI. Captures stderr
  for fallback error detection on non-zero exit.
- route.ts: Wire onAgentError into the SSE stream as [error]-prefixed text
  parts. Improve onError and onClose handlers with clearer error messages and
  exit code reporting.
- chat-message.tsx: Detect [error]-prefixed text segments and render them as
  styled error banners with alert icon instead of plain text.
- chat-panel.tsx: Restyle the transport-level error bar with themed colors and
  an alert icon consistent with in-message error styling.
2026-02-11 20:54:30 -08:00
kumarabhirup
22345bdd71
👌 IMPROVE: stream json shows tools and thinking now and so does nextjs web app 2026-02-08 21:59:08 -08:00
kumarabhirup
5da09483f8
👌 IMPROVE: working nextjs using stream-json 2026-02-08 18:02:25 -08:00
kumarabhirup
3568fa09ff
📦 NEW: nextjs chat
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 15:28:35 -08:00