Skip to content

feat(cli): align agent management with web API#491

Merged
buremba merged 7 commits into
mainfrom
feat/cli-frontend-api-boundary
May 1, 2026
Merged

feat(cli): align agent management with web API#491
buremba merged 7 commits into
mainfrom
feat/cli-frontend-api-boundary

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 1, 2026

Summary

  • add org and agent CLI commands backed by the same org-scoped REST API used by the web app
  • remove legacy local mutator commands for providers/platforms/skills/secrets and simplify local env handling
  • remove active ADMIN_PASSWORD/LOBU_ADMIN_PASSWORD auth paths from CLI and backend
  • make lobu run start without requiring lobu.toml
  • update docs to point provider/platform/skill management at the web app/API

Validation

  • make build-packages
  • bun run typecheck
  • cd packages/cli && bun run build
  • cd packages/owletto-backend && bun run typecheck
  • cd packages/owletto-backend && bun test src/__tests__/unit/lobu/gateway.test.ts
  • cd packages/landing && bun run build
  • node packages/cli/bin/lobu.js --help
  • node packages/cli/bin/lobu.js agent config --help

Notes

  • No owletto-web submodule changes were needed; the remaining adminPassword string there is Grafana chart config, not Lobu ADMIN_PASSWORD auth.

@github-actions github-actions Bot added the triage:needs-human Triage agent escalated for human review label May 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Triage decision: needs-human

Reasons:

  • PR size exceeds 1000-line hard gate (2276 lines: 1003 additions + 1273 deletions)
  • pr-size validation check failed
  • No reviews submitted yet
  • CI checks still in progress

Next: Human review required due to size threshold. The PR implements significant CLI reorganization with extensive file deletions and additions. Manual review and approval needed before merge consideration.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 007117db78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +107 to +113
const target = await resolveContext(
urlFlag ? undefined : process.env.LOBU_CONTEXT?.trim()
);
const apiBaseUrl = urlFlag
? apiBaseFromContextUrl(urlFlag)
: apiBaseFromContextUrl(target.apiUrl);
const token = await getToken(target.name);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve apply token from overridden server context

When --url is provided, auth still pulls credentials from getToken(target.name) using the current context, not from the overridden server URL. In multi-context setups this makes lobu apply --url <other-server> send the wrong bearer token and fail with 401 even if valid credentials exist for that server. The URL override needs to drive token/context resolution (or --context must be wired through here) so endpoint and credentials stay aligned.

Useful? React with 👍 / 👎.

Comment on lines +80 to +82
const config = await loadContextConfig();
config.activeOrg = trimmed;
await saveContextConfig(config);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope active org to context instead of global config

The active org is persisted as a single global value and then reused for every context. After running lobu org set in one environment, switching to another context will still reuse that slug, which can misroute /api/{org} calls or cause auth failures when org slugs differ across deployments. Active org should be stored and read per context to prevent cross-context leakage.

Useful? React with 👍 / 👎.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 1, 2026

@buremba buremba force-pushed the feat/cli-frontend-api-boundary branch from 007117d to 541a16c Compare May 1, 2026 01:23
@buremba
Copy link
Copy Markdown
Member Author

buremba commented May 1, 2026

Follow-up after clauded2 xhigh review:

  • Ran clauded2 -p --effort xhigh review; it found several medium/low issues.
  • Addressed the findings: better API error descriptions, apply now shares resolveApiClient, encoded apply agent paths, removed dead storePath plumbing, guarded --url credential leakage, friendlier JSON parse/config validation, dev routes accept OAuth bearer instead of admin password, safer .env writing, lowercase org slug validation, and 8787 doc/example cleanup.
  • Re-ran clauded2 with --effort xhigh; it reported no remaining blocking issues.

Additional validation after fixes:

  • bun run typecheck
  • cd packages/cli && bun run build
  • cd packages/owletto-backend && bun run typecheck
  • cd packages/owletto-backend && bun test src/__tests__/unit/lobu/gateway.test.ts
  • cd packages/landing && bun run build
  • make build-packages

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Triage decision: needs-human

Reasons:

  • Review comment contains P1 escalation keyword from chatgpt-codex-connector[bot]
  • Multiple CI checks still failing/in progress: unit, typecheck, integration, build-test
  • PR involves significant CLI reorganization requiring human oversight

Next: Human review required due to P1 issues identified in automated code review. The PR author should address the P1 findings in the review comments before requesting re-triage.

buremba added 6 commits May 1, 2026 02:53
…for overridden URLs

- Fix P2: Move activeOrg from global to per-context scoping in config.json
- Fix P1: Use findContextByUrl to resolve correct context credentials when --url is provided
- Add migration path for legacy top-level activeOrg
- Add unit tests for api-client and context management
- Implement per-context activeOrg scoping
- Implement findContextByUrl for better credential resolution when --url is provided
- Clean design without legacy migration (no release cut yet)
- Added comprehensive unit tests for internal context and api-client
… memory subcommands

- Update orgList, orgCurrent, and orgSet to support context scoping
- Add -c, --context option to org and memory subcommands in the CLI loop
- Ensure all API-talking commands are reliably using the resolved context
- Refactor openclaw-auth to use context-scoped activeOrg and memoryUrl
- Remove redundant memory.json state management
- Update all memory subcommands to be async and context-aware
- Add memoryUrl support to context configuration
@buremba buremba added the skip-size-check Bypass PR size gate for intentionally large single-concern changes label May 1, 2026
@buremba buremba merged commit 86e0b25 into main May 1, 2026
18 of 21 checks passed
@buremba buremba deleted the feat/cli-frontend-api-boundary branch May 1, 2026 02:39
@buremba buremba restored the feat/cli-frontend-api-boundary branch May 12, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-size-check Bypass PR size gate for intentionally large single-concern changes triage:needs-human Triage agent escalated for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants