Expose session-owned chat automation metadata
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user