Skip to content

feat(runs): submit as yourself or as the project's team - #2943

Merged
camielvs merged 3 commits into
cvs/pick-team-secretsfrom
cvs/submit-as-team
Oct 31, 2026
Merged

camielvs merged 3 commits into
cvs/pick-team-secretsfrom
cvs/submit-as-team

Conversation

@camielvs

@camielvs camielvs commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A run uses the secrets of whoever submits it, so in a team's project it can go as you or as the project's team. It goes as you by default, and as the team when that's chosen or needed:

The run's secrets It goes as
None, or all in your secrets You. The arguments dialog's Run as control can pick the team.
Some only the team has, the rest in both The team, forced. "You" is disabled, and the dialog names the secrets that force it.
Some only yours, others only the team's Neither works. The dialog says which are where.
Some in neither Whoever is chosen, with the missing secrets named.

runIdentity applies that rule, and useRunIdentity lists your secrets and the team's to feed it. The editor's Submit Run button, the arguments dialog and a project's Run pipeline button all follow it. They send the team header only when the run goes as the team, and write the run's notes and tags as whoever submitted it, since the backend only lets a run's creator annotate it.

The UI says who a run goes as before you submit:

  • Submit Run reads "Submit Run as {workspace}" only when the run goes as the team. It opens the arguments dialog instead of submitting when the run would fall back to you (you're not in the team, the team can't be acted as, or the team couldn't be checked), when a secret is missing for whoever it goes as, or when its secrets are split.
  • The arguments dialog shows the Run as control when the team is active, and "Runs as you" with the reason otherwise. A choice holds for the team it was made for, so switching the dialog to a project in another workspace starts from that workspace's default. The run goes as whoever the dialog shows, including You on a page that would go as the team. Missing secrets are named in bold after a lock icon, with who has them, as in "API_KEY isn't in your secrets; the Search workspace has it". They warn rather than block, because the list can lag behind a secret added elsewhere.
  • The secret picker, opened from the dialog, starts its Save to choice (feat(secrets): pick a team's secrets #2942) on whoever the run goes as.
  • The v2 editor's Quick Run ▶ button clicks a hidden Submit Run button, so the "as {team}" suffix never shows there. It carries a badge with the workspace icon instead whenever the run goes as the team, and its tooltip reads "Submit run as the {workspace} workspace". The badge is left off when the pipeline has errors, and the tooltip keeps a validation warning when there is one. While the hidden button waits for the team or the secrets check, or refuses projects in different workspaces, ▶ is disabled too, and its tooltip says what it's waiting for.

Agents in Tangent's editor and run view submit through the tool bridge, which follows the same rule. submit_pipeline_run goes as the user unless it's asked to act as the team (asTeam) or a team-only secret forces it, and it decides with the same runAsFor as the UI. Its result's actingAsWorkspace names the workspace it went as, and actingAsTeam is that workspace's team id. It refuses asTeam when the user can't act as the team, and refuses a run whose secrets are split unless asTeam is set. While the team is resolving, or for projects on different teams, the submission is refused with the reason. The tool's description and results call the team the workspace, as the UI does.

Submit waits while the team resolves and while the secrets are checked. It's refused for projects on different teams. The arguments button stays available in that case, so another project can be chosen for the run.

Related Issue and Pull requests

Type of Change

  • New feature

Line Breakdown

Category Added Removed
Production code 824 35
Tests 1584 8
Config / CI / tooling 1 0
Total 2409 43

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

None yet.

Test Instructions

pnpm vitest run src/components/shared/Submitters src/components/Project src/components/shared/SecretsManagement src/services/teams src/routes/v2/pages/Editor/components/EditorMenuBar src/routes/v2/shared/components/AiChat/toolBridge src/agent/tools

With the same setup as #2941, plus a secret of your own and one of the team's:

  1. Submit a pipeline that uses no secrets, or only yours, from a team's project. It goes as you. In the arguments dialog, choose Workspace: {workspace}, and the run's "Created by" is the team's id instead. Choose the workspace, then switch the dialog's project to one in another workspace: Run as goes back to that workspace's default.
  2. Submit a pipeline that uses the team's secret. The button reads "Submit Run as {workspace}", and the run's "Created by" is the team's id. In the arguments dialog, "You" is disabled, with the reason.
  3. Submit a pipeline that uses one secret of each. Submit Run opens the dialog, which says which secret is where.
  4. Submit from a project whose team you're not in. The arguments dialog opens with "Runs as you" and a warning. Submitting from there runs as you.
  5. Ask the Tangent agent to submit a pipeline that uses the team's secret. The run's "Created by" is the team's id, and the secret resolves. One that uses only your secret goes as you.
  6. Submit outside any project. It behaves as on master.
  7. Open a pipeline that uses the team's secret in the v2 editor. The Quick Run ▶ button has the workspace badge, and its tooltip names the workspace.

Additional Comments

  • TangleSubmitter, QuickRunButton and SubmitTaskArgumentsDialog had no tests. They now have tests for the team cases.
  • useRunIdentity is added to react-compiler.config.js, since it walks the whole pipeline spec for secret references.

🤖 Generated with Claude Code

@camielvs
camielvs added this pull request to stack #2930 October 22, 2026 22:34
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: cvs/submit-as-team/6888d85

@camielvs
camielvs force-pushed the cvs/submit-as-team branch 2 times, most recently from 1dbed14 to b5b9cef Compare October 28, 2026 23:11
@camielvs camielvs mentioned this pull request Oct 29, 2026
1 of 3 tasks
@camielvs camielvs changed the title feat(runs): submit as the project's team feat(runs): submit as yourself or as the project's team Oct 29, 2026
@camielvs camielvs mentioned this pull request Oct 30, 2026
1 of 3 tasks
@camielvs camielvs mentioned this pull request Oct 30, 2026
1 of 3 tasks
@camielvs
camielvs marked this pull request as ready for review October 30, 2026 21:23
@camielvs
camielvs requested a review from a team as a code owner October 30, 2026 21:23
A run uses the secrets of whoever submits it, so in a team's project it
can go as you or as the project's team. It goes as you by default, and
as the team when that's chosen or needed:

- With no secrets, or only secrets you have, a run goes as you. The
  arguments dialog's Run as control can pick the team. A choice holds
  for the team it was made for, so switching the dialog to a project on
  another team starts from that team's default.
- When it needs secrets only the team has, it goes as the team, and the
  control says which secrets force it.
- When some secrets are only yours and others only the team's, neither
  works, and the dialog says which are where.

runIdentity checks the run's secrets against your list and the team's.
`useRunIdentity` is compiled by the React Compiler, since it walks the
whole pipeline spec for secret references.
The submit button, the arguments dialog and a project's Run pipeline
button all follow it. They send the team header when the run goes as
the team, and write the run's notes and tags as whoever submitted it,
since the backend only lets a run's creator annotate it. The secret
picker opened from the dialog starts its "Save to" choice on the
identity the run goes as.

The quick submit button opens the arguments dialog instead of
submitting when the run would fall back to you (you're not in the team,
the team can't be acted as, or the team couldn't be checked), when a
secret is missing for the identity it would go as, or when its secrets
are split. The dialog says who the run goes as, explains a fallback,
and names the missing secrets, in bold after a lock icon, and who has
them. Missing secrets warn rather than block: the list can lag behind a
secret added elsewhere.
The button's "as <team>" suffix shows only when the run goes as the
team.

Submit waits while the team resolves and while the secrets are checked,
and is refused for projects on different teams. The arguments button
stays available in that case, so another project can be chosen for the
run. Workspace names in the submit button and the dialog carry the
workspace icon.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A run an agent submitted from a team's Tangent project was always
created as the user, so a team secret failed at launch. The Tangent
editor and run view agents submit through the tool bridge, which filed
the run under the project but never sent the team header.

The bridge now takes the project's team from the same
`useTeamForSubmission` the submit button uses, and follows the same
rule:

- submit_pipeline_run goes as the user unless it's asked to act as the
  team (asTeam), or the run needs a secret only the team has. It decides
  with the same runAsFor as the UI. The result's actingAsWorkspace names
  the workspace it went as and actingAsTeam is that workspace's team id,
  and its warning says when a team-only secret forced it.
- asTeam is refused, with nothing submitted, when the user can't act as
  the team: there's none, they're not in it, the backend refuses it, or
  it couldn't be checked.
- A run whose secrets are split between the user and the team is
  refused unless asTeam is set, saying which are where.
- While the team is resolving, or for projects on different teams, the
  submission is refused with the reason, so the agent can retry or
  explain.
- A secret missing for the identity the run went as comes back as a
  warning.

The tool's description and results call the team the workspace, as the
UI does, so agents use the user's word for it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The editor's Quick Run button clicks a hidden submitter, so the
submitter's "as <team>" suffix never shows and a run went as the team
with no sign of it. The button now carries a badge with the workspace
icon, and its tooltip names the workspace, whenever the page's run would
go as the team by default, as it does when only the team has a secret
the pipeline uses.

The hidden submitter also waits while the page's team resolves or the
run's secrets are checked, and refuses projects on different
workspaces, and a click on Quick Run then did nothing. Quick Run is now
disabled in those cases too, and its tooltip says what it's waiting
for.

The menu bar button keeps having no accessible name of its own: giving
it one would collide with the hidden submitter's "Submit Run" in
role-based lookups.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@camielvs
camielvs merged commit 51e5cac into master Oct 31, 2026
18 checks passed
@camielvs
camielvs deleted the cvs/submit-as-team branch October 31, 2026 00:25
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.

2 participants