110 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
3fe5a91033
refactor(api): migrate workspace routes to resolveFilesystemPath
All workspace API routes use resolveFilesystemPath and isProtectedSystemPath, enabling browse-mode writes to external paths.
2026-03-15 04:17:11 -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
46fe15df81
fix(workspace): repair managed workspace routing and block reserved names
Prevent workspace-main / agent-main collision by adding ensureManagedWorkspaceRouting() repair on chat create/send/switch, and reject reserved workspace names (main, default, chat-slot-*).
2026-03-15 00:29:57 -07:00
kumarabhirup
c084caf78c
feat(terminal): enhance WebSocket connection handling and port management
- Refactor WebSocket connection logic to dynamically fetch the port from the server, improving flexibility.
- Introduce global variables to manage WebSocket server state and port, allowing for better control and error handling.
- Update terminal drawer component to use the new port fetching mechanism, ensuring consistent connection behavior.
2026-03-09 10:54:40 -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
8deeccf646
feat(web): add workspace app tabs and embedded runtime
This makes Dench apps behave like first-class workspace views with persistent tabs and embedded app loading instead of exposing raw folders.
2026-03-08 21:47:41 -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
ec73141a01
chore: bump version to 2.0.16 and enhance feedback API message handling
Update package versions for denchclaw and dench to 2.0.16. Refactor feedback API to convert chat lines into PostHog-compatible messages, preserving chronological order and including tool calls and results. Improve test cases to reflect changes in message handling.
2026-03-05 21:38:55 -08:00
kumarabhirup
7cb654ea6a
fix(api): improve cron run transcript parsing for toolCall and toolResult formats
Handle the current toolCall message format alongside legacy tool_use, and merge toolResult messages back into the preceding assistant message.
2026-03-05 21:20:10 -08:00
kumarabhirup
cc1194b5eb
feat(api): add agent session fallback to web-sessions endpoint
When no web chat session file exists, search agent session directories (cron runs, CLI) and parse transcripts into UIMessage-compatible format.
2026-03-05 21:20:04 -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
c4ee320994
feat(feedback): forward client PostHog distinct ID to server-side AI traces
Ensures server-side trace events are attributed to the same user as client-side analytics.
2026-03-05 16:09:12 -08:00
kumarabhirup
ab8906a421
feat(web): wrap app in PostHog React provider with survey-based feedback
Enables useThumbSurvey for feedback buttons and sends un-redacted conversation traces on user feedback.
2026-03-05 15:36:02 -08:00
kumarabhirup
fdd89b4e6f
feat: add PostHog AI observability, feedback UI, and telemetry privacy mode
Integrate PostHog LLM Analytics via a bundled OpenClaw plugin that captures
$ai_generation, $ai_span, and $ai_trace events with configurable privacy
mode (content redaction on by default). Add like/dislike feedback buttons
to the web chat UI backed by a /api/feedback route. Extend the CLI with
`telemetry privacy on|off` subcommands and fix command delegation so
telemetry subcommands aren't forwarded to OpenClaw. Harden the web runtime
installer to auto-flatten pnpm standalone deps and dereference dangling
symlinks, preventing "Cannot find module 'next'" crashes in dev. Move
plugin installation before onboard in bootstrap so the gateway starts
with plugins.allow already configured.
2026-03-05 12:28:08 -08:00
kumarabhirup
f41c0411eb
test: add port isolation tests for DenchClaw gateway fix
- New src/config/paths.test.ts: 11 tests covering resolveGatewayPort
  profile-aware precedence (env > config > profile > global default)
- Extend bootstrap-external.test.ts: 15 new tests for
  readExistingGatewayPort (config reading, fallback, edge cases) and
  isPersistedPortAcceptable (18789 rejection guard, end-to-end composition)
- Extend web-runtime-command.test.ts: 2 new tests verifying the fallback
  returns 19001 when manifest has no lastGatewayPort or is null
- Update test fixtures across all test files to expect port 19001

