You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dbd6866
Browse filesBrowse the repository at this point in the historyBrowse files
* test(backend): replace better-sqlite3 test mock with node:sqlite
Reimplement the bun:sqlite test mock on top of node:sqlite with an
explicit BEGIN/COMMIT/ROLLBACK transaction wrapper.
* feat(assistant): self-configuring assistant mode
Add a self-editable assistant workspace and the APIs that support it:
- POST /assistant/reload disposes and re-bootstraps the assistant
instance (directory-scoped, rate-limited) so agent.md edits apply.
- Internal settings API accepts non-secret TTS/STT patches via
dedicated partial schemas.
- Strip the generated agent persona from opencode.json on repair so
user-customized agents are preserved across config recovery.
- Cache the last assistant session id to avoid redundant session
listing on launch.
* style(repo): align worktree and workspace tabs with primary/orange theme
'You are the default Assistant Mode agent for OpenCode Manager.',
226
+
'',
227
+
'This workspace is the shared assistant workspace for OpenCode Manager. Help the user manage repos, schedules, notifications, settings, and assistant behavior safely.',
228
+
'',
229
+
'## Self-Editing Rules',
230
+
'',
231
+
'Durable assistant instructions, behavior, and preferences belong in `.opencode/agents/assistant.md`. Edit that file when the user expresses lasting preferences or when you need to refine your behavior.',
232
+
'',
233
+
'The workspace directory explanation belongs in `AGENTS.md`. Keep that file focused on describing the directory contents and pointing to managed files.',
234
+
'',
235
+
'Preserve user-customized workspace files unless the user explicitly asks you to change them. Ask before making significant, destructive, or out-of-workspace changes.',
236
+
'',
237
+
'## Skill Usage',
238
+
'',
239
+
'Use the workspace skills when relevant:',
240
+
'- Load `repo-management` before `schedule-management` when you need a repo ID.',
241
+
'- Load `schedule-management` for schedule jobs and runs.',
242
+
'- Load `notifications` when the user should be notified about important events.',
243
+
'- Load `manager-settings` when reading or safely updating UI preferences.',
244
+
].join('\n')
245
+
}
246
+
218
247
functionbuildAssistantAgentPrompt(): string{
219
248
return[
220
249
'You are the default Assistant Mode agent for OpenCode Manager.',
@@ -229,6 +258,8 @@ function buildAssistantAgentPrompt(): string {
229
258
'',
230
259
'Preserve user-customized workspace files unless the user explicitly asks you to change them. Ask before making significant, destructive, or out-of-workspace changes.',
231
260
'',
261
+
'After editing `.opencode/agents/assistant.md`, load `manager-settings` and call `POST /assistant/reload` to apply changes. Always ask the user before reloading.',
- \`tts\` — Non-secret TTS preferences (\`enabled\`, \`provider\`, \`autoPlay\`, \`voice\`, \`model\`, \`speed\`). TTS must already be configured in the UI (the endpoint returns 400 otherwise).
572
+
- \`stt\` — Non-secret STT preferences (\`enabled\`, \`provider\`, \`model\`, \`language\`). STT must already be configured in the UI (the endpoint returns 400 otherwise).
562
573
563
574
**DO NOT attempt to set:**
564
575
- \`gitCredentials\` - Git credentials must be managed via the full UI
565
576
- \`gitIdentity\` - Git identity must be managed via the full UI
566
577
- \`tts.apiKey\` - TTS credentials must be managed via the full UI
578
+
- \`tts.endpoint\` - TTS endpoint must be managed via the full UI
567
579
- \`stt.apiKey\` - STT credentials must be managed via the full UI
580
+
- \`stt.endpoint\` - STT endpoint must be managed via the full UI
568
581
- \`lastKnownGoodConfig\` - Internal state, do not modify
Returns the updated settings object with the same structure as GET.
584
597
598
+
### POST /assistant/reload
599
+
600
+
Reload the assistant workspace by disposing the current OpenCode instance. Use this after editing \`.opencode/agents/assistant.md\` or \`opencode.json\` so changes take effect on the next message.
601
+
602
+
**Note:** Always confirm with the user before reloading, as it re-bootstraps the workspace.
603
+
604
+
**Rate Limiting:** 5 requests per minute per token. Returns \`429 Too Many Requests\` with \`Retry-After\` header when exceeded.
605
+
606
+
**Example:**
607
+
\`\`\`bash
608
+
curl -X POST -H "Authorization: Bearer <token>" \\
609
+
"${internalBaseUrl}/assistant/reload"
610
+
\`\`\`
611
+
612
+
**Response:**
613
+
\`\`\`ts
614
+
{ "success": true }
615
+
\`\`\`
616
+
585
617
## Safety
586
618
587
619
- This API intentionally rejects any attempt to modify credentials, API keys, or other sensitive settings
0 commit comments