Repository navigation
Description
Feature description
Implement the first integration for #2272: let a user opt in to PowerContext long-term memory for a dsh-pet instance running inside DSH. For example, the pet should be able to recall a drink preference after it leaves the recent chat window, and use a later correction when both statements exist. Keep the pet's normal persona and local chat history. If recall is unavailable, the pet should still answer normally.
Problem and proposed solution
The native chat window keeps prompts small but older facts stop reaching the model. The existing powercontext-dsh hooks serve DSH agent sessions; pet chat has its own host lifecycle and no workspace identity. Add a separate host adapter, tentatively powercontext-dsh-pet, in this repository. Use the host-side memory.register/list extension, and leave an occupied provider slot alone.
- Opt in and bind. Keep memory off by default. Before sending text, require an explicit binding to a dedicated existing Scope for each enabled pet. Show the destination and explain that the configured Server receives text and may process it with its configured model providers. Keep bindings and pending records separate by DSH home/profile, pet, verified Server identity and Scope. Do not use the DSH workspace or Server default as a fallback.
- Recall before replying. Search active Atomic Memory in that exact Scope, with a small result/byte budget and a cancellable deadline below the pet's 1.5-second timeout. Mark returned text as historical evidence and preserve the current question, persona and recent history. On an empty, failed or invalid result, use the original input. Do not traverse Scope Context References in the first release.
- Capture after the native save. Queue newly completed text exchanges locally, then send them to
POST /v1/sources/contentin the background. Preserve user/assistant roles; exclude attachments and pre-existing history. Use a bounded private queue and retry the same Source ID and payload after temporary failures or a lost response. Verify the original destination before sending; pause on identity or permission changes and keep conflicts visible. HTTP 202 means the Source was stored; Memory extraction and later recall are separate observations. - Give the user control. Disabling memory stops recall, capture and queue delivery. Provide a way to discard unsent records and explain that clearing the pet's local chat does not clear the adapter queue or remote data. Keep credentials and dialogue out of logs. After manual installation works, extend
powercontext setup dshandpowercontext doctor dshfor the selected profile. Missing, disabled, ambiguous or incompatible pet entries must leave normal DSH setup and chat usable; unattended setup must never enable pet memory implicitly.
Alternatives considered
A larger native window is a useful comparison, but it repeatedly sends more chat history. The earlier bundled lifecycle approach in dsh-pet #296 was closed without merging. This adapter connects to an existing PowerContext Server. Changes to dsh-pet, bundled runtimes, standalone pets, automatic history import, remote deletion from the pet UI, Dashboard and Handoff are outside this issue.
Additional context and acceptance
- Pin and test real DSH Web, dsh-pet, the adapter package and PowerContext Server. Start with DSH
0.2.2-rc.1and dsh-pet0.4.8as candidates. Qualify newer DSH or Desktop separately before claiming support. Reuse the packaging and diagnostics patterns from feat(dsh): publish npm bundles and support Desktop v4 #2501 and feat(dsh): add plugin UI and connection status #2569 where applicable; neither PR establishes pet compatibility. - Show one complete loop: a chat exchange reaches the intended Scope as a Source, produces a verifiable Memory with processing configured, and affects a later model request after a restart and after the fact falls outside the recent window. A second pet, including one with a Scope reference to the first pet's Scope, must not retrieve that fact. A Server outage must leave chat usable; restoring the same destination must replay already queued records without duplicate Sources. Changing the destination or turning the feature off must not drain the old queue.
- Publish one reproducible synthetic comparison: native recent history, PowerContext with the same recent window, and full history where the model supports it. Fix the dialogue, model and settings. Report recall quality, corrected preferences, unsupported answers, p50/p95 latency and total known usage/cost, including extraction, retrieval, embeddings, caching and retries. Report missing usage as unknown. Lower cost is a hypothesis, not an acceptance condition.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity