Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical security flaws allow approvals under the wrong account, expose private request data in logs, and permit guidance delivery after revocation or redaction.
20 open issues
Redact MCP and OAuth request payloads from logs · New Bound concurrent learning commands and reject excess requests · New Run hosted learning commands under the execution lock · New Bind approval confirmation to the session that loaded the page · New Show and warn about the agent callback destination before approval · New Recheck connection and repository authority before releasing results · New Proxy MCP and OAuth routes in Vite development and preview · New Hide setup for repositories that cannot support agent connections · New Cover refresh-token rotation and failed code exchanges · New Audit successful OAuth token revocations · New Propagate command infrastructure failures to MCP error handling · New Pass session values as explicit CLI option assignments · New Pass task prompts through a private temporary file · New Filter connections by current provider and revocation revisions · New Authorize agents using Learnings access rules across providers · New Cover the successful OAuth-to-learning flow with integration tests · New Include durable agent targets in approval and revocation audits · New Prevent Storybook forms from submitting to the host · New Add required timestamps to the new agent models · New Move the OAuth provider adapter into its own function module · New
1 file not reviewed
hub/package-lock.json: Generated file
What changed in this PR
Lets coding agents read accepted learnings directly from Hub through the Model Context Protocol (MCP), using browser-approved connections instead of copying learning stores.
Changes:
- Adds OAuth approval, token refresh, revocation, and repository-authorized MCP access.
- Replaces the agent-connections prototype with connected-agent management and approval pages.
- Adds purpose-specific CLI reads, integration tests, stories, and documentation.
| File | Description |
|---|---|
packages/learning/test/cli.test.mjs |
Tests instruction-purpose withholding. |
packages/learning/src/mcp.mjs |
Exports host-compatible learning errors. |
packages/learning/src/cli.mjs |
Adds purpose selection to learning reads. |
packages/learning/README.md |
Documents purpose reads and host errors. |
packages/learning/mcp.d.mts |
Declares the learning-error export. |
hub/server/start-server-processes/index.ts |
Accepts agent-connection dependencies. |
hub/server/run-api/index.ts |
Passes connection dependencies into the app. |
hub/server/routes/types.ts |
Extends route dependencies. |
hub/server/routes/index.ts |
Mounts agent and MCP routes. |
hub/server/routes/api/security-audits/present-security-audit/index.ts |
Recognizes agent-connection audit actors. |
hub/server/routes/agent-connections/types.ts |
Defines hosted learning configuration. |
hub/server/routes/agent-connections/index.ts |
Implements connection management and MCP endpoints. |
hub/server/routes/agent-connections/index.db.test.ts |
Tests OAuth approval and browser revocation. |
hub/server/repositories/agent-connections/touch-agent-connection/index.ts |
Updates token activity and inactivity limits. |
hub/server/repositories/agent-connections/rotate-agent-connection/index.ts |
Atomically rotates token digests. |
hub/server/repositories/agent-connections/revoke-agent-connection/index.ts |
Revokes connections by token or owner. |
hub/server/repositories/agent-connections/record-agent-connection-audit/index.ts |
Persists connection security audits. |
hub/server/repositories/agent-connections/list-agent-connections/index.ts |
Lists a person's connections. |
hub/server/repositories/agent-connections/find-agent-repository/index.ts |
Finds supported GitHub-backed repositories. |
hub/server/repositories/agent-connections/create-agent-connection/index.ts |
Persists approved agent credentials. |
hub/server/repositories/agent-clients/find-agent-client/index.ts |
Retrieves registered OAuth clients. |
hub/server/repositories/agent-clients/create-agent-client/index.ts |
Stores OAuth client registration. |
hub/server/repositories/agent-authorizations/find-pending-agent-authorization/index.ts |
Retrieves pending approval requests. |
hub/server/repositories/agent-authorizations/find-agent-authorization-challenge/index.ts |
Retrieves authorization-code PKCE challenges. |
hub/server/repositories/agent-authorizations/decide-agent-authorization/index.ts |
Settles approval requests once. |
hub/server/repositories/agent-authorizations/create-agent-authorization/index.ts |
Creates requests and removes expired ones. |
hub/server/repositories/agent-authorizations/claim-agent-authorization/index.ts |
Atomically consumes approved codes. |
hub/server/integrations/mcp/require-agent-token/index.ts |
Enforces bearer authentication and advertises discovery. |
hub/server/integrations/mcp/handle-mcp-request/index.ts |
Handles stateless MCP HTTP requests. |
hub/server/integrations/mcp/handle-mcp-request/index.test.ts |
Tests transport with parsed request bodies. |
hub/server/integrations/mcp/create-agent-auth-router/index.ts |
Adapts Hub connections to OAuth endpoints. |
hub/server/integrations/learning/load-learning-mcp/index.ts |
Loads package-provided MCP tools dynamically. |
hub/server/integrations/learning/load-learning-mcp/index.test.ts |
Tests package loading and error compatibility. |
hub/server/integrations/express/canvas-sign-in-return/index.ts |
Allows returning to agent approval after sign-in. |
hub/server/index.ts |
Configures hosted agent connections at startup. |
hub/server/domains/agent-connections/create-learning-mcp-backend/index.ts |
Adapts learning tools to CLI operations. |
hub/server/domains/agent-connections/create-agent-connections/index.ts |
Implements connection and credential lifecycles. |
hub/server/create-app/index.ts |
Wires routes and protects browser endpoint payloads. |
hub/schema/migrations/20261223170000_agent_connections/migration.sql |
Creates OAuth and connection persistence tables. |
hub/schema/membership.prisma |
Relates memberships to agent connections. |
hub/schema/hub-session.prisma |
Relates sessions to authorization requests. |
hub/schema/external-identity.prisma |
Relates identities to agent connections. |
hub/schema/authentication-provider-revision.prisma |
Relates provider revisions to connections. |
hub/schema/agent-connection.prisma |
Defines connection credentials and authority references. |
hub/schema/agent-client.prisma |
Defines registered OAuth clients. |
hub/schema/agent-authorization.prisma |
Defines approval requests and one-time codes. |
hub/package.json |
Adds the MCP SDK dependency. |
hub/package-lock.json |
Locks MCP SDK dependencies. |
hub/docs/learning-foundation.md |
Documents hosted connections, access, and limitations. |
hub/client/pages/learnings-page/types.ts |
Adds the connection-page destination. |
hub/client/pages/learnings-page/styles.css |
Arranges Learnings header actions. |
hub/client/pages/learnings-page/stories.tsx |
Supplies connection navigation in stories. |
hub/client/pages/learnings-page/index.tsx |
Adds the Connect an agent action. |
hub/client/pages/agent-connections-prototype/types.ts |
Removes obsolete prototype data types. |
hub/client/pages/agent-connections-prototype/index.test.tsx |
Removes prototype-only interaction tests. |
hub/client/pages/agent-connections-page/types.ts |
Defines management and approval presentation data. |
hub/client/pages/agent-connections-page/styles.css |
Removes obsolete simulated-result styling. |
hub/client/pages/agent-connections-page/stories.tsx |
Updates connection and approval story states. |
hub/client/pages/agent-connections-page/index.tsx |
Renders approval and revocation forms. |
hub/client/pages/agent-connections-page/index.test.tsx |
Tests configuration copying and revocation confirmation. |
hub/client/application/hub/view-models/settings-learnings/index.ts |
Supplies the agent-management link. |
hub/client/application/hub/routes/real-workspace-navigation.test.tsx |
Tests approval return paths through sign-in. |
hub/client/application/hub/routes/product-routes.ts |
Registers repository agent-management navigation. |
hub/client/application/hub/routes/learning-agents/index.tsx |
Loads connections and submits revocations. |
hub/client/application/hub/routes/agent-approval/index.tsx |
Loads approval requests and submits decisions. |
hub/client/application/hub/routes.ts |
Registers the standalone approval route. |
hub/client/application/hub/agent-connections/contract.ts |
Validates connection API responses. |
hub/client/application/hub-application/index.tsx |
Adds agent-specific sign-in wording. |
Review effort: Max (adaptive)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
… routes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Agent commands now share the learning execution lock, so they cannot overlap with each other or with Learnings page work. Each command confirms the connection still has repository access before its answer is returned. Private task text goes through a temporary file instead of the process list. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
…ss goes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
…ocation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
…elf-revocation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
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.



