Expose session-owned chat automation metadata

This commit is contained in:
2026-11-08 15:24:23 +00:00
parent cecfa39aac
commit 9d3358be47
12 changed files with 413 additions and 0 deletions
+15
View File
@@ -332,6 +332,21 @@ func (m *chatManager) brokerFor(ctx context.Context, sessionID string) (chatBrok
return adapter, nil
}
// Automations routes the optional readback capability without adding it to the
// base broker contract. The session's registry-selected provider remains the
// ownership boundary; no provider-wide or cwd-wide schedule list is consulted.
func (m *chatManager) Automations(ctx context.Context, sessionID string) (protocol.ChatAutomationInfo, error) {
adapter, err := m.brokerFor(ctx, sessionID)
if err != nil {
return protocol.ChatAutomationInfo{SessionID: sessionID, Status: protocol.ChatAutomationUnavailable, Reason: err.Error()}, nil
}
reader, ok := adapter.(chatAutomationReader)
if !ok {
return protocol.ChatAutomationInfo{SessionID: sessionID, Provider: m.backendFor(ctx, sessionID), Status: protocol.ChatAutomationUnavailable, Reason: "this chat provider has no authoritative scheduled-work read API"}, nil
}
return reader.Automations(ctx, sessionID)
}
// chatTitleSetter is a harness that names its own sessions from the operator's
// chat title (Claude Code passes it as --name on the next spawn). SetTitle
// records the title in memory only and does no I/O.