[WIP] A1: adapter extraction + overlay-fallback fix (stacked on #165) — do not merge#169
Closed
NimbleCoAI wants to merge 3 commits into
Closed
[WIP] A1: adapter extraction + overlay-fallback fix (stacked on #165) — do not merge#169NimbleCoAI wants to merge 3 commits into
NimbleCoAI wants to merge 3 commits into
Conversation
…y view (Path 1) Proof (spike, do not merge) that HSM can run a Letta *server* as a managed container via the existing runtime-neutral DockerService, and CRUD/message individual Letta agents over REST as a separate "agents-as-API-resources" layer distinct from the container model. - docker/letta-compose.yml: letta/letta server, :8283, embedded Postgres volume (commented shared-pgvector alt). Managed by DockerService unchanged. - lib/services/letta.ts: minimal fetch REST client — listAgents, getAgent, createAgent, sendMessage, getMemoryBlocks. Base URL from LETTA_BASE_URL, defaults http://localhost:8283. Loosely typed (spike). - app/api/letta/*: same-origin proxy routes (list / send message / blocks). - app/(dashboard)/letta: read-only agents view + single send-message action. - Sidebar: "Letta" nav entry. Out of scope: airlock, wizard integration, runtime-adapter refactor, no lib/types.ts changes on main. Typecheck + lint pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
First slice of the Letta wizard/base-package fork (design 2026-07-18-letta-wizard-fork-design.md, §5 recommended first slice). Stacks on the Letta REST spike (#163, branch swarm-map-letta-runtime). Entirely additive; no live Letta server required to compile. Phase 0 (discriminator + server-as-Harness): - lib/types.ts: extend Harness.runtime union with 'letta' + 'letta-server' (the one additive types.ts change the spike deliberately avoided). - lib/services/runtime-adapter.ts: ContainerRuntimeAdapter interface — the container-runtime seam (design §1b), discovery surface only. - lib/services/harness.ts: hermesAdapter + pickContainerAdapter registry; discover() now dispatches the discovery gate / runtime / dataDir / persona / models through the adapter instead of the inline hermes-/seraph- string gate. Behavior-preserving extraction — hermesAdapter delegates to the same module-local guessDataDir/readSoul/readModelConfig, overlay-only containers keep hermes semantics via `effAdapter = adapter ?? hermesAdapter`. - lib/services/letta-agent-provider.ts: AgentResourceProvider (Letta) — maps LettaAgent -> Harness (design §1c), plus the Letta server as a container-backed 'letta-server' Harness. Read-only (list/get) in this slice. - lib/services/index.ts: wire the provider as services.lettaAgents. Phase 1 read-only half (UI degradation): - app/api/letta/harnesses: fleet-list endpoint (server + agents as Harness[]). - app/api/harnesses/[id]: GET branches to the Letta provider for h_letta_* ids. - components/harness/letta-agent-detail.tsx: dedicated read-only Letta detail view — model handle instead of CPU/mem, memory-block viewer, message viewer in place of the container Logs tab, no lifecycle buttons (design §4a). - harnesses/[id]/page.tsx: runtime-branching wrapper early-returns to the Letta view; existing Hermes page renamed HermesHarnessDetail, otherwise untouched. - harnesses/page.tsx: merge Letta harnesses into the fleet list; Letta rows degrade to Open only (no restart/stop/duplicate/remove), no cost/inv stats. Deferred to later phases (clear TODOs in-code): adapter extraction of generateCompose/scaffold/image-ref (Phase 2, touches Hermes deploy — untouched here), wizard runtime toggle + deploy branch (Phase 3), live-server validation of create/message/block shapes (Phase 4), Librarian package + airlock (Phase 5). Verify: tsc --noEmit clean; eslint clean on all new files (pre-existing warnings/1 error remain in untouched ModelCascadeEditor code); 6/6 existing harness.test.ts pass (behavior preservation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ntainerRuntimeAdapter, fix overlay-fallback dispatch Phase 2 of the wizard-fork design (memory/specs/2026-07-18-letta-wizard-fork-design.md §1b, §5): - ContainerRuntimeAdapter gains the provisioning surface (serviceName, generateCompose, scaffold) and the CD image-ref surface (readImageRef, setImageRef, defaultImageRepo). hermesAdapter delegates to the same module functions the call sites used inline — zero behavior change. - Fix the `adapter ?? hermesAdapter` landmine: discover()'s overlay-only branch now dispatches on the overlay's PERSISTED runtime via adapterForRuntime(), not a blind Hermes fallback. Pre-seam rows (no runtime field) keep Hermes semantics. - HarnessService dispatch sites (resolveComposeTarget, currentImage, imageStatus, setAgentImage, duplicate, createOverlay, importFromDir) and the settings route now go through the adapter. - registerContainerAdapter() for future runtimes (claude-code-proxy/custom). 727/727 tests, tsc clean. New: runtime-adapter.test.ts (selection + delegation). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juniperbevensee
changed the base branch from
dev/juniperbevensee/swarm-map-letta-wizard-fork
to
main
July 22, 2026 01:20
juniperbevensee
marked this pull request as ready for review
July 22, 2026 01:20
Collaborator
juniperbevensee
deleted the
dev/juniperbevensee/letta-a1-adapter-extraction
branch
July 22, 2026 01:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice A1 of Swarm Map v1 (spec:
memory/specs/2026-07-19-swarm-map-v1-definition.md§2.A1; design:2026-07-18-letta-wizard-fork-design.md§1b Phase 2). Stacked on #165 — do not merge until launch sequence.What
ContainerRuntimeAdaptergains the provisioning surface (serviceName,generateCompose,scaffold) and CD image-ref surface (readImageRef,setImageRef,defaultImageRepo).hermesAdapterdelegates to the exact module functions the call sites used inline — behavior-preserving.adapter ?? hermesAdapterlandmine fix:discover()'s overlay-only branch now dispatches on the overlay's persistedruntimeviaadapterForRuntime()instead of blindly defaulting to Hermes — fixed before a 2nd adapter exists, per the spec. Pre-seam rows (noruntimefield) keep Hermes semantics.resolveComposeTarget,currentImage,imageStatus,setAgentImage,duplicate(source's runtime),createOverlay/importFromDir(Hermes-only creation paths, explicit), and the settings-route compose regen.registerContainerAdapter()for future runtimes (claude-code-proxy/custom— explicitly NOT wired in v1, per spec §4).Verification
runtime-adapter.test.ts: selection semantics + delegation round-trips)tsc --noEmitcleanno-explicit-anyerrors in settings route (verified identical on base)🤖 Generated with Claude Code