Conversation
…oints, add layer grouping Three interconnected fixes for multi-agent scoping: 1. Memory tab now shows all three file layers (Site/Agent/User) with section headers. SITE.md from the shared layer was completely invisible before. Files tagged with 'layer' field from the API. Shared files shown read-only. 2. REST endpoints for agent files now forward agent_id from the request to the abilities layer — was only passing user_id, causing wrong directory resolution when an agent was selected. 3. Pipeline and flow creation endpoints now carry agent_id from the agent interceptor (query param) or body params to the abilities layer. Front-end createPipeline/createFlow also include agent_id from the store. Without this, new pipelines/flows created while an agent was selected would get agent_id=NULL and become invisible to that agent.
On single-agent installs, pipelines/flows/jobs created before agent scoping have user_id=0 and agent_id=NULL. The existing backfill_agent_ids migration only handles user_id > 0 (it maps user → agent via owner_id). New migration: when exactly 1 agent exists, assign all resources with agent_id IS NULL to that agent. Idempotent, skipped on multi-agent installs.
Homeboy Results —
|
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
Fixes three gaps in multi-agent scoping that left the Agents admin page partially non-functional.
Commit 1: Shared layer in Memory tab + agent_id in create endpoints + layer grouping
Memory tab — shared layer (SITE.md):
AgentFileAbilities::executeListAgentFiles()now scans the shared directory in addition to agent and user dirslayerfield (shared,agent,user)resolveFilePath()checks shared directory so SITE.md can be read/editedagent_idfrom request to abilities (was only passinguser_id)Pipeline & flow creation — agent_id scoping:
Pipelines::handle_create_pipeline()now passesagent_idfrom interceptor to abilityFlows::handle_create_flow()same fixcreatePipeline()andcreateFlow()includeagent_idfrom store in POST bodyagent_id=NULLand became invisibleCommit 2: Migration for orphaned resources
datamachine_assign_orphaned_resources_to_sole_agent()migrationagent_id IS NULLto the sole agentdatamachine_backfill_agent_idsonly handlesuser_id > 0— this coversuser_id = 0(resources created before agent scoping)