Repository navigation
Conversation
- Introduced a new document outlining the design for Sage Agents interacting with wallets via the Model Context Protocol (MCP). - Implemented the AgentSettings component to manage agent server settings, including adding, editing, and revoking agents. - Integrated capabilities management for agents, allowing users to specify wallet scopes and capabilities. - Added UI elements for displaying agent status, capabilities, and token management. - Established a polling mechanism to keep agent server status updated in real-time.
- Added `AgentPermissionsPanel` component to manage agent capabilities and wallet scopes using `PermissionEditor` and `WalletScopeEditor`. - Updated `tailwind.config.js` to include paths for `sage-app-ui` components. - Created a new schema file for OpenAPI definitions in Rust. - Developed tests for the new `AgentPermissionsPanel` and related functionalities. - Defined utility functions for handling agent permissions and wallet scopes in `agentPermissions.ts`. - Documented the implementation plan and design specifications for the agent permissions UI.
- Introduced a mechanism to drop deleted wallets from agents' scopes, ensuring that agents only retain access to existing wallets. - Enhanced error reporting for agent server startup failures, providing clearer feedback on why the server could not start. - Updated the agent settings UI to display error messages related to agent server startup issues. - Refactored bridge methods to utilize a new `sage` method for accessing wallet state, improving code clarity and reducing redundancy. - Added tests to verify the correct behavior of wallet retention logic and agent capabilities. - Improved pluralization in UI messages for better user experience.
…base - Take the data directory lock before reporting an apps database failure, so a second instance reports "already running" instead of offering to delete the live database - Take the lock again in reset_apps_database before deleting any files - Don't offer the reset when a newer version of Sage migrated the database, since installing that version again recovers the apps and agents - Test that the agents migration keeps settings in an existing database
- Run agent tool calls straight from the catalog tool, without a JSON round trip, a second lookup by method name, or an allowlist of error codes - Test the authorization of agent calls, including a method missing from the registry - Prune deleted wallets from agent scopes without overwriting a newer edit - Test that secret and signing grants expose no tools, and the exact Host header checks - Test the app caller's wallet scope in the bridge context - Move the port check and client snippets into agentPermissions and test them - Test that the apps database reset needs a second confirmation - Reuse SettingsSection and the warning Alert in the agent settings - Drop the unused http dependency and showMoreLabel prop, and the implementation plans
- Keep the apps database reset out of mobile builds, which have no sage-apps crate - Test which apps database failures offer the reset - Authorize agent calls in one place, and share the watch-only check with apps - Return the pruned agents from retain_agent_wallets instead of listing them twice - Share the server status indicator between the RPC and agent settings - Keep the agent dialog's wallets as WalletInfo, null until loaded
…eal check - Check grants and wallet scope in call_tool, with the current wallet from the executor, before the executor runs; the bridge still checks again when it runs the method - Test that switching to a wallet outside an agent's scope, or logging out, refuses calls - Compute the dialog's loaded wallets once
Collaborator
Author
|
These commits were pushed onto #1005's branch instead, so the review fixes land in that PR. The description above still lists what they change and the decisions to confirm. |
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.
Follow-up to #1005 (Sage Agents over MCP, stage 1). That PR is from a fork, so this branch continues from its head (111d90b) and adds review fixes on top. It includes #1005's commits, so merging this one also lands #1005.
What changed
Apps database reset
reset_apps_databasetakes the lock again before it deletes anything.VersionMissing) is shown as a plain startup error, with no delete offered.cfg(not(mobile)), sincesage-appsisn't a dependency on Android and iOS. Without the gate, the mobile builds didn't compile.Agent call path
authorize_agent_call. It runs at the MCP boundary incall_tool, so the server tests cover the real check, and again inprocess_agent.tools.sage()checks the scope a third time while it holds the Sage lock.process_agenttakes the catalog tool directly and returns aValue. This removes the JSON string round trip, the second lookup by method name and the allowlist of error codes, which turned unlisted codes intointernal_error.ensure_can_sign) that apps and agents share.Agents database
apps_list_agentsreads the table once per poll instead of twice.UI
SettingsSection, the warningAlertand aServerStatusIndicatorshared with the RPC settings.src/lib/agentPermissions.ts, with tests.showMoreLabelprop fromPermissionEditor.Cleanup
httpdependency.docs/superpowers/plans/.New tests
Sage::lock_data_dir.StartupError.Decisions to confirm
newer_versionbranch inAppsDbFailure.docs/superpowers/: the plans were removed and the two design specs kept. The alternatives are to drop the specs too, or to move the MCP design spec to something likedocs/agents-design.md.Known gaps
wallet.getXchUsdPriceholds the Sage lock for the whole CoinGecko request, up to 10s. Main already does this for webview apps and for the Sage UI's own command, so the fix belongs in the shared endpoint layer.Checks
These all pass:
pnpm prettier:check,pnpm lint,pnpm exec tsc -bandpnpm test:unit.cargo clippy --workspace --all-features --all-targets -- -D warnings,cargo fmt --check,cargo test --workspace --all-featuresandcargo machete.pnpm build.pnpm generate:bindingsandpnpm generate:app-docsleave the tree unchanged.The next release needs
pnpm extract, since this adds new Lingui strings.