fix(macos): prefer linked channel in health summaries
This commit is contained in:
@@ -27,6 +27,7 @@ Docs: https://docs.clawd.bot
|
|||||||
- Control UI: resolve local avatar URLs with basePath across injection + identity RPC. (#1457) Thanks @dlauer.
|
- Control UI: resolve local avatar URLs with basePath across injection + identity RPC. (#1457) Thanks @dlauer.
|
||||||
- Agents: surface concrete API error details instead of generic AI service errors.
|
- Agents: surface concrete API error details instead of generic AI service errors.
|
||||||
- Docs: fix gog auth services example to include docs scope. (#1454) Thanks @zerone0x.
|
- Docs: fix gog auth services example to include docs scope. (#1454) Thanks @zerone0x.
|
||||||
|
- macOS: prefer linked channels in gateway summary to avoid false “not linked” status.
|
||||||
|
|
||||||
## 2026.1.21-2
|
## 2026.1.21-2
|
||||||
|
|
||||||
|
|||||||
@@ -242,13 +242,12 @@ final class GatewayProcessManager {
|
|||||||
private func describe(details instance: String?, port: Int, snap: HealthSnapshot?) -> String {
|
private func describe(details instance: String?, port: Int, snap: HealthSnapshot?) -> String {
|
||||||
let instanceText = instance ?? "pid unknown"
|
let instanceText = instance ?? "pid unknown"
|
||||||
if let snap {
|
if let snap {
|
||||||
let linkId = snap.channelOrder?.first(where: {
|
let order = snap.channelOrder ?? Array(snap.channels.keys)
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
let linkId = order.first(where: { snap.channels[$0]?.linked == true })
|
||||||
return false
|
?? order.first(where: { snap.channels[$0]?.linked != nil })
|
||||||
}) ?? snap.channels.keys.first(where: {
|
guard let linkId else {
|
||||||
if let summary = snap.channels[$0] { return summary.linked != nil }
|
return "port \(port), health probe succeeded, \(instanceText)"
|
||||||
return false
|
}
|
||||||
})
|
|
||||||
let linked = linkId.flatMap { snap.channels[$0]?.linked } ?? false
|
let linked = linkId.flatMap { snap.channels[$0]?.linked } ?? false
|
||||||
let authAge = linkId.flatMap { snap.channels[$0]?.authAgeMs }.flatMap(msToAge) ?? "unknown age"
|
let authAge = linkId.flatMap { snap.channels[$0]?.authAgeMs }.flatMap(msToAge) ?? "unknown age"
|
||||||
let label =
|
let label =
|
||||||
|
|||||||
@@ -166,6 +166,11 @@ final class HealthStore {
|
|||||||
_ snap: HealthSnapshot) -> (id: String, summary: HealthSnapshot.ChannelSummary)?
|
_ snap: HealthSnapshot) -> (id: String, summary: HealthSnapshot.ChannelSummary)?
|
||||||
{
|
{
|
||||||
let order = snap.channelOrder ?? Array(snap.channels.keys)
|
let order = snap.channelOrder ?? Array(snap.channels.keys)
|
||||||
|
for id in order {
|
||||||
|
if let summary = snap.channels[id], summary.linked == true {
|
||||||
|
return (id: id, summary: summary)
|
||||||
|
}
|
||||||
|
}
|
||||||
for id in order {
|
for id in order {
|
||||||
if let summary = snap.channels[id], summary.linked != nil {
|
if let summary = snap.channels[id], summary.linked != nil {
|
||||||
return (id: id, summary: summary)
|
return (id: id, summary: summary)
|
||||||
|
|||||||
Reference in New Issue
Block a user