File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,12 @@ func (b *Bot) triggerDiagnostics(service, channelID string) error {
374374 ctx , cancel := context .WithTimeout (context .Background (), 60 * time .Second )
375375 defer cancel ()
376376
377+ if b .config .APIKey != "" {
378+ if err := b .trySyncConfig (ctx ); err != nil {
379+ return fmt .Errorf ("failed to sync config to agent-core before diagnostics: %w" , err )
380+ }
381+ }
382+
377383 payload := map [string ]string {
378384 "service" : service ,
379385 }
@@ -786,6 +792,12 @@ func (b *Bot) buildPonosConfigPayload() map[string]any {
786792}
787793
788794func (b * Bot ) trySyncConfig (ctx context.Context ) error {
795+ if updated , err := config .Load (); err == nil {
796+ b .config = updated
797+ } else {
798+ b .logger .Warn ("Failed to reload ponos config before sync" , "error" , err )
799+ }
800+
789801 requestData := map [string ]any {
790802 "message" : "Configuration sync" ,
791803 "ponos_config" : b .buildPonosConfigPayload (),
You can’t perform that action at this time.
0 commit comments