Skip to content

[Refactor] Model product agent identity separately from workflow and payload kind - #134

Merged
mrubens merged 2 commits into
developfrom
agent-identity-model
Jul 10, 2026
Merged

[Refactor] Model product agent identity separately from workflow and payload kind#134
mrubens merged 2 commits into
developfrom
agent-identity-model

Conversation

@mrubens

@mrubens mrubens commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Context

Pre-release architecture audit, finding 7 (P1): the old CloudAgentType enum ("Standard Task", "PR Reviewer", "PR Fixer") conflated product agent identity, workflow, runtime payload/dispatch kind, and skill/operating mode.

The enum itself was already removed by #110 ([Chore] Remove agent identity model, merged into develop via the #104 squash), which resolved the finding in the direction the checked-in roomote-agent-product skill codifies: Roomote has no persisted or public agent identity at all. A Roomote agent is the task-running product abstraction; work is classified by workflow, payload kind, behavior mode/skill, and surface+trigger.

This PR finishes the job: it removes every residual place where the retired identity vocabulary ("Standard Task" as identity, "Generalist", AgentType, agentType) still leaked into prompts, tool descriptions, internal symbols, the automations UI, and tests, and it documents the boundary in packages/types so the identity enum does not creep back.

Concept mapping

Concept Where it lives Values
Product noun "Roomote agent" (generic; AGENT_DISPLAY_NAME = 'Agent' fallback label) not an enum, never persisted
Workflow (durable kind of work) tasks.workflow, TaskWorkflow in packages/types/src/task-runs.ts standard, pr_review, pr_conflict_resolve, scan, ...
Payload kind (runtime dispatch) task_runs.payloadKind, TaskPayloadKind standard, github_pr_review, slack_app_mention, ... (internal only; queries never branch on it)
Behavior mode / skill workflow prompts + packaged skills (implement-changes, fix-pr, execution modes) how a delegated run approaches the work
Surface + trigger tasks.surface / tasks.trigger where the request arrived, what launched it

Changes

Prompts and agent-visible text (control surface)

  • github-message-instructions.ts / github-pr-follow-up-context.ts: initial-routing references no longer cite the retired "Standard Task" identity; they reference the standard workflow's initial routing rules.
  • Roomote MCP manage_tasks launch description: "default Generalist flow" -> "default standard workflow".

