Skip to content

feat(augment): Phase C -- SonataFlow approval workflow integration#3233

Merged
rrbanda merged 23 commits into
redhat-developer:mainfrom
rrbanda:feat/augment-phase-c-approval
May 25, 2026
Merged

feat(augment): Phase C -- SonataFlow approval workflow integration#3233
rrbanda merged 23 commits into
redhat-developer:mainfrom
rrbanda:feat/augment-phase-c-approval

Conversation

@rrbanda
Copy link
Copy Markdown
Contributor

@rrbanda rrbanda commented May 24, 2026

Summary

  • Add AgentApprovalWorkflowService for SonataFlow integration with CloudEvents-based decision sending and workflow lifecycle management
  • Wire dual-mode approval into router.ts -- when augment.agentApproval.enabled is true, transitions go through SonataFlow; when false, they happen immediately
  • Add PUT /agents/:agentId/request-unpublish endpoint with pendingAction tracking and optional SonataFlow workflow start
  • Add PUT /agents/:agentId/withdraw endpoint for owners to cancel pending requests
  • Add agentApproval config schema to config.d.ts
  • Update SESSION_WORK_LOG.md to mark phases A, B, H as complete

Test plan

  • yarn tsc:full passes
  • yarn lint passes on all changed files
  • yarn prettier --check passes
  • API reports unchanged (service is internal, not publicly exported)
  • Manual: verify /agents/:agentId/request-unpublish and /agents/:agentId/withdraw endpoints respond correctly
  • Manual: verify dual-mode toggle works (agentApproval.enabled: true/false)

@rrbanda rrbanda requested review from a team and pkliczewski as code owners May 24, 2026 23:44
@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented May 24, 2026

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-augment-backend workspaces/augment/plugins/augment-backend minor v0.1.0
@red-hat-developer-hub/backstage-plugin-augment-common workspaces/augment/plugins/augment-common minor v0.1.0
@red-hat-developer-hub/backstage-plugin-augment workspaces/augment/plugins/augment minor v0.1.0

@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

❌ Patch coverage is 54.77707% with 1136 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.36%. Comparing base (b418448) to head (858cced).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3233      +/-   ##
==========================================
- Coverage   53.78%   46.36%   -7.42%     
==========================================
  Files        2362      641    -1721     
  Lines       84847    36899   -47948     
  Branches    23510    11623   -11887     
==========================================
- Hits        45634    17110   -28524     
+ Misses      37755    19722   -18033     
+ Partials     1458       67    -1391     
Flag Coverage Δ
adoption-insights ?
ai-integrations ?
app-defaults ?
augment 46.36% <54.77%> (-1.18%) ⬇️
bulk-import ?
cost-management ?
dcm ?
extensions ?
global-floating-action-button ?
global-header ?
homepage ?
konflux ?
lightspeed ?
mcp-integrations ?
orchestrator ?
quickstart ?
sandbox ?
scorecard ?
theme ?
translations ?
x2a ?

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b418448...858cced. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rrbanda rrbanda force-pushed the feat/augment-phase-c-approval branch from f6e99f0 to 6cdaf16 Compare May 25, 2026 00:03
…1-C4)

- C1: Add AgentApprovalWorkflowService for SonataFlow integration
  with CloudEvents-based decision sending and workflow lifecycle
- C2: Wire dual-mode approval into router.ts and add agentApproval
  config schema to config.d.ts
- C3: Add PUT /agents/:agentId/request-unpublish endpoint with
  pendingAction tracking and optional SonataFlow workflow start
- C4: Add PUT /agents/:agentId/withdraw endpoint for owners to
  cancel pending requests

Also updates SESSION_WORK_LOG.md to mark phases A, B, H as complete.
@rrbanda rrbanda force-pushed the feat/augment-phase-c-approval branch from 6cdaf16 to b5fc2e8 Compare May 25, 2026 00:20
rrbanda added 6 commits May 24, 2026 20:26
- D1: Config-seeded agent discovery fallback in KagentiProvider --
  when API returns 0 agents, uses augment.kagenti.agents config
  to fetch agent cards as fallback
- D2: SSE streaming already implemented (chatStream with fallback)
- D3: TLS fix in DevSpacesService -- use undici.Agent with
  rejectUnauthorized:false for self-signed cluster certs
- D4: Add resolveNamespaceForUser() to derive DevSpaces namespace
  from Backstage user entity ref (user:default/jsmith -> jsmith-devspaces)
…nd routes

- E1: Add augment.skillsMarketplace config to app-config.yaml with
  runtimes (DocsClaw, ZeroClaw, OpenFang) and marketplace endpoints
- E2: Add chatEndpoint field to ChatAgentConfig and ChatAgent interfaces
  for skill agents with direct chat endpoints
- E3: Create skillsRoutes.ts with GET /skills (proxy to marketplace),
  GET /skills/runtimes (from config), GET /skills/domains (extracted)
- Register skills routes in router.ts and routes index
- Regenerate API reports for augment-common
- E4: K8s manifest builder (skillsManifestBuilder.ts) with init container
  for OCI skill extraction, DocsClaw runtime, Service, and ConfigMap
- E5: LLM secret manifest generation in buildManifests
- E6: Governance registration for skill agents via POST /agents/from-skills
  with chatEndpoint and framework:'docsclaw'
- E7: Chat proxy placeholder (TODO in skillsRoutes)
- E8: K8s cleanup placeholder (TODO in agentRoutes DELETE handler)
- E9: Frontend components -- RuntimePicker, SkillBrowser, SkillAgentConfigForm
- C2 gap: Add agentApproval config section to app-config.yaml
- C4 gap: Call cancelWorkflow on withdraw when SonataFlow is enabled
…llBrowser, G1 validation polish

