feat(chat): per-chat permission modes for Claude, Codex and OpenCode

This commit is contained in:
2026-10-24 18:16:10 +01:00
parent ef575898f2
commit 6d430948a6
29 changed files with 1512 additions and 3 deletions
+5
View File
@@ -45,6 +45,8 @@ type Chat struct {
mu sync.Mutex
usageMu sync.Mutex
usageModels map[string]usageModelCache
modeMu sync.Mutex
agents map[string]string
}
// NewChat brokers chat for one owned OpenCode endpoint. The connection must be
@@ -131,6 +133,9 @@ func (c *Chat) PromptWithMessageIDFiles(ctx context.Context, id, text, messageID
if messageID != "" {
body["id"] = messageID
}
if agent := c.agentFor(id); agent != "" {
body["agent"] = agent
}
if len(files) > 0 {
attachments := make([]map[string]string, 0, len(files))
for _, file := range files {