feat(cli): align agent management with web API#491
Conversation
|
Triage decision: Reasons:
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. |
There was a problem hiding this comment.
💡 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".
| 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); |
There was a problem hiding this comment.
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 👍 / 👎.
| const config = await loadContextConfig(); | ||
| config.activeOrg = trimmed; | ||
| await saveContextConfig(config); |
There was a problem hiding this comment.
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 Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
007117d to
541a16c
Compare
|
Follow-up after clauded2 xhigh review:
Additional validation after fixes:
|
|
Triage decision: Reasons:
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. |
…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
Summary
lobu runstart without requiringlobu.tomlValidation
make build-packagesbun run typecheckcd packages/cli && bun run buildcd packages/owletto-backend && bun run typecheckcd packages/owletto-backend && bun test src/__tests__/unit/lobu/gateway.test.tscd packages/landing && bun run buildnode packages/cli/bin/lobu.js --helpnode packages/cli/bin/lobu.js agent config --helpNotes
adminPasswordstring there is Grafana chart config, not Lobu ADMIN_PASSWORD auth.