Repository navigation
Conversation
Each agent now has a server-side prompt queue. An idle agent starts a
submitted prompt right away; a busy agent either steers it into the
running turn or keeps it queued until the turn ends. The queue can be
paused and resumed, and single inputs can be steered, moved or
cancelled through `agents/{agent_id}/queue` routes. Every change is
pushed to subscribers as a `queue` WebSocket frame, and one snapshot per
subscribed agent follows every accepted subscription.
The submit body now only describes the input: model, thinking,
permission, plan, swarm, goal, profile and disabled-tool settings are
rejected and go through the profile route instead, so a queued prompt
runs with the settings current when it starts. An input can carry a
`mode` (plan, swarm or goal) that is applied right before its turn
starts; plan and swarm also leave tower mode, and a goal takes its
objective from the input's display text. A manual compaction is
submitted with `compact` and waits in the same queue; the `:compact`
session action, `GET /prompts` and the two `:steer` prompt routes are
removed.
Queued inputs stay outside the engine until they start, so a paused
queue no longer blocks undo, and goal continuations and tower wake
turns yield to waiting inputs. A queued compaction that cannot start,
or a queued mode that cannot be applied, leaves a warning in the
transcript instead of failing silently.
code-app: b01cc08112a342a0412b30844e6c50aee74392bb
🦋 Changeset detectedLatest commit: efa32dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0dee781c8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A queued input left the queue before the loop accepted it, so a launch that threw (for example on a stale session) lost the input without a trace. The queue now removes an entry only after the loop takes it; a failed start keeps it at the head, pauses the queue and leaves a warning in the transcript. An entry cancelled while its mode is being applied no longer starts. Goal continuations launched at turn end ignored the server queue and could run ahead of the user's queued input until the goal stopped. They now wait while inputs are queued, and a deferred continuation starts once the queue drains and the agent is idle, which also covers a queued compaction that ends without a turn. Aborting a prompt that is still in the server queue now withdraws it instead of failing with 40402, and the profile route accepts the `profile` and `disabled_tools` settings that the submit body no longer takes.
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1ba4467e0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
code-app: 4eccb63bc6f3f56356a14223eb63a37650992bc6
A queued input whose mode was still being applied stayed visible in the queue, so it could be moved behind other inputs and still start first once its mode was ready. The pump now takes the input out of the queue before applying its mode and puts it back at the front, with the queue paused and a warning, only when the loop refuses it. A deferred goal continuation checked only that the loop was idle, so it could be submitted while a queued compaction still held the loop and run ahead of input sent during the compaction. It now also waits until the loop can launch a prompt.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d797d6d3c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A paused queue keeps its prompts while the agent is otherwise idle, but the idle reaper only looked at activity, pending interactions and cron tasks. It closed the session after the reclaim timeout and silently dropped every queued prompt. Sessions now stay loaded while any agent still has prompts in its queue. A queued prompt whose mode was being applied had already left the queue without entering the loop, so the queue no longer listed it and neither cancel nor abort could reach it. It now stays listed at the head until it starts, can be cancelled there, and cannot be moved. It also still counts as pending input, so a deferred goal continuation or a tower wake does not start in between. A goal-mode prompt left plan mode before creating its goal, so a rejected goal (for example because one already exists) still turned plan mode off. The goal is now created first.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 124608f066
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…es in queue snapshots
A plan or swarm launch mode left tower mode before entering its own
mode, so a plan mode that failed to start (for example because the plan
directory could not be created) still turned tower off for good. Tower
is now left only after the launch mode is active.
The queue snapshot sent after subscribing added every live agent when
the subscription had a non-off wildcard, ignoring explicit per-agent
off grades. A subscription such as {"*": "delta", "main": "off"} then
received the main agent's queued prompts, which the incremental queue
frames already withheld. Each agent's snapshot now follows its own
grade.
# Conflicts: # apps/kimi-code/dist-web/assets/CodeBlockNode-CKqd_mib.js # apps/kimi-code/dist-web/assets/CodeBlockNode-DN6tN-fd.js # apps/kimi-code/dist-web/assets/CodeBlockNode-DnNeGjd2.js # apps/kimi-code/dist-web/assets/PreCodeBlock-CwnbxLyB.js # apps/kimi-code/dist-web/assets/PreCodeBlock-De4sXzpb.js # apps/kimi-code/dist-web/assets/PreCodeBlock-wWScDibl.js # apps/kimi-code/dist-web/assets/Tooltip-CBoeS4mO.js # apps/kimi-code/dist-web/assets/Tooltip-CaL_5gs5.js # apps/kimi-code/dist-web/assets/Tooltip-CsVtTVYl.js # apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-B95wgUd3.js # apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C0F_mbj1.js # apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-Id86ug7C.js # apps/kimi-code/dist-web/assets/arc-Bsib46yB.js # apps/kimi-code/dist-web/assets/arc-CBqyenpI.js # apps/kimi-code/dist-web/assets/arc-Dq9Cyc0b.js # apps/kimi-code/dist-web/assets/architectureDiagram-ZJ3FMSHR-BU3h4qH_.js # apps/kimi-code/dist-web/assets/architectureDiagram-ZJ3FMSHR-Dy9V5hy7.js # apps/kimi-code/dist-web/assets/architectureDiagram-ZJ3FMSHR-nh3c_qTo.js # apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-BaFROikJ.js # apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DVoda3uu.js # apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DWIUQjzE.js # apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BHnYiMQk.js # apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DK8zAX4-.js # apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DubDU1Hh.js # apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-3KP--Prg.js # apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BG6es7i7.js # apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BhqfYswo.js # apps/kimi-code/dist-web/assets/chunk-32BRIVSS-B0W4-BjK.js # apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CYFkA-hP.js # apps/kimi-code/dist-web/assets/chunk-32BRIVSS-DompFR0C.js # apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BRm-UcvZ.js # apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-DactliZz.js # apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-PgqEOtYU.js # apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BbWKwbJt.js # apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DDKia6Wx.js # apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DNGZpN35.js # apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BGwfG-d_.js # apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BlIxYDeZ.js # apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CLdUjjB6.js # apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-B_4qq8M2.js # apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-TDhzsKaU.js # apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-oXf5qu_V.js # apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-BBtlUlC2.js # apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-CaFNiLMz.js # apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Doiirtiw.js # apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CCscxsWP.js # apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-gc4j6mJE.js # apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-hOjH0svY.js # apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Borqg17k.js # apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C0Aw3V2v.js # apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-CBSF7Uhy.js # apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-9kW4cjFh.js # apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-C7rVNPdu.js # apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-h83Z76mT.js # apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BJZkFZnP.js # apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-CfigLTuT.js # apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-NLouu6tm.js # apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BnqyE1sd.js # apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CPEG8-Vi.js # apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-KkOFmjEG.js # apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-ClIEQzxH.js # apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-Cx1H0a5W.js # apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-azngSY2y.js # apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-Cxg8EsXr.js # apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-D0TIaws6.js # apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-ptq00KuZ.js # apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BJ0uLCEZ.js # apps/kimi-code/dist-web/assets/diagram-FQU43EPY-CZyP5-t8.js # apps/kimi-code/dist-web/assets/diagram-FQU43EPY-Dd0HSMZA.js # apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BihKArCL.js # apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bo2riSBI.js # apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DI-XwrPZ.js # apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DT8Wun3S.js # apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DVkJoMZV.js # apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DeFBJSVr.js # apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CDDFynlc.js # apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CsiOOqY1.js # apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-deo0EoBL.js # apps/kimi-code/dist-web/assets/diagram-WEI45ONY-5sbNN3fp.js # apps/kimi-code/dist-web/assets/diagram-WEI45ONY-CXBgtykE.js # apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DRDdsmaR.js # apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-B-sMl9AN.js # apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-CPZtqNO1.js # apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-unI37cZE.js # apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BUUoeEan.js # apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DMEzKZJ8.js # apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-OXNvxKyl.js # apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BgRIGxtY.js # apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-Cpg_K1S0.js # apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-DvH-ZhtN.js # apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BPjlGhob.js # apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-CvsplL3l.js # apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D8o814He.js # apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CBqntniz.js # apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CkPzgGiM.js # apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DaOkxSZG.js # apps/kimi-code/dist-web/assets/index-B1tIwymC.js # apps/kimi-code/dist-web/assets/index-B68Y3p9W.js # apps/kimi-code/dist-web/assets/index-BJ3eGrh9.js # apps/kimi-code/dist-web/assets/index-BvkSYG-C.js # apps/kimi-code/dist-web/assets/index-CEWtXGqT.js # apps/kimi-code/dist-web/assets/index-CQcWT59y.js # apps/kimi-code/dist-web/assets/index-DBoNckzp.js # apps/kimi-code/dist-web/assets/index10-D0AEmZyD.js # apps/kimi-code/dist-web/assets/index10-DBXQa5KK.js # apps/kimi-code/dist-web/assets/index10-X5vZpglB.js # apps/kimi-code/dist-web/assets/index5-COtrqpTL.js # apps/kimi-code/dist-web/assets/index5-CmPpMqNc.js # apps/kimi-code/dist-web/assets/index5-DuOTUxfY.js # apps/kimi-code/dist-web/assets/index6-BidN6rkR.js # apps/kimi-code/dist-web/assets/index6-CeESPUQu.js # apps/kimi-code/dist-web/assets/index6-CoOgkfRu.js # apps/kimi-code/dist-web/assets/index8-BkZ_nVKY.js # apps/kimi-code/dist-web/assets/index8-CkikbLH9.js # apps/kimi-code/dist-web/assets/index8-DjAAjwGu.js # apps/kimi-code/dist-web/assets/index9-6cg8BGrC.js # apps/kimi-code/dist-web/assets/index9-BI8E34ud.js # apps/kimi-code/dist-web/assets/index9-tIE0Vojz.js # apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-4kzQfFc4.js # apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-BTsrmCcp.js # apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-i0sqzIdk.js # apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-BYPWpLUk.js # apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-CD2HXIn9.js # apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-CG4SQ4h6.js # apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-69Mpdm1i.js # apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-DoXENIdm.js # apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-Dvs_aNfV.js # apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-C0w2ihgE.js # apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-Cn4uJR7z.js # apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-vX5StZkg.js # apps/kimi-code/dist-web/assets/linear-CIHgR4nV.js # apps/kimi-code/dist-web/assets/linear-Cyvch2b1.js # apps/kimi-code/dist-web/assets/linear-eT45Pk4H.js # apps/kimi-code/dist-web/assets/markstream-2bmy7raa.js # apps/kimi-code/dist-web/assets/markstream-9V28iECG.js # apps/kimi-code/dist-web/assets/markstream-Bi91cHW2.js # apps/kimi-code/dist-web/assets/mermaid.core-BTdvNJFM.js # apps/kimi-code/dist-web/assets/mermaid.core-CPvYwC1W.js # apps/kimi-code/dist-web/assets/mermaid.core-DiA5UOGa.js # apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-B8mfB2gJ.js # apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-BBSNo4mx.js # apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-CQgNs0q1.js # apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-7cr_V7js.js # apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-BXJRnHDD.js # apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-rHOWnNl6.js # apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-BothDbBB.js # apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-Cg8SYmsf.js # apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-G7nomqX9.js # apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-BEvlLLL9.js # apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-CxGcasst.js # apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DSWGD1og.js # apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-C204BVeM.js # apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-CscD8IVT.js # apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-tMYfgW3B.js # apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-BwZTxUww.js # apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-CLYkH0vd.js # apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-CloEciiT.js # apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-4xW6Sp9V.js # apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-BXKQrGMx.js # apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-C0jx0xOM.js # apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-BIlSGrxm.js # apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-Bi6rVWH0.js # apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-DpzxIYFA.js # apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-B5b_wubp.js # apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-Do5KxOE0.js # apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-zaoKWXBh.js # apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-BvSRgWBd.js # apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-C3TCmsvu.js # apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-CSBDJyOQ.js # apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-CzbmjPLM.js # apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-JtIWmWxC.js # apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-pOtWkll_.js # apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-CkmRA3Gn.js # apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-DAdAcwVP.js # apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-DzJM0sQI.js # apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-CPRS6YoG.js # apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-DuiLWTnw.js # apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-gkI6F68k.js # apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-CSkTYLTh.js # apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-Ccb0Cha-.js # apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-DrbcV_y0.js # apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-DaNV0jkS.js # apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-qjxo9vJO.js # apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-vztNr3wj.js # apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-Bw5-f_P1.js # apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-MOZl_6XO.js # apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-UOnbMUrX.js # apps/kimi-code/dist-web/index.html
code-app: edfc878e33e13e96c792b8a269e299c10df92705
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce7f890716
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…he queue moving Pausing the queue while a queued prompt was applying its mode did not stop it: once the mode was applied, the prompt started anyway even though the queue reported itself paused. The prompt now goes back to the head of the queue with its mode already applied and starts on resume. A queued compaction that could not start was dropped with a warning, but nothing advanced the queue afterwards, so an input queued behind it waited for some unrelated activity. The queue now advances right after dropping it. The queue reported a queued compaction as pending input, so a compaction queued during a tower inbox wake cancelled the wake. A compaction never ends a regular turn, which is what re-arms the wake, so tower work stalled. Pending inputs now count only inputs. Goal continuations keep yielding to every queued item through a separate pending-items check, so back-to-back continuations do not starve a queued compaction.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b85bee5733
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
… start When a queued prompt's mode was applied but the loop then refused to start it, the prompt went back to the queue with its mode preparation still attached, so resuming the queue applied the mode again. For goal mode the second attempt failed because the goal already existed and left a misleading warning. The restored prompt now keeps the mode it already applied and starts directly on resume, the same as a prompt held by a pause.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca08778d62
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reloading a session replaces its agents, and with them their prompt queues, but the broadcaster only rebuilt the transcript for the subscribers it kept across the reload. Clients went on showing the old queue, including a paused state and entries that no longer existed, until the next queue change. Each kept subscriber now receives fresh queue snapshots after the reattach, the same as after subscribing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79cca3224d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…launch mode A prompt with a launch mode applied its mode before the loop checked that the session was still current. On a session another client had changed, a goal-mode prompt created its goal and only then failed as stale, and the automatic reload and retry hit the goal it had just created. The session check now runs before the mode is applied: an idle submit fails as stale with nothing changed, and a queued prompt stays at the head of a paused queue with a warning.
…s being active A goal continuation deferred behind queued work survived a pause of the goal, so an ordinary resume, which should not continue work on its own, still launched it once the queue drained. Leaving the active state now drops the deferred continuation together with the pending one.
Reloading a session replaces its agents, and the server queue only lives in memory, so a reload of an idle session with a paused queue silently dropped every accepted prompt. The reload action already refuses while a turn or a compaction runs; it now also refuses with 40901 while any agent still has queued prompts, the same rule the idle reaper follows. The reference documents both conditions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8989997aa6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…nd queued work Resuming a paused or blocked goal with an explicit request to continue launched nothing while the server queue still held work: the continuation could not start then, and nothing recorded it for later. After a queued compaction finished, or a queued input was withdrawn, the goal sat active and idle. The continuation is now deferred until the queue drains, like an automatic one.
The idle reaper kept sessions whose queue held prompts, but not a session whose queue was paused while empty. Reclaiming it replaced the queue with a fresh, unpaused one, silently undoing the pause, so prompts queued during the next turn started without an explicit resume. A paused queue now keeps its session loaded like queued prompts do.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0a545f066
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
endTurn clears the active turn before it waits for the wire to persist and dispatches TurnEnded, so canLaunchPrompt() already reported the loop free during that teardown. A queued goal-mode prompt could then create its goal while the goal feature still tracked the previous turn as live, and the goal adopted and charged that old turn as its starter. The loop now counts turns that are still being torn down and reports it can launch only after TurnEnded has been dispatched.
A manual reload of a current session was refused while prompts were queued, but not while an empty queue was paused. The reload replaced the queue with an unpaused one and silently undid the pause, the same problem the idle reaper already avoids. A paused queue now also blocks the reload with 40901; a session that another client changed still reloads and drops the pause.
…profile route Subagent settings stay in config; agent-scoped profile bind via REST is not part of this queue work.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7bf8b3f8f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
… REST replacement
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e9e486aa2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 084e4f769c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cc8dcb5ba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Canceling one queued prompt must not delete attachment files still referenced by another queued prompt that reused the same upload.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e00b5ce2fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…tion params Sanitized prompt ids are not injective; hash the namespace so colliding ids cannot share an attachment directory. Also declare path params on the queue action route for the OpenAPI surface.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0d93e8182
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Trimming before hashing collapsed ids that only differ by surrounding whitespace into one staging directory.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51237e1e56
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Goal mode now leaves tower like plan/swarm, and objective checks run on the post-materialization parts so attachment-only goals are accepted.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efa32dccb1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Requirement or Bug
网页端和桌面端的排队消息原先保存在客户端:刷新页面、断线重连或换一台设备就看不到;排队消息在发送那一刻才带上当时的设置;
/compact也只能在客户端排队。本 PR 把队列放到服务端:每个 agent 一个队列,支持暂停、恢复、插话、调整顺序和取消,每次变化通过 WebSocket 推给订阅者。提交接口只描述输入,模型、思考强度、权限、计划 / swarm 模式等设置统一走 profile 接口。配套的客户端改动在 MoonshotAI/kimi-code-app#1058。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
核心思路:队列放在引擎之外,输入在真正开始之前不进引擎;只有轮到它时才
loop.submit。所以暂停的队列不会挡住撤销、手动压缩和 fork。sequenceDiagram participant Client participant Route as POST /prompts participant Queue as AgentPromptQueueService participant Loop as IAgentLoopService Client->>Route: { content, delivery?, mode? } 或 { compact } Route->>Queue: submitInput / submitCompaction alt agent 空闲(且队列为空或已暂停) Queue->>Loop: prepare(mode) → submit → 开始新回合(accepted_as: turn) else delivery: steer 且回合在跑、未暂停 Queue->>Loop: submit + steer(accepted_as: steer) else 其它情况 Queue-->>Client: 进入队列(accepted_as: queue / steer) end Loop-->>Queue: onDidChangeActivity(回合结束、可插话) Queue->>Loop: pump:队首插话 / 压缩 / 下一条输入 Queue-->>Client: WS queue 帧(每次变化 + 每次订阅后一份快照)关键决策:
mode的输入排到队首、agent 空闲时,先单独执行一步应用模式(由 kap-server 提供,agent-core 不依赖各 feature 服务),这期间输入一直留在队列里,可以取消、移动、暂停;应用完只标记“已应用”,然后按普通输入的规则,在 loop 能启动时同步出队并交给 loop,没有“已出队、未启动”的中间状态。已开启的模式保持不变;plan/swarm同时退出 tower;goal用输入的metadata.display_text作为目标,先建目标再退出计划模式。提交时已有目标直接返回40913,排队期间才出现的目标则跳过创建。应用前先做与 undo / 压缩相同的会话过期检查。continueIfPaused/continueIfBlocked的显式恢复)等队列清空、引擎可以启动时再补发,排队输入自己开回合时丢弃,goal 离开 active 状态时清除。prompts/{id}:abort对还在队列里的 prompt 等同于queue/{id}:cancel。从
packages/agent-core-v2/src/agent/promptQueue/promptQueueService.ts和packages/kap-server/src/routes/prompts.ts开始看。chore: sync web dist提交是用配套 code-app 分支构建的 web 产物(dist-web)和汇总 changeset;最新一次构建基于合入了 code-app main 的配套分支,包含 main 上已发布的 web 改动。Behavior Changes and Affected Users
POST /sessions/{id}/prompts带model/thinking/permission_mode/plan_mode/swarm_mode/profile/disabled_tools/goal_objective40001(未知字段)kimi webREST 的外部脚本POST /sessions/{id}/profile的agent_config;计划 / swarm / 目标也可以用新字段mode。非 main agent:无 REST 替代(配置里的 subagent 设置;维护者确认本 PR 不补)GET /prompts可读;挂起请求会挡住撤销 / 手动压缩 / forkqueue帧推送;不再挡住撤销 / 压缩 / forkGET /prompts的客户端queue帧GET /sessions/{id}/promptsqueue帧(订阅后会收到快照)POST /sessions/{id}/prompts:steer、POST /sessions/{id}/prompts/{prompt_id}:steerdelivery: "steer",或queue/{id}:steerPOST /sessions/{id}:compactPOST /prompts提交{ compact: { instruction? } },忙时排队queue帧POST /sessions/{id}/prompts/{prompt_id}:abortPOST /sessions/{id}/profile的agent_configprofile/disabled_toolsprofile/disabled_tools的外部脚本POST /sessions/{id}:reload4090140901;会话被其他客户端改过时仍可重载,排队条目被丢弃上表删除的字段和路由由单独的 changeset
server-prompt-queue.md逐条写明,并给出替代方式;它同时写明排队中的 prompt 不再能扛过 server 重启。changeset 文案和“不做队列持久化”均已经维护者确认。客户端与服务端同版本发布:desktop 内嵌 server 随包发布,web 产物由同一个 server 提供,所以本 PR 同时携带用新客户端构建的
dist-web。队列只在内存里,没有需要迁移的持久化数据;旧版本写下的会话不受影响。TUI、print 模式、VS Code 插件、ACP 和 SDK 都不走这些 REST 路由,不受影响。已知限制:
受影响模块与测试:
agent-core-v2/agent/promptQueue:新增promptQueue.test.ts(空闲直接开回合、忙时排队按序启动、暂停与空闲直发、暂停不挡撤销、插话交接与暂停时保持队首、转插话 / 移动 / 取消、模式只在开回合前应用、应用模式期间输入仍可取消 / 移动 / 暂停、其他入口抢先开回合时输入继续排队(排队与空闲两种路径)、模式无法应用时暂停并保留输入、引擎拒绝启动时放回队首并暂停且不重复应用模式、压缩失败的警告、压缩失败后继续推进、压缩只算待处理项不算待处理输入、压缩条目)。agent-core-v2/features/goal:队列有待处理输入时推迟续跑,队列清空且引擎可以启动后补发,排队输入自己开回合后丢弃推迟的续跑。agent-core-v2/app/sessionManager:暂停的队列里还有条目时不做空闲回收。kap-server/routes/prompts:设置字段被拒、mode在开回合前应用(含退出 tower)、goal 用display_text、目标已存在时不退出计划模式、steer / 非 main agent 不能带mode、压缩提交校验;transcriptContract.e2e覆盖队列路由、queue帧、忙时排队的压缩、撤回排队中的 prompt。kap-server/transport/ws:sessionEventBroadcaster.test.ts覆盖queue帧与订阅后的快照。kliente2e harness 改用 profile 写设置、用新的压缩提交。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.