Skip to content

feat: Dynamic Project Registry + GitHub App Migration - #3

Merged
marcmantei merged 8 commits into
mainfrom
issue-1-dynamic-registry-github-app
Mar 12, 2026
Merged

feat: Dynamic Project Registry + GitHub App Migration#3
marcmantei merged 8 commits into
mainfrom
issue-1-dynamic-registry-github-app

Conversation

@marcmantei

Copy link
Copy Markdown
Owner

Summary

Implements #1Dynamic Project Registry + GitHub App Migration.

Phase 1: Dynamic Project Registry

  • Auto-discovery: Background loop runs gh repo list per configured GitHub owner, reconciles against a SQLite registry_repos table
  • Per-repo config overrides: worker_model and enabled flags preserved across syncs
  • Auto-clone: Optionally clones new repos to a configured base directory
  • Exclude patterns: Simple glob support to skip repos
  • Notifications: Sends a summary message (new/archived repos) via MessagingManager when notification_target is set
  • REST API: 5 endpoints under /api/registry/
  • Hot-reload: Reads RegistryConfig from RuntimeConfig (ArcSwap) each sync iteration

Bugfixes

  • Cortex profile 404: Default routing model corrected from anthropic/claude-sonnet-4 to anthropic/claude-sonnet-4-20250514
  • Worker outcome reporting: SendMessageTool now sets replied_flag on successful delivery, so retrigger relays via send_message_to_another_channel (e.g. webhook → Telegram) are recognized as successful

Phase 2: GitHub App Migration (infrastructure, no code changes)

  • GitHub App "Lira Spacebot" installed on all marcmantei repos
  • Tailscale Funnel replaces Cloudflare quick tunnel
  • Old per-repo webhooks removed, legacy systemd services cleaned up

Config example

[defaults.registry]
enabled = true
github_owners = ["marcmantei"]
clone_base_dir = "/home/sira"
sync_interval_secs = 3600
auto_clone = true
exclude_patterns = ["marcmantei/liralot-config"]
notification_target = "telegram:1285309093"

Test plan

  • All 633 lib tests pass
  • 9 registry-specific tests
  • Live: registry sync discovered 22 active repos
  • Live: GitHub App webhook delivery verified
  • Live: Tailscale Funnel stable

🤖 Generated with Claude Code
via Happy

marcmantei and others added 4 commits March 12, 2026 17:10
Add a SQLite-backed registry that auto-discovers GitHub repositories
via `gh repo list`, syncs periodically in the background, and
optionally auto-clones new repos. Per-repo config overrides (model,
enabled) are preserved across syncs.

New modules:
- registry/store.rs — RegistryStore CRUD (upsert, list, overrides, link)
- registry/sync.rs — discovery via gh CLI, reconciliation, auto-clone
- api/registry.rs — 5 REST endpoints for repos, overrides, sync, status

Config: [defaults.registry] section with github_owners, clone_base_dir,
sync_interval_secs, auto_clone, exclude_patterns.

Wired into RuntimeConfig (hot-reloadable), AgentDeps, ApiState, and
main agent init loop with background sync task.

9 new tests, all 633 tests pass.

Refs: #1

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Send a summary message via MessagingManager when registry sync discovers
new repos or archives removed ones. Configurable via `notification_target`
in [defaults.registry] (e.g. "telegram:1285309093").

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
The sync loop was spawned before messaging_manager was set on AgentDeps,
so notifications were never sent. Now spawns after init, reading the
sync status from ApiState.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
1. Fix cortex profile 404: default routing model was
   "anthropic/claude-sonnet-4" (doesn't exist), now uses
   "anthropic/claude-sonnet-4-20250514".

2. Fix worker outcome reporting: when a webhook-triggered worker
   completes and Lira relays the result via send_message_to_another_channel
   (e.g. to Telegram), the retrigger system didn't recognize it as a
   successful relay because only the reply tool set the replied_flag.
   Now SendMessageTool also sets the flag on successful delivery.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@marcmantei

Copy link
Copy Markdown
Owner Author

fix the failing checks

marcmantei and others added 4 commits March 12, 2026 20:34
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
The agent now uses the registry as its dynamic project list:

1. System prompt injection: enabled registry repos are appended to the
   project context so the agent knows about all discovered repos
   (name, path, language, model override, default branch).

2. Webhook event filtering: events from repos not in the registry or
   with enabled=false are dropped before reaching the agent. This
   replaces the need for a hardcoded project table in ROLE.md.

Combined with the GitHub App (all repos) and registry sync (auto-discover),
this completes the zero-config flow: new repo → auto-discovered →
webhooks delivered → agent reacts.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@marcmantei
marcmantei merged commit 50ab0bb into main Mar 12, 2026
3 checks passed
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.

1 participant