Repository navigation
Conversation
An agent's step can reach the page before the agent's workflow has been fetched, and then carries the content alone. Reloading the workspace from it dropped the open workflow's id and name: the title went blank and the agent's own tab locked as belonging to a different workflow. For an agent bound to the open workflow, the reload now keeps that workflow's id and name. An agent bound to no workflow is reloaded as before, so its content is not saved over the workflow that happens to be open.
The tab of an agent that works on another workflow was disabled: it showed a lock and could not be clicked, so its chat could not be reached again. The tab can now be selected. In place of the chat it names the agent's workflow and links to it. The agent is not activated there, since an active agent loads its workflow into the canvas. The link is a plain one, as on the admin executions page, because the workspace reads the workflow's id from its address only when it is created.
Backport auto-label reportThis
|
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9604 +/- ##
============================================
- Coverage 91.68% 91.68% -0.01%
Complexity 5135 5135
============================================
Files 1302 1304 +2
Lines 58119 58103 -16
Branches 7582 7584 +2
============================================
- Hits 53285 53270 -15
+ Misses 2923 2922 -1
Partials 1911 1911
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…le branch Only an agent bound to another workflow reaches the notice that links to its workflow, so the agent's delegate is always set there. Optional chaining on it added a branch that could never run, which left the line partly covered.
| const open = this.workflowActionService.getWorkflowMetadata(); | ||
| const boundWid = this.agentInfo.delegate?.workflowId; | ||
| const isBoundToOpen = !!boundWid && boundWid === open.wid; | ||
| this.workflowActionService.reloadWorkflow(isBoundToOpen ? { ...open, ...workflow } : workflow, false, false); |
There was a problem hiding this comment.
The content-only Workflow comes from agent.service.ts (the WsServerStepEvent branch, around lines 555-561), where { ...(existingWorkflow || {}), content } is cast with as Workflow. Merging here works, since only the workspace has the full metadata. As a follow-up, typing that stream as WorkflowContent and building { ...open, content } here would stop any other consumer from getting a Workflow with no id. Not blocking.
| <a | ||
| nz-button | ||
| nzType="primary" | ||
| [href]="workspaceCanvasUrl(workflowId)"> | ||
| Open that workflow | ||
| </a> |
There was a problem hiding this comment.
The plain href makes sense: workspace.component.ts reads route.snapshot.params.id only once, and this is the first link from one workspace to another. Two small notes:
- After the reload, the panel opens on the "+ Agent" tab, so the user still has to click the agent's tab to see the chat.
- A follow-up could have the workspace react to
paramMap(or add aRouteReuseStrategy), so links like this one can berouterLinks.
Neither is needed here.
| if (!this.canSwitchToAgent(agent)) { | ||
| this.deactivateCurrentAgent(); | ||
| this.selectedTabIndex = index; | ||
| return; | ||
| } |
There was a problem hiding this comment.
Every tab can be selected now, so canSwitchToAgent really means "the agent is on the open workflow". The new *ngIf and this branch both rely on it. Renaming it (e.g. to isOnOpenWorkflow) would read better. Optional.
What changes were proposed in this PR?
Two ways an agent's chat could not be reopened:
An agent on another workflow. On "Iris species report", the chat of an agent working on "Q4 sales by region". Before, its tab does not respond:
After, it names that workflow and links to it, where the chat is:
Your own agent on this workflow. A prompt sent the moment the agent's tab opens. Before, the title and the workflow id disappear, and both tabs lock:
After, they stay:
Any related issues, documentation, discussions?
Part of #9575: this fixes the chats that cannot be reopened, and #9579 fixes the model card that does not respond.
How was this PR tested?
New specs cover the selectable tab, the link and the kept workflow id; each fails without its change. Also run in headless Chromium against a local stack with a real model, alone and merged with #9579. The link opens the agent's workflow, where the chat answers, and a prompt sent at once keeps the title.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5.2, Claude Opus 5.5)