fix(RelayBarGlass): usage never loads — start polling from AppModel.init - #33
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
fix(RelayBarGlass): usage never loads — start polling from AppModel.init#33devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…arExtra label .onAppear Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…an't read usage (#34) * fix(RelayBarGlass): surface load/error states instead of a silent empty card Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * feat(setup): warn at sign-in when relay key can't read usage Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RelayBar (Glass) made zero network requests for its entire lifetime, so every tool tab was stuck on hardcoded seed values and fell into the "Not routed through Relay" state regardless of gateway/key/config (issue #32).
Root cause:
AppModel.start()— which creates the 5s poll timer and triggers the first fetch — was invoked from.onAppearon the MenuBarExtra label. Under.menuBarExtraStyle(.window)that label's.onAppearnever fires, sostart()was never called → no timer →refresh()/refreshSpend()/computeSpend()never ran → no HTTP request ever made. The failure was silent becauselastErroris only set on a fetch path that never executed.Fix: drive polling from the model instead of a view modifier.
AppModelis@MainActorand the@StateObjectis created on the main actor, sostart()(which schedules theTimeronRunLoop.mainand kicks off detached fetch tasks) runs safely frominit.Scope / not included
This fixes the confirmed root cause (no polling → no data). The reporter's separate "still open" note about an empty Claude Code tab after polling works is not addressed here — it was never reproduced from code (network, JSON decode, SwiftUI observation, and tool attribution were all ruled out) and needs live macOS observation to diagnose.
Validation
This is a macOS-only SwiftUI/AppKit menu bar app (
MenuBarExtra,.menuBarExtraStyle(.window)); it cannot be built or run on the Linux CI/dev box (no Swift/Xcode toolchain). The change matches the diagnosis and fix in issue #32, whose author verified on macOS: before fix 0 network requests from the process; after fix 12 successfulHTTP 200gateway responses in 30s.Link to Devin session: https://app.devin.ai/sessions/77a9c75c205e4dbba85ee512c814bbe4
Requested by: @ishaan-berri