feat(forge): unify plugin entry for reviews and worktrees (#7721)

* feat(forge): unify the worktree plugin entry and add user previews

* docs(forge): show session-linked GitHub pull requests in preview

* refactor(forge): keep plugin unification out of profile loading

* docs(forge): document manual upgrade to the unified plugin entry

* fix(forge): localize preview descriptions and address review feedback

* test(web): refresh creation recommendation catalog for the forge description

---------

Co-authored-by: imccyu <[email protected]>
This commit is contained in:
Yichen Jiangandimccyu authored and GitHub committed 2026-11-02 22:34:01 +08:00
1 parent 86e2cc8277
commit d721353f86
57 files changed
+429 -102

No files matched your search

+1 -1
View File
@@ -676,7 +676,7 @@ const TOOL_PACKAGES: ToolPackage[] = [
})
await ctx.plugin(ToolWorktree)
},
note: 'Explicit experimental composition only. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. Leaving retains the branch and checkout.',
note: 'Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. Leaving retains the branch and checkout.',
},
{
pkg: '@deepseek-ai/dsh-tool-workflow',
+16 -12
View File
@@ -133,7 +133,7 @@ describe('optional bundles', () => {
}
})
it('offers Git Worktrees as one disabled bundle with its runtime and tool', () => {
it('retains the standalone worktree bundle for explicit profiles', () => {
const name = '@deepseek-ai/dsh-experimental-tool-worktree'
expect(OPTIONAL_BUNDLES).toContain(name)
for (const template of Object.values(PROFILE_TEMPLATES)) expect(template.bundles).not.toContain(name)
@@ -144,7 +144,7 @@ describe('optional bundles', () => {
}
})
it('offers the forge panel as one disabled bundle with its registry, provider, bindings, panel, and isolated worktree service', () => {
it('offers the forge panel and model worktree tool together with their separate worktree services', () => {
const name = '@deepseek-ai/dsh-experimental-forge-bundle'
expect(OPTIONAL_BUNDLES).toContain(name)
for (const template of Object.values(PROFILE_TEMPLATES)) expect(template.bundles).not.toContain(name)
@@ -154,24 +154,28 @@ describe('optional bundles', () => {
'@deepseek-ai/dsh-experimental-forge-github',
'@deepseek-ai/dsh-experimental-forge-session',
'@deepseek-ai/dsh-experimental-client-ui-forge',
'@deepseek-ai/dsh-experimental-worktree',
'@deepseek-ai/dsh-experimental-tool-worktree',
]) {
expect(flattenRows(composeEntries(shipped)).some(row => row.name === moduleName)).toBe(false)
expect(rows.filter(row => row.name === moduleName && row.disabled !== true)).toHaveLength(1)
}
const group = composeEntries([...shipped, bundle(name).patches]).find(row => row.id === 'optional-forge-panel')
expect(group?.isolate).toEqual({ worktrees: true })
expect(rows.filter(row => row.name === '@deepseek-ai/dsh-experimental-worktree')).toHaveLength(2)
})
it('composes the forge panel beside Git Worktrees with one worktree service each', () => {
const composed = composeEntries([
...shipped,
bundle('@deepseek-ai/dsh-experimental-tool-worktree').patches,
bundle('@deepseek-ai/dsh-experimental-forge-bundle').patches,
], (message) => { throw new Error(message) })
const topLevelIds = composed.flatMap(entry => typeof entry.id === 'string' ? [entry.id] : [])
expect(topLevelIds).toHaveLength(new Set(topLevelIds).size)
expect(flattenRows(composed).filter(row => row.name === '@deepseek-ai/dsh-experimental-worktree')).toHaveLength(2)
it('keeps the existing tool and panel row overrides addressable in the unified bundle', () => {
const config = { directory: '.agents/custom-worktrees' }
const warnings: string[] = []
const composed = composeEntries([...shipped, bundle('@deepseek-ai/dsh-experimental-forge-bundle').patches, [
{ id: 'worktree', config },
{ id: 'tool-worktree', disabled: true },
{ id: 'optional-forge-panel', disabled: true },
]], message => warnings.push(message))
expect(warnings).toEqual([])
expect(composed.find(row => row.id === 'worktree')?.config).toEqual(config)
expect(composed.find(row => row.id === 'tool-worktree')?.disabled).toBe(true)
expect(composed.find(row => row.id === 'optional-forge-panel')?.disabled).toBe(true)
})
it('ships all five lightweight bundles without selecting them in a default template', () => {
@@ -74,7 +74,7 @@ const SENTENCE_MODEL_EXPERIENCE: Readonly<Record<string, SentenceContract>> = {
'packages/experimental/forge': { kind: 'none', reason: 'Providers and watchers exchange code host status without contributing model context.' },
'packages/experimental/forge-github': { kind: 'none', reason: 'The provider reads pull request status for host-side watchers without contributing model context.' },
'packages/experimental/client-ui-forge': { kind: 'indirect', reason: 'Switching a Session directory from the panel reaches the model through the working-directory notice; inspection and status stay on the host.' },
'packages/experimental/forge-bundle': { kind: 'none', reason: 'Composes the forge packages and panel without adding a model tool or prompt.' },
'packages/experimental/forge-bundle': { kind: 'indirect', reason: 'The worktree tool and panel own the model-visible schemas, results, and directory notices selected by the bundle.' },
'packages/experimental/forge-session': { kind: 'none', reason: 'Bindings, discovery records, and polled status stay on the host; binding records never enter model requests.' },
'packages/experimental/worktree': { kind: 'indirect', reason: 'The worktree tool renders creation results; the working-directory service owns model-visible directory context.' },
'packages/experimental/client-ui-stats': { kind: 'none', reason: 'The panel reads Session events and renders them in the browser; it registers no tool, prompt section, or model input.' },