Observe native Claude automations and preserve pending timers
This commit is contained in:
@@ -62,6 +62,7 @@ type process struct {
|
||||
models []protocol.ChatModel
|
||||
account accountIdentity
|
||||
appliedModel string
|
||||
automations *claudehost.AutomationSnapshot
|
||||
}
|
||||
|
||||
func newProcess(s *session, mode string) *process {
|
||||
@@ -192,7 +193,12 @@ func (s *session) startDirect(args []string, mode string, env []string) (*proces
|
||||
}
|
||||
|
||||
func (p *process) initialize(ctx context.Context) ([]protocol.ChatModel, accountIdentity, error) {
|
||||
raw, err := p.request(ctx, "initialize", map[string]any{"subtype": "initialize"})
|
||||
raw, err := p.request(ctx, "initialize", map[string]any{
|
||||
"hooks": map[string]any{"Stop": []any{map[string]any{
|
||||
"hookCallbackIds": []string{claudehost.NativeAutomationCallbackID},
|
||||
"timeout": 5, "onFailure": "continue",
|
||||
}}},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, accountIdentity{}, fmt.Errorf("initialize Claude Code: %w%s", err, p.diagnostic())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user