Skip to content

Add a registry resync/refresh button (pull + reload installed packs without a restart) #236

Description

@saucam

Problem

There is no way from the codeoid UI to pick up a merged change to an installed
pack
. When a pack's registry (e.g. ai-factory) gets a fix on main, the only
way to apply it locally today is out-of-band:

git -C ~/.codeoid/packs/<registry> pull --ff-only   # update the cache
systemctl --user restart codeoid.service            # reload the pack

The web UI exposes registry.add, pack.install, pack.remove, pack.trust,
pack.select — but no refresh/resync. Hit in practice: after merging
ai-factory#4 (a pipeline-phase fix), the running daemon kept using the stale
pack until a manual pull + restart.

Proposal

A small resync / refresh button on each installed registry row in
PackBrowser, backed by a new pipeline.registry.refresh verb.

The correctness catch (important)

PackService.refresh(name) already exists — but it only git pulls the cache.
That is not enough: the live daemon holds the pack loaded in-memory
(installPack(loadPack(...)) at boot / install), so a pull alone updates the
files while the running pipeline keeps the OLD pack. A refresh that only pulls
would look like it worked and silently do nothing to a live run.

So the verb must pull AND reload: for each installed pack whose
registry === name, re-run loadPack(entry.dir, {trusted}) → installPack and
re-link skills (respecting the trust gate from #233 — an untrusted pack still
does not link). Reply with the refreshed pack.list result like every other
mutating pack verb.

Sketch

  • protocol: PipelineRegistryRefreshMsg { type: "pipeline.registry.refresh", name?: string } (omit name = all); reply reuses pipeline.pack.list.result.
  • PackService: refreshRegistry(name?) = refresh() (pull) + reload each installed pack from that registry into the live manager + #linkSkills when trusted.
  • session-manager: #registryRefresh handler behind #packManageGuard.
  • web state (state/packs.ts): refreshRegistry(name) action (existing dispatch pattern).
  • web UI (PackBrowser.tsx): refresh button per installed registry, in-flight spinner.
  • tests: PackService reload-after-pull (a pulled pack.yaml change is live without re-install), + the untrusted-still-not-linked case.

Notes

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions