fix(archied): initialize conversation persistence on daemon startup

This commit is contained in:
sam committed 2026-09-07 00:49:54 +10:00
1 parent 5c0efaceaf
commit 3175526732
5 files changed
+10 -13

No files matched your search

+1 -1
View File
@@ -108,7 +108,7 @@ tasks:
dev:daemon:
desc: archied only, live-reloading via air (prefer `task dev`)
cmds:
- air
- air -build.args_bin="-config-overlay,deployments/dev.toml"
dev:gateway:
desc: archie-gateway only, no live-reload (prefer `task dev`)
+3
View File
@@ -0,0 +1,3 @@
# Match Vite's API/event proxy without changing the installed configuration.
[web]
listen = "127.0.0.1:8484"
+1 -1
View File
@@ -281,7 +281,7 @@ func (b *boot) openStores(ctx context.Context) error {
log.Error("close store", "err", err)
}
})
return nil
return b.openChatSessions(ctx)
}
func (b *boot) openChatSessions(_ context.Context) error { //nolint:unparam // context keeps the composition phase contract aligned with other openers
@@ -7,22 +7,19 @@ import (
"github.com/samcharles93/archie-core/internal/config"
"github.com/samcharles93/archie-core/internal/gateway"
"github.com/samcharles93/archie-core/internal/store"
"github.com/samcharles93/archie-core/internal/webui"
)
func TestRemoteChatCompositionPreservesChannelTurnLedger(t *testing.T) {
cfg := config.Config{DBPath: filepath.Join(t.TempDir(), "tasks.db")}
cfg.Services.Gateway.Target = "127.0.0.1:1"
st, err := store.Open(t.Context(), cfg.DBPath)
if err != nil {
b := &boot{cfg: cfg, log: slog.Default(), web: &webui.Server{Cfg: config.NewHolder(cfg)}}
t.Cleanup(b.cleanup)
if err := b.openStores(t.Context()); err != nil {
t.Fatal(err)
}
t.Cleanup(func() { _ = st.Close() })
b := &boot{cfg: cfg, st: st, log: slog.Default(), web: &webui.Server{Cfg: config.NewHolder(cfg)}}
t.Cleanup(b.cleanup)
if err := b.openChatSessions(t.Context()); err != nil {
t.Fatal(err)
if b.chatSessionStore == nil {
t.Fatal("startup did not open the channel conversation store")
}
sessions := b.chatSessionStore
if err := b.setupLLMAndChat(); err != nil {
-3
View File
@@ -38,9 +38,6 @@ func RunGateway(ctx context.Context, options GatewayOptions) error {
if err := b.openStores(ctx); err != nil {
return err
}
if err := b.openChatSessions(ctx); err != nil {
return err
}
b.loadCatalog(ctx, options.Config)
url, token := b.cfg.NATS.URL, ""
var nc *natsio.Conn