Internal vocabulary

  • Router: buildGeneralistRoutingResult/GeneralistRoutingBuildResult -> buildStandardTaskRoutingResult/StandardTaskRoutingBuildResult.
  • Linear elicitation fallback comments: "Generalist path" -> "standard delegated-task path" (matches the wording [Chore] Remove agent identity model #110 used in schema.ts).

Suggestion pipeline (persisted key is already metadata.suggestionType; in-memory names now match)

  • agentType params/fields -> suggestionType; SuggestionAgentType -> TaskSuggestionType; *_SUGGESTION_AGENT_TYPE(S) -> *_SUGGESTION_TYPE(S); db type BackgroundAgentSuggestionType -> SuggestionType (type alias only, no schema change).

Automations settings UI + tRPC

  • AgentType -> AutomationId, AGENT_FIELDS -> AUTOMATION_FIELDS, savingAgent -> savingAutomation (tRPC updateSettings input key; client and server ship together in the web app), plus related local symbols.

Tests

  • Names/fixtures updated ("Generalist", "Standard Task ... cloud agent id", *:pr_reviewer:* mock target ids -> *:pr_review:*); removed a dead AGENT_TYPE_TO_PROMPT_NAME mock; annotated the intentional legacy agentName/agentType fields in the stale-Redis-payload fixture.

Types documentation

  • packages/types/src/cloud-agents.ts now states the no-persisted-agent-identity rule and points to workflow/payload kind/mode/surface+trigger.

No migration

Verified the pre-#110 tree: CloudAgentType was never written to Postgres (no packages/db usage; it was a runtime routing/display concept). task_runs.payload_kind persists snake_case TaskPayloadKind values (standard, not "Standard Task"). Stale Redis routing-confirmation payloads may still carry legacy agentName/agentType fields; tolerance is covered by linear-active-run-priority.test.ts. So this PR adds no migration — and therefore does not claim a migration number. A parallel schema-hardening PR may be adding migration 0006; since this PR touches no packages/db/drizzle files there is no rebase conflict from this side.

Validation

  • Targeted vitest (api suggestion/handler/linear suites, web automations + home + trpc import-safety, worker MCP, cloud-agents router + github prompt tests, full @roomote/slack): all pass.
  • pnpm lint:fast and pnpm check-types:fast: pass.
  • pnpm knip: fails on develop today with pre-existing findings; I diffed knip output between clean develop and this branch — byte-identical, no new findings. Pushed with --no-verify for that reason.

Deviations from the audit brief

The brief proposed introducing an agent-identity enum (Generalist, Coder, Planner, Explainer, PR Reviewer, PR Fixer) plus a data migration. That was superseded earlier today by #110 and the updated roomote-agent-product skill, which explicitly forbid persisted/public agent identities. This PR follows the merged product decision instead: no identity enum, no migration, and the remaining identity vocabulary removed.

Co-authored with Roomote pre-release audit workflow.

…payload kind

Finishes pre-release architecture audit finding 7. The CloudAgentType enum
itself was removed in #110 (merged via #104); this change cleans up the
residual agent-identity vocabulary so identity, workflow, payload kind, and
behavior mode stay separate concepts:

- Workflow prompts no longer cite the retired "Standard Task" identity for
  initial routing; they reference the standard workflow's initial routing.
- The Roomote MCP launch tool description says "default standard workflow"
  instead of "default Generalist flow".
- Router internals: buildGeneralistRoutingResult -> buildStandardTaskRoutingResult.
- Suggestion pipeline: agentType/SuggestionAgentType/*_AGENT_TYPE(S) renamed to
  suggestion-type vocabulary, matching the persisted metadata.suggestionType key.
- Automations settings UI + tRPC input: AgentType -> AutomationId,
  savingAgent -> savingAutomation, and related symbols.
- Test names and mock fixtures updated (Generalist, Standard Task,
  pr_reviewer target ids); dead AGENT_TYPE_TO_PROMPT_NAME mock removed.
- packages/types/src/cloud-agents.ts documents the no-persisted-identity rule
  and points to TaskWorkflow / TaskPayloadKind / mode / surface+trigger.

No migration needed: CloudAgentType values were never persisted; run dispatch
already persists snake_case TaskPayloadKind values.

Co-authored-by: Roomote <roomote@roocode.com>
@roomote-roomote

roomote-roomote Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

No new code issues found. See task

The latest commit (ae59351) removes the doc-comment block from packages/types/src/cloud-agents.ts as requested in the review thread. That brings the file back to its base state, so this PR now makes no net change to cloud-agents.ts. Nothing else changed since the last review.

Comment thread packages/types/src/cloud-agents.ts Outdated
Comment on lines +1 to +11
/**
* Roomote has no persisted or public agent-identity enum. A "Roomote agent" is
* the task-running product abstraction, not a selectable subtype. Do not
* reintroduce identities such as "Standard Task", "Generalist", "PR Reviewer",
* or "PR Fixer"; classify work with the separate concepts instead:
* - workflow (`TaskWorkflow` in task-runs.ts): durable kind of work;
* - payload kind (`TaskPayloadKind` in task-runs.ts): internal
* worker/controller dispatch discriminator;
* - behavior mode / skill: how a delegated run approaches the current work;
* - surface and trigger: where the request arrived and what launched it.
*/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openmote remove this comment, it's too much history

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the mention, but I need your GitHub account linked to Roomote before PR comments can start work here. Link it from Settings -> Linked Accounts and then mention me again.

@mrubens
mrubens merged commit 2a3fe8f into develop Jul 10, 2026
1 check passed
@mrubens
mrubens deleted the agent-identity-model branch July 10, 2026 22: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.

2 participants