Repository navigation
fix(mobile): list the same owned agents as desktop #8857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(mobile): keep own agents mentionable until the list is known
While the owned-agent directory was loading, failed, or the session was offline, mention completion treated it as an empty list, so the user's own listed agents counted as unlisted. They disappeared from the picker, and a restored draft that mentioned one was rejected. The directory now stays loading while the session is not connected, and mention completion takes it as unknown (null) until it loads. While it is unknown, no owned agent is held back as unlisted. Signed-off-by: Tom Brow <[email protected]>
- Loading branch information
commit 02b56f671fe8d7240187dea66b11a4536ada9175
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocker: an unknown owned directory is treated as "no listed agents".
Every caller passes
ownedAgentDirectoryProvider.asData?.value ?? const [](compose_bar_widget.dart,mention_candidates_provider.dart).ownedAgentDirectoryProvideralso returns[]as data whenever the session isn't connected. So during first load,AsyncError, disconnects and reconnects,listedOwnedis empty, and this predicate drops every own non-member agent from the directory and search passes. Before this PR those agents were admitted from search.Impact:
Fix: pass
ownedAgentsas nullable and skip the unlisted filter when it is unknown (or block with a loading/retry message). Make the provider stay loading, or throw, when disconnected instead of returning[]as data.Test gap: the compose-bar tests never override
ownedAgentDirectoryProvider, so the new unlisted-own-agent row passes because the directory is empty, not because the agent is unlisted. Add a table row where a listed own agent is admitted, alongside the unlisted one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Fixed in 02b56f6. I also corrected the
buildMentionCandidatesdoc sentence and theagents_page.dartcomment, and the PR body now says that every remote agent with a verified owner profile here stays listed.buildMentionCandidatesnow takesownedAgentsas nullable. Null means the list is unknown, and then no owned agent is held back as unlisted (and none are offered unprompted). Both callers passownedAgentDirectoryProvider.asData?.value, which is null while loading and after an error (a reload keeps the previous list).ownedAgentDirectoryProviderstays loading while the session isn't connected instead of returning[]as data, and loads once the session connects.ownedAgentDirectoryProvider, with a listed own non-member agent that's admitted (it gets the usual "not in this channel" prompt), an unlisted one that's rejected against a known list, and one that's admitted while the list is still unknown. Also added a candidates case for an unknown list and a provider test that stays loading until connected. Each new guard test fails with the fix reverted.