Skip to content

fix: agent scoping — shared layer, create endpoints, orphaned resource migration#793

Merged
chubes4 merged 2 commits intomainfrom
fix/agent-scoping-and-shared-layer
Mar 13, 2026
Merged

fix: agent scoping — shared layer, create endpoints, orphaned resource migration#793
chubes4 merged 2 commits intomainfrom
fix/agent-scoping-and-shared-layer

Conversation

@chubes4
Copy link
Member

@chubes4 chubes4 commented Mar 13, 2026

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 dirs
  • Each file tagged with layer field (shared, agent, user)
  • resolveFilePath() checks shared directory so SITE.md can be read/edited
  • REST endpoints now forward agent_id from request to abilities (was only passing user_id)
  • UI groups files into Site / Agent / User sections with header labels
  • Shared files shown without delete button (read-only in sidebar)

Pipeline & flow creation — agent_id scoping:

  • Pipelines::handle_create_pipeline() now passes agent_id from interceptor to ability
  • Flows::handle_create_flow() same fix
  • Front-end createPipeline() and createFlow() include agent_id from store in POST body
  • Without this, new resources created while an agent was selected got agent_id=NULL and became invisible

Commit 2: Migration for orphaned resources

  • New datamachine_assign_orphaned_resources_to_sole_agent() migration
  • On single-agent installs, assigns all pipelines/flows/jobs with agent_id IS NULL to the sole agent
  • The existing datamachine_backfill_agent_ids only handles user_id > 0 — this covers user_id = 0 (resources created before agent scoping)
  • Idempotent, skipped on multi-agent installs (>1 agent)

chubes4 added 2 commits March 13, 2026 16:43
…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.
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

Homeboy Results — data-machine

Lint

⚡ Scope: changed files only

lint (changed files only)

Test

⚡ Scope: changed files only

test (changed files only)

Audit

⚡ Scope: changed files only

audit (changed files only)

Tooling versions
  • Homeboy CLI: homeboy 0.74.1+78893e61
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

Homeboy Action v1

@chubes4 chubes4 merged commit f9df831 into main Mar 13, 2026
3 checks passed
@chubes4 chubes4 deleted the fix/agent-scoping-and-shared-layer branch March 13, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant