Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions frontend-v2/src/features/settings/skills/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,67 @@ it('shows per-project delivery results on the skill row and detail panel', async
expect(blockOf('项目 B')).toHaveTextContent(/下发中/)
})

it('explains a waiting delivery with how to unblock it', async () => {
installMarketplaceBackend({
catalog: [writing],
selections: [marketplaceSelection(writing)],
progress: [
{
namespace: 'demo',
identifier: 'writing-kit',
results: [
{
projectId: 'project-a',
name: '项目 A',
state: 'waiting',
installedVersion: '',
failure: '',
},
],
},
],
})
const user = userEvent.setup()
renderSettingsPage(<SkillsPage />)
const row = await screen.findByRole('article', { name: 'writing-guide' })
await user.click(within(row).getByRole('button', { name: '查看技能 writing-guide' }))
const dialog = await screen.findByRole('dialog')
expect(within(dialog).getByText('项目 A')).toBeInTheDocument()
expect(
within(dialog).getByText(/对话(即使已经回答完)以及正在运行的任务或工作流都会占用运行时/),
).toBeInTheDocument()
expect(within(dialog).queryByText(/结束这些对话/)).not.toBeInTheDocument()
})

it('does not show the waiting hint for a delivered project', async () => {
installMarketplaceBackend({
catalog: [writing],
selections: [marketplaceSelection(writing)],
progress: [
{
namespace: 'demo',
identifier: 'writing-kit',
results: [
{
projectId: 'project-a',
name: '项目 A',
state: 'installed',
installedVersion: '1.0.0',
failure: '',
},
],
},
],
})
const user = userEvent.setup()
renderSettingsPage(<SkillsPage />)
const row = await screen.findByRole('article', { name: 'writing-guide' })
await user.click(within(row).getByRole('button', { name: '查看技能 writing-guide' }))
const dialog = await screen.findByRole('dialog')
expect(within(dialog).getByText('项目 A')).toBeInTheDocument()
expect(within(dialog).queryByText(/占用运行时/)).not.toBeInTheDocument()
})

it('marks a failed delivery and shows the failure reason', async () => {
installMarketplaceBackend({
catalog: [writing],
Expand Down
5 changes: 5 additions & 0 deletions frontend-v2/src/features/settings/skills/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,11 @@ function SkillDeploymentStates({ states }: { states?: SkillProgress[] }) {
<span className="font-medium">{item.name}</span>
<span> · {projectStateLabel[item.state] ?? item.state}</span>
{item.installedVersion && <span> · v{item.installedVersion}</span>}
{item.state === 'waiting' && (
<p className="mt-1 text-muted-foreground">
技能只在项目运行时已启动且空闲时下发。项目里的对话(即使已经回答完)以及正在运行的任务或工作流都会占用运行时;删除不再需要的对话、等任务和工作流结束后会自动下发。

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.

P2-2(建议) 从未启动运行时的项目也会显示「等待下发」。这时没有对话可删,也没有任务或工作流可等,而 OnlineSkillProjects 会一直跳过该项目。建议明确告诉用户,可以在该项目先运行一个会执行 Agent 节点且不依赖此技能的工作流,等它结束后由系统自动尝试下发。

Suggested change
技能只在项目运行时已启动且空闲时下发。项目里的对话(即使已经回答完)以及正在运行的任务或工作流都会占用运行时;删除不再需要的对话、等任务和工作流结束后会自动下发。
技能会在项目运行时已启动且空闲时自动尝试下发。如果运行时尚未启动,可以先在该项目运行一个会执行 Agent 节点且不依赖此技能的工作流,等它结束。仍保留会话的对话(即使已经回答完)以及正在运行的任务或工作流都会占用运行时。可以删除不再需要且仍占用运行时的对话,并等待任务和工作流结束。

可直接采纳,也可以不改。

</p>
)}
{item.failure && (
<p role="alert" className="mt-1 text-destructive">
{item.failure}
Expand Down
Loading