- Use localeCompare for domain sort (SonarCloud S2871 reliability bug)
- Use toLocaleLowerCase('en-US') instead of toLowerCase (ESLint)
- G1: Add End node warning and disconnected agent detection in PublishDialog
- F1: Redesign AgentCreateIntentDialog with two top-level cards
  and 2x2 sub-option grid using theme.palette colors
- F2: All creation flows end on My Agents tab
- F3: Skill Agent badge and chatEndpoint display in WorkflowAgentDetail,
  DocsClaw framework label/color in marketplace constants
- Fix nested ternaries (ESLint no-nested-ternary) with helper functions
Copy link
Copy Markdown

@jordigilh jordigilh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 25, 2026

@jordigilh: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@rrbanda rrbanda requested review from jordigilh and removed request for jordigilh May 25, 2026 00:53
@rrbanda rrbanda force-pushed the feat/augment-phase-c-approval branch from 046dbba to 4502bc2 Compare May 25, 2026 05:33
…-code builder

Skills-based agent creation:
- K8s deploy via OpenShift API with init container OCI V2 flow
- Skill chat proxy via K8s service proxy
- Deploy progress UX with pod readiness polling
- Live agent info endpoint (health, skills, system prompt)

Agent lifecycle (Draft -> Pending -> Published -> Archived):
- Review Queue: Approve and Publish / Reject / Approve Removal / Keep Published
- SonataFlow dual-mode with callback loop prevention
- Agent Registry: In Review Queue chip, bulk workflow guard, skill runtime info

No-code builder: onPublish stays draft, Edit in Builder, save indicator
DevSpaces: framework picker from API, K8s creds from app-config, Open DevSpace button
@rrbanda rrbanda force-pushed the feat/augment-phase-c-approval branch from 4502bc2 to cbefade Compare May 25, 2026 12:01
rrbanda added 8 commits May 25, 2026 08:04
PreviewChatPanel.tsx was missing X-Backstage-Request header on the
POST /workflows/{id}/run/stream call, causing 403 in the builder's
chat preview panel.
- Auto-save workflow to backend before opening preview (PUT then POST fallback)
- User-friendly error messages in preview chat (404 -> save-first hint, 403 -> permissions)
- Persist error shown as Snackbar if auto-save fails
- Fix FEATURE_SPEC.md prettier formatting (CI blocker)
Regenerated knip-report.md to match CI expectations after
useAgentTemplates.ts changes (catalog-model now unlisted dependency).
- Toolbar button: "Publish" -> "Save to My Agents" (green, with tooltip)
- Back button: "Back to Marketplace" -> "Back to My Agents"
- Matches actual behavior: saves workflow as draft, lands on My Agents tab
Delete, rename, duplicate, and create workflow calls in
WorkflowDashboard.tsx and ChatView.onCreateWorkflow were all
missing the X-Backstage-Request header, causing silent 403 failures.
Agent Registry:
- Add delete button for draft agents (trash icon with confirmation dialog)
- Guard bulk Publish/Unpublish by stage (only pending->published, published->pending)
- Tooltips explain why bulk actions are disabled
- Simplify unregistered agent banner text

CI:
- Fix knip-report.md trailing newline to match backstage-repo-tools output
- DELETE /agents/:agentId now also deletes workflow definition + versions
  for wf-* agents (was only removing chatAgents, leaving workflow orphan)
- WorkflowConfigService.deleteWorkflow now also cleans up chatAgents
  entries (workflow-level + per-node wf/{id}/* entries)
- Both paths now fully clean up all resources for their agent type
rrbanda added 7 commits May 25, 2026 08:54
…ides + Conversation Starters)

Removed Display Overrides (accent color, avatar URL, greeting message,
display name) and Conversation Starters sections from the expanded
agent row in Agent Registry. Admins configure these from the agent
detail view, not the registry list.

Keeps: Type, Framework, Agent ID, Lifecycle, Version, Endpoint,
Runtime Info, System Prompt, Description.
My Agents filter was too restrictive -- only showed workflow-builder
and docsclaw framework agents. Now shows ALL governance-registered
agents that are not yet published (Draft, Pending, Archived), plus
all user-created and unregistered agents. Kagenti and orchestration
agents now visible in My Agents when in draft/pending.
- Remove "New Tool" button from Command Center Platform > Tools
  (tools are created via self-service from My Agents, not admin panel)
- Add "Agent Ops" as a dedicated sub-tab under Platform, next to Config
  and Observability (was buried inside Config > Model tab)
…lure

Add public discoverBackendTools(deps) wrapper on OpenAIAgentsOrchestrator
to fix "orchestrator.discoverBackendTools is not a function" caused by
the method being extracted to a standalone function without updating
CoordinatorChatOps. Remove unused AddIcon import that broke CI. Clean up
Command Center: remove redundant Tools sub-tab and inner tab from Config,
remove Agent Ops section from Config (now its own sub-tab).
- ModelToolsPanel.test: remove Tools tab assertions (tab was removed)
- KagentiToolsPanel.test: remove New Tool button assertion (button removed)
- KagentiAgentsPanel.test: add discoveryApiRef mock for child components
- shared.test: update to expect 'request-unpublish' action name
- agentRoutes.test: skip startup reconciliation in test env to prevent
  async race that auto-registers agents before tests run
@sonarqubecloud
Copy link
Copy Markdown

@rrbanda rrbanda merged commit 717a651 into redhat-developer:main May 25, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants