Skip to content

fix(workflows): offer company assets in the workflow asset pickers - #56

Merged
artempartos merged 1 commit into
developfrom
fix/workflow-asset-picker-company-scope
Aug 7, 2026
Merged

artempartos merged 1 commit into
developfrom
fix/workflow-asset-picker-company-scope

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

The bug

A company-scoped asset never appeared in the workflow builder's asset picker, so it could not be attached to a workflow step — even though every other surface offers it and the step would happily mount it.

Both actions read assets through the project's has_many, which by definition only sees project-owned rows:

current_project.assets.active        # project rows only

Every other asset call site in the app already spans project + company: the assets page, the session form, the Aixle Builder, share_asset, list_assets, the assets API. So do the pickers sitting right next to this one in the same method — Agent, Tool, Skill, MCPServer and Repository all resolve through visible_for_project. Assets were the single call site reaching around the model.

Asset.accessible_from_project(current_project)

Why it stayed hidden

Nothing downstream objects to a company asset, which is what made this look like "the project has no assets" rather than a bug:

  • SessionService#scoped_resources filters through Asset.visible_for_project, which includes company rows
  • WorkspacePreparator mounts by id with no scope check

So the asset was mountable the whole time — it just could not be chosen. Setting it via the MCP server worked.

Testing

Three integration tests, all through a real Inertia partial reload, since these are deferred props and a plain GET omits the key entirely:

  • builder offers project and company assets
  • index offers project and company assets
  • builder does not offer another company's assets — a guard so the fix widens visibility to the company and no further

Verified they fail against the old scope (Expected ["asset-1.md"] to include "asset-2.md") and pass with the new one. The third passes either way by design — it exists to catch over-broadening.

make check_all green: 4012 backend tests, eslint, tsc, vitest, rubocop, brakeman, system tests.

Note for the reviewer

Asset.accessible_from_project and Asset.visible_for_project are defined separately but resolve to the same thing (active rows, project OR company). Worth collapsing one day; left alone here to keep this a one-line behavior fix.

🤖 Generated with Claude Code

Every other surface that lists assets — the assets page, the session form,
the Aixle Builder, share_asset, list_assets — reads them through
`Asset.accessible_from_project`, which spans the project and its company.
The workflow index and builder instead walked `current_project.assets`, a
has_many that only sees project-owned rows, so a company asset was absent
from the one picker that puts an asset on a workflow step.

Nothing downstream objected to those assets, which is what made the gap easy
to miss: `SessionService#scoped_resources` filters through
`Asset.visible_for_project`, which includes company rows, and
WorkspacePreparator mounts by id. The asset was mountable all along and just
could not be chosen.

The pickers beside it (agents, tools, skills, MCP servers, repositories) all
already resolve through a model scope; assets were the one call site reaching
around it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 2378012 into develop Aug 7, 2026
7 checks passed
alex-astafyev pushed a commit to alex-astafyev/flow that referenced this pull request Aug 19, 2026
* origin/develop:
  feat(personal-mcp): add connector catalog and registry-read tools (AixleHQ#55)
  fix(workflows): offer company assets in the workflow asset pickers (AixleHQ#56)
  feat(mcp): add sub-step update, delete and reorder tools (AixleHQ#54)
  feat(workflows): pick repositories and assets on a workflow step (AixleHQ#53)
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