Commit Graph
5 Commits
Author SHA1 Message Date
Federico Jaramillo Martinez ad74ea4da7 refactor: generate session names via agent.streamFn instead of pi-ai compat
Rewrite sessionNameGenerator.ts to consume a StreamFn-shaped dependency
(sourced from PiAgentSession.agent.streamFn, wired in leg B) instead of
ModelRegistry plus a dynamic @earendil-works/pi-ai/compat import.

streamFn resolves auth/headers/retry internally, so the explicit
modelRegistry.getApiKeyAndHeaders(model) call and apiKey/headers stream
options are no longer needed.

Deletes now-dead compat-loading machinery: getPiAiProviderRegistryModule,
loadPiAiProviderRegistryModule, importOptionalPiAiModule,
isModuleUnavailableError, hasGetApiProvider, PI_AI_COMPAT_MODULE,
ModuleImporter, SessionNameApiProvider, PiAiProviderRegistryModule, and
the module-level provider registry cache.

Updates the maybeGenerateSessionName call site in piSessionService.ts to
pass session.agent.streamFn instead of this.modelRegistry, and updates
both test files: sessionNameGenerator.test.ts gains coverage for the new
streamFn-driven generateShortSessionName signature (success and error
paths), and piSessionService.test.ts gains an end-to-end test proving a
first prompt generates a session name through the wired agent.streamFn
fake.

sessionNameGenerator.ts no longer imports @earendil-works/pi-ai/compat
or references getApiProvider anywhere.
2026-07-02 11:42:30 +02:00
Federico Jaramillo Martinez c479a0d54d fix: support pi-ai provider compat entrypoint 2026-06-24 09:15:32 +02:00
Federico Jaramillo Martinez 82ba2e0490 fix: validate prompt API payloads
Fixes #11
2026-06-05 11:09:15 +02:00
Federico Jaramillo Martinez b328c816f9 Fix automatic session title generation 2026-05-08 15:06:04 +02:00
Federico Jaramillo Martinez 1bbad2e89f Add session activity dock and auto naming 2026-05-08 14:53:06 +02:00