File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -542,8 +542,12 @@ export const make = Effect.gen(function* () {
542542 // Publishes the active threads once. Returns why it did not, so the retry
543543 // knows whether it is waiting on a link or on the publish setting.
544544 const publishActiveThreadsUnsafe = Effect . gen ( function * ( ) {
545- const relayConfig = yield * readRelayConfig . pipe ( Effect . orElseSucceed ( ( ) => null ) ) ;
546- if ( ! relayConfig ) {
545+ // One secret read settles the common never-linked case; the full link
546+ // config is read only once publishing is on.
547+ const relayUrl = yield * readSecretString ( RELAY_URL_SECRET ) . pipe (
548+ Effect . orElseSucceed ( ( ) => null ) ,
549+ ) ;
550+ if ( ! relayUrl ) {
547551 yield * Effect . logDebug ( "agent activity snapshot skipped; relay link credentials unavailable" ) ;
548552 return "unlinked" as const ;
549553 }
@@ -554,6 +558,11 @@ export const make = Effect.gen(function* () {
554558 yield * Effect . logDebug ( "agent activity snapshot skipped; publication disabled" ) ;
555559 return "disabled" as const ;
556560 }
561+ const relayConfig = yield * readRelayConfig . pipe ( Effect . orElseSucceed ( ( ) => null ) ) ;
562+ if ( ! relayConfig ) {
563+ yield * Effect . logDebug ( "agent activity snapshot skipped; relay link credentials unavailable" ) ;
564+ return "unlinked" as const ;
565+ }
557566 const environmentId = yield * serverEnvironment . getEnvironmentId ;
558567 const snapshot = yield * snapshotQuery . getShellSnapshot ( ) ;
559568 const activeThreadIds = resolveAgentAwarenessRelayActiveThreadIds ( {
You can’t perform that action at this time.
0 commit comments