All 5 critical mutations verified: removing profile check, removing
18789 guard, reverting fallback, changing constant, breaking config
reader -- each caught by at least 2 tests.
2026-03-05 10:46:16 -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
286d0fdb48
delete em all 2026-03-04 16:34:45 -08:00
kumarabhirup
4d6eec741d
npx denchclaw 2026-03-04 13:23:34 -08:00
kumarabhirup
f98fb75e81
test(web): cover workspace binary write API 2026-03-04 11:14:56 -08:00
kumarabhirup
da440735d4
feat(web): add workspace binary write API endpoint 2026-03-04 11:14:14 -08:00
kumarabhirup
9890cd9d71
test(web): add raw-file binary write route coverage 2026-03-04 11:09:10 -08:00
kumarabhirup
19dffeabd4
feat(web): add binary workspace file write endpoint 2026-03-04 11:08:35 -08:00
kumarabhirup
b2c946b08d
test(web): cover multi-view resolution and scheduling interactions 2026-03-04 11:07:54 -08:00
kumarabhirup
b5987e931c
feat(web): add multi-view schema and settings persistence 2026-03-04 11:03:27 -08:00
kumarabhirup
68015d6c14
refactor(web): enhance entry detail and object table components for improved data handling
This commit introduces several enhancements across the EntryDetailModal and ObjectTable components. Key changes include the addition of a FormattedFieldValue component for consistent display of various field types, improved handling of entry metadata, and the introduction of input type resolution for fields. Additionally, navigation callbacks for entries have been refined to support better interaction within the object table. These updates aim to streamline data presentation and enhance user experience.
2026-03-03 22:54:12 -08:00
kumarabhirup
ad41e74205
fix(web): stabilize object table row ordering
Add deterministic entry ID tie-breakers to object entry sorting so rows with identical creation timestamps do not reorder across auto-refresh cycles.
2026-03-03 20:30:56 -08:00
kumarabhirup
a1cb0b8372
refactor(web): streamline subagent session enrichment and tool event handling
This commit refactors the handling of subagent sessions by removing the enrichSubagentMessages function and integrating its functionality into the GET request handler. It also introduces the enrichSubagentSessionFromTranscript function to enhance session data retrieval. Additionally, the persistSubscribeUserMessage function is updated to ensure user messages are saved to the session JSONL file, improving message persistence across page reloads. These changes enhance the clarity and efficiency of subagent session management.
2026-03-03 17:35:34 -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
72d5204e52
test: update tests for dench-to-crm rename and IDENTITY.md visibility
All test assertions updated to reference crm instead of dench, and IDENTITY.md is now expected to be visible in the workspace tree.
2026-03-03 15:38:46 -08:00
kumarabhirup
70ca59a66d
refactor(web): show IDENTITY.md in workspace, filter managed skills, hide bootstrap toggle
IDENTITY.md is now user-editable (no longer a system file). Managed skill filter updated from dench to crm/browser. Bootstrap seed toggle hidden from create-workspace dialog.
2026-03-03 15:38:41 -08:00
kumarabhirup
1398e556a1
feat(api): register default agent in config on workspace switch
Call setDefaultAgentInConfig when switching workspaces so the gateway picks up the active workspace agent.
2026-03-03 15:38:07 -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
bf6a0abe48
refactor(api): deduplicate workspace init using shared workspace-seed
Remove ~200 lines of duplicated CRM seed objects, DuckDB seeding, and identity generation from the init route by importing from @repo/cli/workspace-seed.
2026-03-03 15:37:49 -08:00
kumarabhirup
365e1650bc
fix(test): resolve lint errors in workspace and init route tests
Remove unused useEnvWorkspace; fix base-to-string in identity content assertion.
2026-03-03 13:48:05 -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
974ba61b48
refactor(api): update workspace tree and virtual-file routes
Use workspace lib for path resolution.
2026-03-03 13:46:49 -08:00
kumarabhirup
6084381346
refactor(api): update workspace delete for workspace model
Use workspace lib helpers instead of profile-based paths.
2026-03-03 13:46:44 -08:00
kumarabhirup
4f0f7af622
refactor(api): update workspace init for workspace model
Use discoverWorkspaces, setUIActiveWorkspace, resolveWorkspaceDir; remove inline spawn logic.
2026-03-03 13:46:39 -08:00
kumarabhirup
9b505e9ae6
refactor(api): update profiles API for workspace model
Use discoverWorkspaces and getActiveWorkspaceName; keep backward-compat response fields.
2026-03-03 13:46:34 -08:00
kumarabhirup
232d6640ba
feat(api): add workspace list and switch API routes
New /api/workspace/list and /api/workspace/switch for workspace discovery and switching.
2026-03-03 13:46:30 -08:00
kumarabhirup
7309d649dd
test(web): add workspace file-ops, objects, and tree-browse tests 2026-03-02 18:34:41 -08:00
kumarabhirup
f23b7133cb
feat(web): improve suggest-files and tree route with better error handling 2026-03-02 18:34:34 -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
67812f0de6
feat(web): add workspace delete API route 2026-03-02 18:34:19 -08:00
kumarabhirup
efbeacff54
test(web): update workspace init tests for new profile-based flow 2026-03-02 18:34:12 -08:00
kumarabhirup
3568779912
feat(web): overhaul workspace init with profile creation, onboarding, and port allocation 2026-03-02 18:34:06 -08:00
kumarabhirup
d8e2d455b8
test(web): update profiles API tests for gateway metadata and switch validation 2026-03-02 18:33:59 -08:00