@@ -90,8 +90,11 @@ cannot reach the Host falls back to that command.
9090 direct Meta page link, backed by the routes above, plus the ` /muse-login ` chat command. Both
9191 start DSH's own device-code flow (` llm-pi-ai/meta ` ) and open the verification page in the
9292 default browser.
93+ - Paints the native credential dot on the ** Muse Code (Meta subscription)** row: the route names
94+ ` apiKeyEnv: MUSE_CODE_SUB_TOKEN ` , and the plugin mirrors the OAuth record's minted key into that
95+ reference (red without a credential, green with one) and re-mints it before Meta's ~ 24 h expiry.
9396- Leaves credential handling to DSH: the shipped flow stores the sign-in as an OAuth credential
94- record and re-mints Meta 's short-lived inference key automatically , so the route keeps
97+ record and the plugin keeps the route 's credential-reference copy fresh , so the route keeps
9598 working after the key rotates.
9699
97100## Requirements
@@ -126,8 +129,9 @@ see the upgrade note under Troubleshooting.
126129- The local ` POST /muse-code/login ` , ` GET /muse-code/login ` , and ` GET /muse-code/status ` routes
127130 only start the flow and report its state; they transmit no credential and are reachable only
128131 on the Host's own loopback listener.
129- - The stored credential is the ` llm-pi-ai/meta ` record in the DSH credential store. It never
130- appears in configuration or logs.
132+ - The stored credential is the ` llm-pi-ai/meta ` record in the DSH credential store; the
133+ ` MUSE_CODE_SUB_TOKEN ` reference the row reads is a copy of its minted key and is refreshed by
134+ the plugin. Neither ever appears in configuration or logs.
131135- To remove access, remove the bundle, remove the declared provider from ** Settings → Models**
132136 (or from the profile's ` cordis.patch.yml ` ), and delete the ` llm-pi-ai/meta ` record while DSH
133137 is stopped (the file is ` $DSH_HOME/.credentials.yaml ` ), or run the sign-in again to replace
@@ -137,6 +141,25 @@ see the upgrade note under Troubleshooting.
137141See [ SECURITY.md] ( SECURITY.md ) for vulnerability reporting and
138142[ AUTH_CONTRACT.md] ( AUTH_CONTRACT.md ) for the pinned login contract that DSH implements.
139143
144+ ## Prompt caching
145+
146+ The Meta Model API caches the request prefix per ` prompt_cache_key ` , and a request without that
147+ key gets no reuse at all. DSH's pi-ai adapter sends the session id as the key for every call, so
148+ turns in the same session reuse the prefix Meta already saw. Measured against the live API with
149+ an identical 1.6k-token prefix: same key → 1521 of 1600 tokens cached on the second call;
150+ different key or no key → 0.
151+
152+ The ratio you see in the usage panel therefore depends on how the session is used:
153+
154+ - the cache is per key and per model — switching model or route starts a fresh prefix;
155+ - a short session, or turns spaced far apart, shows a low ratio, because the first call of every
156+ cache window pays full price;
157+ - editing the system prompt or compacting the history invalidates the prefix once.
158+
159+ The plugin does not change the request shape, so this behaves like any other pi-ai route in the
160+ same harness (for example ` opencode-go ` ). DeepSeek's first-party routes report their own cache
161+ counters and are not directly comparable.
162+
140163## Troubleshooting
141164
142165### Nothing named Muse Code appears under Settings → Models
@@ -192,6 +215,36 @@ before it expires.
192215DSH re-mints the inference key from the stored session. When Meta ends that session, run the
193216sign-in again (Sign in control or ` /muse-login ` ) to sign in and replace the record.
194217
218+ ### The credential dot stays red after signing in
219+
220+ The route's credential reference is a copy of the record's minted key; the plugin mirrors it on
221+ boot and on every record update. If the dot stays red while the card says ** Signed in** , restart
222+ DSH and check that the ` llm-pi-ai/meta ` record still exists in the credential store.
223+
224+ ### Requests fail after about a day without the plugin running
225+
226+ The route authenticates through the mirrored reference, and the plugin re-mints the key before
227+ its ~ 24 h expiry. If DSH ran with the plugin disabled long enough for the key to lapse, sign in
228+ again (Sign in card or ` /muse-login ` ).
229+
230+ ### Edit and Delete on the Muse Code row
231+
232+ Both are DSH's generic provider-row actions and a plugin cannot hide them.
233+
234+ - ** Edit** writes the route profile into your profile patch: display name, models, and the
235+ ` apiKeyEnv ` reference. The plugin restores the reference on the next boot and refills an
236+ emptied model list from the account catalog.
237+ - ** Delete** removes only that user-layer route: the provider leaves Settings → Models and the
238+ model picker, and a hand-edited model list is lost; the credential record and its mirrored
239+ reference stay. The plugin re-declares the route on the next boot and resyncs the catalog. To
240+ actually remove Muse Code, uninstall the bundle and delete the credential record.
241+
242+ The supported off switch is the plugin itself:
243+
244+ ``` bash
245+ dsh plugin --profile desktop remove @thestreamcode/dsh-muse-code
246+ ```
247+
195248### Upgrading from 0.1.x
196249
1972500.1.x inserted a second ` @deepseek-ai/dsh-llm-pi-ai ` instance, which DSH refuses to activate
0 commit comments