Repository navigation
feat(agent-core-v2): turn /tower into a mode parallel to plan mode #3099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
27e189c
feat(agent-core-v2): turn /tower into a mode parallel to plan mode
wbxl2000 5329388
feat(agent-core-v2): align /tower command semantics with the original…
wbxl2000 6c068f3
Merge remote-tracking branch 'origin/main' into feat/tower-mode
wbxl2000 63b9a43
fix(tui): harden the /tower command against mid-turn objectives, lega…
wbxl2000 7db8b6e
fix(agent-core-v2): keep restored tower state inert while the feature…
wbxl2000 b748da3
fix(agent-core-v2): include TowerInit in the mode tool overlay and re…
wbxl2000 99166f8
feat(agent-core-v2): expose tower control tools statically and make t…
wbxl2000 3380bfe
fix(tui): warn that tower mode needs a restart after a live flag flip…
wbxl2000 642ab6d
Merge remote-tracking branch 'origin/main' into feat/tower-mode
wbxl2000 9a4691b
fix(agent-core-v2): let tower mode exit clear persisted state while t…
wbxl2000 04e8038
fix(agent-core-v2): emit the tower exit reminder through a disabled f…
wbxl2000 35eecd1
fix(tui): show the Tower mode status row only when the experiment is …
wbxl2000 f34465e
fix(agent-core-v2): confine tower mode to the main agent and always r…
wbxl2000 1f357fb
feat(kap-server): project tower mode into transcript modes and reasse…
wbxl2000 afdeeed
fix(agent-core-v2): fold the main-agent invariant into the effective …
wbxl2000 0a1b95e
fix(kap-server): gate the cold tower mode badge behind the experiment…
wbxl2000 6ccca00
fix(agent-core-v2): reapply the tower tool overlay after a profile bi…
wbxl2000 b6020b4
fix(protocol): mirror towerMode and tower_mode in the shared zod schemas
wbxl2000 488859c
Merge remote-tracking branch 'origin/main' into feat/tower-mode
wbxl2000 05eec92
test(agent-core-v2): adapt tower tests to the agent lifecycle context…
wbxl2000 ee613f1
chore(agent-core-v2): regenerate the wire manifest; test(node-sdk): l…
wbxl2000 efbc73a
fix(agent-core-v2): exit a replayed tower mode when the workspace bel…
wbxl2000 85f5b20
fix(agent-core-v2): carry tower ownership in the enter record so fork…
wbxl2000 f7954a8
fix(agent-core-v2): apply the tower overlay before dispatching enter …
wbxl2000 a7e153c
fix(agent-core-v2): validate store ownership before entering tower mode
wbxl2000 831ffb5
fix(agent-core-v2): claim the repository tower owner at enter; fix(tu…
wbxl2000 8ada07d
fix(agent-core-v2): make the first tower claim exclusive and refuse a…
wbxl2000 f4bba85
feat(agent-core-v2): guard tower adoption and teardown with a cross-p…
wbxl2000 1063dfc
revert(agent-core-v2): drop the cross-process lease and enter-time cl…
wbxl2000 5f30610
fix(agent-core): hide the v2-only tower flag from the legacy experime…
wbxl2000 937aeb1
merge: resolve origin/main (#3007) into feat/tower-mode
wbxl2000 aaefbb4
fix(agent-core-v2): keep tower mode inert until the tower feature is …
wbxl2000 e443785
fix(kap-server): gate the cold tower badge on tower feature assembly
wbxl2000 86aab5d
fix(agent-core-v2): liveness-aware tower entry and per-App assembly s…
wbxl2000 9797030
fix(agent-core-v2): keep stale-owner adoption across resume; reject t…
wbxl2000 c1764fb
fix(agent-core-v2): clear the tower assembly marker when the feature …
wbxl2000 145c777
fix(agent-core-v2): publish tower deactivation on gate loss; reject r…
wbxl2000 345454e
fix(agent-core-v2): reconcile tower projection on config changes and …
wbxl2000 96cdbc9
fix(agent-core-v2): reconcile the tower projection in both directions
wbxl2000 a0c63b5
fix(agent-core-v2): validate forked tower ownership even while the fl…
wbxl2000 780a360
fix(agent-core-v2): veto tower tools while the tower experiment is off
wbxl2000 45b4a01
fix(agent-core-v2): keep tower worker write isolation when the flag t…
wbxl2000 b837752
test(agent-core-v2): make tower tests hermetic for CI
wbxl2000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": minor | ||
| --- | ||
|
|
||
| Add tower mode as a mode parallel to plan mode: run /tower to toggle it, or /tower <objective> to start multi-agent orchestration on an objective. Enable it with KIMI_CODE_EXPERIMENTAL_TOWER=1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import { NO_ACTIVE_SESSION_MESSAGE } from '../constant/kimi-tui'; | ||
| import { formatErrorMessage } from '../utils/event-payload'; | ||
| import type { SlashCommandHost } from './dispatch'; | ||
|
|
||
| export async function handleTowerCommand(host: SlashCommandHost, args: string): Promise<void> { | ||
| if (host.session === undefined) { | ||
| if (!host.engineV2) { | ||
| host.showError(NO_ACTIVE_SESSION_MESSAGE); | ||
| return; | ||
| } | ||
| // v2 session-less: lazy-create the session, then toggle — the same path | ||
| // the first prompt takes. | ||
| const session = await host.ensureSession(); | ||
| if (session === undefined) return; | ||
| } | ||
|
|
||
| const input = args.trim().toLowerCase(); | ||
| if (input === 'on') { | ||
| await applyTowerMode(host, true); | ||
| return; | ||
| } | ||
| if (input === 'off') { | ||
| await applyTowerMode(host, false); | ||
| return; | ||
| } | ||
| if (input.length === 0) { | ||
| await applyTowerMode(host, !host.state.appState.towerMode); | ||
| return; | ||
| } | ||
|
|
||
| await startTowerObjective(host, args.trim()); | ||
| } | ||
|
|
||
| async function startTowerObjective(host: SlashCommandHost, objective: string): Promise<void> { | ||
| if (!host.state.appState.towerMode) { | ||
| if (!(await setTowerMode(host, true))) return; | ||
|
wbxl2000 marked this conversation as resolved.
Outdated
|
||
| host.showNotice('Tower mode: ON'); | ||
| } | ||
| host.sendNormalUserInput(objective); | ||
|
wbxl2000 marked this conversation as resolved.
wbxl2000 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| async function applyTowerMode(host: SlashCommandHost, enabled: boolean): Promise<void> { | ||
| if (enabled && host.state.appState.towerMode) { | ||
| host.showStatus('Tower mode is already on.'); | ||
| return; | ||
| } | ||
| if (!enabled && !host.state.appState.towerMode) { | ||
|
wbxl2000 marked this conversation as resolved.
Outdated
|
||
| host.showStatus('Tower mode is already off.'); | ||
| return; | ||
| } | ||
| if (!(await setTowerMode(host, enabled))) return; | ||
| host.showNotice(enabled ? 'Tower mode: ON' : 'Tower mode: OFF'); | ||
| } | ||
|
|
||
| async function setTowerMode(host: SlashCommandHost, enabled: boolean): Promise<boolean> { | ||
| try { | ||
| await host.requireSession().setTowerMode(enabled); | ||
| } catch (error) { | ||
| host.showError( | ||
| `Failed to ${enabled ? 'enable' : 'disable'} tower mode: ${formatErrorMessage(error)}`, | ||
| ); | ||
| return false; | ||
| } | ||
| host.setAppState({ towerMode: enabled }); | ||
|
wbxl2000 marked this conversation as resolved.
|
||
| return true; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.