Move OpenAI client initialization from module top-level to a lazy
singleton (lib/openai.ts) called inside route handlers. Prevents build
errors when gateway env vars aren't set. Also adds openclaw.json
agents.defaults.workspace as the first workspace detection source,
before falling back to filesystem paths.
Inspired by PR #21 (cherry-picked the good parts, skipped the fragile
cli-utils rewrite and the agents-registry simplification that dropped
sub-agents). Bumps to v0.8.8.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Strip OpenClaw validation warnings from CLI stdout before JSON.parse()
so ClawPort works with OpenClaw versions that print "Unrecognized key"
warnings (fixes#16). Add workspace-<agentId> path format detection to
setup scripts for multi-agent workspaces (fixes#18). Bumps to v0.8.5.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add OPENCLAW_GATEWAY_PORT env var support (default 18789) — auto-detected
from openclaw.json during setup, all API routes use gatewayBaseUrl() helper
- Redesign AI Cost Analysis as "Agent Optimizer" with action chips, structured
prompts for Max plan users, and follow-up suggestions
- Fix renderMarkdown to handle fenced code blocks (extract before escape,
reinsert after rules)
- Rewrite buildCostAnalysisPrompt: throughput-focused, structured response
format, 350 word cap
- Fix efficiency score using effective input (input + cache tokens)
- Unified OptimizationCard with UUID resolution and responsive layout
- Update all docs and in-app help to mention configurable port
- Remove auto-scroll from cost analysis chat
- Change insight button from "Fix" to "How to fix"
Closes#9
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
detectWorkspacePath() now checks ~/.openclaw/agents/main/workspace
first (current layout), falling back to ~/.openclaw/workspace (legacy).
Fixes#3.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When clawport-ui is installed globally (e.g. npm install -g), the package
lives in a system path like /usr/lib/node_modules/clawport-ui which is
not writable by normal users. clawport setup would then fail with EACCES
when writing .env.local.
- setup.mjs: if target dir is not writable, write .env.local to
~/.config/clawport-ui/ instead and create that dir if needed
- bin/clawport.mjs: load .env.local from package root or, if missing,
from ~/.config/clawport-ui so dev/start/status/doctor work with
global installs
Fixes EACCES when running 'clawport setup' after global install.
Made-with: Cursor
The OpenClaw gateway disables /v1/chat/completions by default. Setup
now detects this and offers to enable it. Chat route shows a clear
error message on 405 instead of a generic failure.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Agent registry now auto-discovers agents from $WORKSPACE_PATH/agents/
instead of requiring a manual agents.json or falling back to bundled
defaults. Resolution: user override -> auto-discover -> bundled fallback.
Cron-to-agent matching is now dynamic (by agent ID prefix) instead of
using a hardcoded PREFIX_MAP tied to the developer's specific agents.
Also includes: kanban robustness (timeouts, concurrent limits, input
validation, dedup, stale work recovery), onboarding name input moved
to step 1, operator name on settings page, agent profile image upload,
TTS speaker icon removed, npm install troubleshooting docs.
298 tests passing (up from 288).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users can now run ClawPort after `npm install -g clawport-ui` via the
`clawport` command (dev, start, setup, status, help). The CLI resolves
its own package root so commands work from any directory.
- Add bin/clawport.mjs with subcommands
- Add bin field to package.json
- Add --cwd flag to scripts/setup.mjs for CLI usage
- Update README, SETUP, CLAUDE.md, and in-app docs
- Add BestPracticesSection and npm troubleshooting to docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7-step onboarding wizard (welcome, system check, naming, theme, accent,
voice input, overview) with live previews and OpenClaw health checks.
Add operatorName to settings — replaces all hardcoded "John Rice" references
in sidebar, chat prompts, and system messages with dynamic operator name.
Rebrand user-facing strings from "Manor" to "Agent Claw" with BRANDING.md
documenting every reference for future rebranding.
Open-source readiness: configurable agent registry (workspace override),
requireEnv() for safe env access, npm run setup auto-detection script,
SETUP.md guide, and comprehensive developer documentation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>