Why
Learnings only help if the agents building prototypes can read them. Today an agent can get them only by running the
replica-learningcommand against its own copy of the data. This lets a person connect their coding agent straight to Hub, so it reads the learnings their team accepted there, without copying files or handing the agent a password.What changes
The Learnings page gets a Connect an agent button. It opens a page with a short MCP configuration to copy into the agent. The configuration holds only Hub's address for that repository, not a secret. The first time the agent calls Hub, it is told to sign in. It opens the browser to an approval page that names the agent, the signed-in person, and where access will be sent. Hub cannot confirm an agent's name, so the page warns when that address is not on the person's computer. If the person approves, the agent gets its own tokens. The same page lists the person's connected agents and lets them revoke any of them.
Hub now serves the learning MCP server that the learning package already provides. Hub loads the package's tools and instructions and supplies the data. An agent can read the repository's accepted learnings and report which ones it applied. Every call acts as the person who approved it, and Hub rechecks their sign-in and repository access each time. Signing out everywhere or losing access stops the agent too. Agent commands share the lock used by other learning work, so they run one at a time. Approving and revoking write security audits.
This removes the Agent connections prototype page; the real page replaces it. The package gains a
--purposeoption onmemoriesandshow, so Hub and the command read learnings the same way agents see them.Needs design review:
submit_sessionand screenshots inreport_usage. Screenshot consent comes in the next layer./authorizeand/token, as the MCP SDK expects.Storybook screenshots
These are every Agent connections story and every Learnings story that shows the new header button. Learning detail and access-denied stories don't show the header and are unchanged. The Agent connections prototype stories are removed with the prototype.
Hub/Pages/Learnings/Agent connections/ConnectedAgents (light, 1280×800)
Hub/Pages/Learnings/Agent connections/NoConnectedAgents (light, 1280×800)
Hub/Pages/Learnings/Agent connections/RevokeConfirmation (light, 1280×800)
Hub/Pages/Learnings/Agent connections/Revoked (light, 1280×800)
Hub/Pages/Learnings/Agent connections/ApprovalRequest (light, 1280×800)
Hub/Pages/Learnings/Agent connections/RemoteApprovalRequest (light, 1280×800)
Hub/Pages/Learnings/Agent connections/LocalRepository (light, 1280×800)
Hub/Pages/Learnings/Default (light, 1280×800)
Hub/Pages/Learnings/DecisionRuntimeNotConfigured (light, 1280×800)
Hub/Pages/Learnings/DecisionRuntimeUnavailable (light, 1280×800)
Hub/Pages/Learnings/RepositoryLearningAuthorityOnly (light, 1280×800)
Hub/Pages/Learnings/DecisionTrainingPaused (light, 1280×800)
Hub/Pages/Learnings/DecisionTrainingBlocked (light, 1280×800)
Hub/Pages/Learnings/DecisionTrainingQueued (light, 1280×800)
Hub/Pages/Learnings/DecisionTrainingPreparing (light, 1280×800)
Hub/Pages/Learnings/DecisionTrainingRunning (light, 1280×800)
Hub/Pages/Learnings/DecisionTrainingFailures (light, 1280×800)
Hub/Pages/Learnings/DecisionTrainingCancelled (light, 1280×800)
Hub/Pages/Learnings/DecisionCandidatePromoted (light, 1280×800)
Hub/Pages/Learnings/DecisionCandidatePromotedWithoutRollback (light, 1280×800)
Hub/Pages/Learnings/DecisionCandidateRolledBack (light, 1280×800)
Hub/Pages/Learnings/DecisionCandidateRejected (light, 1280×800)
Hub/Pages/Learnings/LegacyBuildEvaluation (light, 1280×800)
Hub/Pages/Learnings/RemovedLearningText (light, 1280×800)
Hub/Pages/Learnings/RuntimeDeletionPending (light, 1280×800)
Hub/Pages/Learnings/ManyLearnings (light, 1280×800)
Hub/Pages/Learnings/EmptyStatus (light, 1280×800)
Hub/Pages/Learnings/NoSearchResults (light, 1280×800)
Hub/Pages/Learnings/FirstVisit (light, 1280×800)
Hub/Pages/Learnings/FailedLearningRun (light, 1280×800)
Hub/Pages/Learnings/IdentityRevalidation (light, 1280×800)
Hub/Pages/Learnings/ReadableMember (light, 1280×800)
Hub/Pages/Learnings/CopilotRefused (light, 1280×800)
Hub/Pages/Learnings/Running (light, 1280×800)
Hub/Pages/Learnings/DailyRunWaiting (light, 1280×800)
Hub/Pages/Learnings/FailedRun (light, 1280×800)
Hub/Pages/Learnings/LoadError (light, 1280×800)
Hub/Pages/Learnings/RedactionFollowUp (light, 1280×800)