Skip to content

refactor: move Lobu to file-first config and embedded runtime#170

Merged
buremba merged 7 commits into
mainfrom
codex/owletto-cli-embedded-fix
Apr 4, 2026
Merged

refactor: move Lobu to file-first config and embedded runtime#170
buremba merged 7 commits into
mainfrom
codex/owletto-cli-embedded-fix

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented Apr 4, 2026

Summary

This PR now contains the full pending branch change set, not just the original embedded Owletto fix. The main thrust is moving Lobu toward a file-first configuration and embedded runtime model, while also landing the related gateway, worker, docs, and product-surface updates that were present in the local checkout.

Included changes

Gateway and runtime architecture

  • added direct lobu.toml loading in packages/gateway/src/config/file-loader.ts
  • added the embedded/runtime Lobu facade in packages/gateway/src/lobu.ts
  • introduced in-memory agent/config store wiring for embedded and file-loaded agents
  • updated packages/gateway/src/services/core-services.ts and public config routes to work with file-loaded and runtime-provisioned agent settings
  • added config request storage and supporting route/test coverage

Route, auth, and API reshaping

  • refactored large parts of the gateway public route surface around agents, history, schedules, connections, settings access, and message handling
  • added route coverage for agent history, agents, schedules, config requests, connections, and message handler bridging
  • removed several legacy page-oriented route bundles and older settings/auth helper paths that no longer fit the new architecture
  • removed older internal discovery/settings-link routes and obsolete gateway helper modules

Embedded worker and Owletto execution

  • fixed embedded worker startup to use the correct Bun executable
  • fixed embedded worker PATH construction so both repo-root and worker-local .bin directories are available
  • fixed Node-shebang CLI execution in packages/worker/src/embedded/just-bash-bootstrap.ts
  • added the worker dependency/runtime support needed for embedded workers to execute owletto
  • made memory plugin detection and fallback behavior more robust in packages/gateway/src/config/index.ts
  • added regression coverage in:
    • packages/gateway/src/__tests__/config-memory-plugins.test.ts
    • packages/gateway/src/__tests__/embedded-deployment.test.ts
    • packages/worker/src/__tests__/embedded-just-bash-bootstrap.test.ts

CLI and project flow

  • simplified CLI project setup and local run flow so the gateway reads project files directly instead of relying on generated agent manifests
  • updated CLI loader/config behavior in packages/cli/src/commands/dev.ts, packages/cli/src/commands/init.ts, and related config code
  • removed older manifest and MCP-server generation helpers that no longer match the file-first model

Docs, examples, env, and landing

  • updated .env.example, README.md, Docker compose files, Helm values/templates, and config/system-skills.json
  • refreshed examples and templates to match the new setup and testing flow
  • added landing/docs content for memory, embedding, and additional platforms
  • removed the old standalone landing/ app tree in favor of the current packages/landing direction

Why

This branch combines two streams of work that were present in the checkout:

  • move Lobu toward a config-driven, directly loadable gateway/runtime model
  • make embedded execution reliable for Owletto-backed CLI and memory workflows

As a result, the PR is broader than the original branch name suggests and should be reviewed as an architecture/runtime/content update rather than a narrow one-file fix.

Validation

Validation from an isolated clean worktree at the branch tip:

  • make build-packages: passed
  • bun test packages/gateway/src/__tests__/config-memory-plugins.test.ts packages/gateway/src/__tests__/embedded-deployment.test.ts packages/worker/src/__tests__/embedded-just-bash-bootstrap.test.ts: passed

Runtime note:

  • the Owletto CLI path previously succeeded end-to-end and returned owletto 1.4.0
  • the latest Telegram rerun on the long-lived local stack timed out while the gateway showed worker SSE reconnect churn
  • that timeout appears tied to the existing local dev-stack state rather than the isolated branch build/test results, but it should still be rechecked on a freshly restarted stack before merge

Comment thread packages/gateway/src/cli/gateway.ts Fixed
…sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@buremba buremba marked this pull request as ready for review April 4, 2026 01:47
@buremba buremba changed the title [codex] Fix embedded Owletto CLI execution [codex] Move Lobu to file-first config and embedded runtime Apr 4, 2026
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: a21dad39d4

ℹ️ 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 thread packages/gateway/src/services/core-services.ts Outdated
Comment thread packages/gateway/src/lobu.ts
@buremba buremba changed the title [codex] Move Lobu to file-first config and embedded runtime refactor: move Lobu to file-first config and embedded runtime Apr 4, 2026
@buremba buremba merged commit 8c7a17e into main Apr 4, 2026
8 of 9 checks passed
@buremba buremba deleted the codex/owletto-cli-embedded-fix branch April 4, 2026 02:30
buremba added a commit that referenced this pull request May 18, 2026
Picks up:
- PR #170 (lobu-ai/owletto): inline pairing + permissions into the
  chrome extension sidepanel (no more separate pairing.html tab).
- PR #172 (lobu-ai/owletto): pin chrome extension ID via manifest key
  (`amnnhclgmbldmfcfamonoggjhfidemmm`) and hardcode it into the Mac
  bridge's allowed_origins; env var override now validates against
  the chrome ID regex.
buremba added a commit that referenced this pull request May 18, 2026
#889)

Picks up owletto-ai/owletto#185 (mac menubar context picker +
per-context Keychain + Start/Stop semantics) and adds the CLI/
server hooks the menubar needs.

CLI / server changes:

- getServerConfig() in packages/cli/src/internal/context.ts now
  honors LOBU_CONTEXT env in addition to the explicit arg and the
  config's currentContext. Without this, the Mac menubar's
  spawn-of-`lobu run` (which passes LOBU_CONTEXT=<context>)
  couldn't make the server resolve the right context's server
  block — every run fell back to the operator's CLI default and
  picked PGlite even when a databaseUrl was configured for the
  intended context.

- LobuServerConfig + UserServerConfig gain a `lifecycle?:
  "managed" | "external"` field. The Mac menubar uses this to
  decide whether to own the runner's process (Start/Stop verbs)
  or just connect (Sign in/Sign out). Today only the menubar
  reads it; the CLI's `lobu run` ignores it.

Submodule:

- packages/owletto bumped from fb84cf15 (#174 merge) → 970eb500.
  Inbetween: #170 chrome-ext inline pairing, #172 manifest key,
  #173 sidepanel iframe fix, plus #185.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants