copilot-operator 0.1.94 → 0.1.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/src/api/operator.controller.js +5 -1
  2. package/dist/src/api/operator.service.js +272 -50
  3. package/dist/src/config/live.js +12 -12
  4. package/dist/src/orchestrator/kerriganRunner.js +11 -4
  5. package/dist/src/orchestrator/leadRunner.js +76 -23
  6. package/dist/src/orchestrator/review.js +6 -2
  7. package/dist/src/orchestrator/subtaskRetry.js +2 -1
  8. package/dist/src/orchestrator/taskRunner.js +75 -16
  9. package/dist/src/plan/kerrigan.js +4 -4
  10. package/dist/src/plan/systemGuide.js +12 -12
  11. package/dist/src/queue/queue.js +12 -0
  12. package/dist/src/queue/queueBranch.js +34 -9
  13. package/dist/src/session/store.js +9 -0
  14. package/dist/src/session/workspace.js +3 -2
  15. package/dist/src/transport/copilotTransport.js +83 -68
  16. package/dist/src/transport/keptWindow.js +17 -14
  17. package/dist/src/vcs/newBranch.js +23 -0
  18. package/dist/src/vcs/referenceGuard.js +16 -2
  19. package/dist/web/404.html +2 -2
  20. package/dist/web/_next/static/chunks/1024-214ded25b9048526.js +1 -0
  21. package/dist/web/_next/static/chunks/1077.161de82f740d47f0.js +1 -0
  22. package/dist/web/_next/static/chunks/1548.f2688468bf946e13.js +1 -0
  23. package/dist/web/_next/static/chunks/2163.b8ada3b7bde69f03.js +1 -0
  24. package/dist/web/_next/static/chunks/714.d1489788e598833b.js +1 -0
  25. package/dist/web/_next/static/chunks/7220.b85c8d105f394389.js +1 -0
  26. package/dist/web/_next/static/chunks/7921-00ebbcc6f65fbe35.js +1 -0
  27. package/dist/web/_next/static/chunks/8584.a678bfced1cea938.js +1 -0
  28. package/dist/web/_next/static/chunks/9067.6da03ae052877b19.js +1 -0
  29. package/dist/web/_next/static/chunks/9747.ba29e64e97e8a15b.js +1 -0
  30. package/dist/web/_next/static/chunks/app/{layout-1b7d13f7b2efd008.js → layout-2364903896c2c175.js} +1 -1
  31. package/dist/web/_next/static/chunks/app/page-d031bf326e401246.js +1 -0
  32. package/dist/web/_next/static/chunks/app/queue/page-9cfc8f78d536cfb6.js +1 -0
  33. package/dist/web/_next/static/chunks/app/settings/page-9c2b961beb8b3dce.js +1 -0
  34. package/dist/web/_next/static/chunks/{webpack-91b2de9c3da6f8b9.js → webpack-3f144d13be3516c2.js} +1 -1
  35. package/dist/web/defaults.html +2 -2
  36. package/dist/web/defaults.txt +7 -7
  37. package/dist/web/index.html +3 -3
  38. package/dist/web/index.txt +8 -8
  39. package/dist/web/queue.html +2 -2
  40. package/dist/web/queue.txt +8 -8
  41. package/dist/web/settings.html +2 -2
  42. package/dist/web/settings.txt +8 -8
  43. package/dist/web/system.html +2 -2
  44. package/dist/web/system.txt +8 -8
  45. package/package.json +1 -1
  46. package/dist/web/_next/static/chunks/1024-dee283a1ddf295bf.js +0 -1
  47. package/dist/web/_next/static/chunks/1077.b7df9cb8ca810075.js +0 -1
  48. package/dist/web/_next/static/chunks/1548.417c17b63c371f00.js +0 -1
  49. package/dist/web/_next/static/chunks/2163.469367b8fbcc862d.js +0 -1
  50. package/dist/web/_next/static/chunks/714.72112704f3cb8127.js +0 -1
  51. package/dist/web/_next/static/chunks/7220.8bd897c7ddfee701.js +0 -1
  52. package/dist/web/_next/static/chunks/7921-25d1755799107ea7.js +0 -1
  53. package/dist/web/_next/static/chunks/8584.f87df7324303ab75.js +0 -1
  54. package/dist/web/_next/static/chunks/9067.67a7c7cf3b019b5c.js +0 -1
  55. package/dist/web/_next/static/chunks/9747.a87dbd4acd45e39d.js +0 -1
  56. package/dist/web/_next/static/chunks/app/page-7eae1e8848525e1d.js +0 -1
  57. package/dist/web/_next/static/chunks/app/queue/page-7909ba7c9e3d4c2d.js +0 -1
  58. package/dist/web/_next/static/chunks/app/settings/page-c92548f9c6318962.js +0 -1
  59. /package/dist/web/_next/static/{UNygvDtRnBVZrGJt53IE4 → kNfJ9jSwlboc-1sFBBfuI}/_buildManifest.js +0 -0
  60. /package/dist/web/_next/static/{UNygvDtRnBVZrGJt53IE4 → kNfJ9jSwlboc-1sFBBfuI}/_ssgManifest.js +0 -0
@@ -264,11 +264,11 @@ These are the program's foundations. They come with it, the program holds Copilo
264
264
  - Each message is one task. The next message goes into the **same Copilot conversation**, so it can build on what was done ("now add tests for that"). ${Q('chat.newChat')} starts a conversation with nothing of the earlier one. Before each message the folder is photographed, and with ${Q('chat.rewind')} the folder is put back exactly as it was then.
265
265
  - The conversations are in the list at the top of the chat; ${Q('chat.rename')} (✎ beside it) gives the open one a name of the person's own. Every part of a conversation — a message, a reply, a command with what it printed, an ending, a plan, a question of the lead and its answer, the lead's list of subtasks — has a **Copy** button, so the person can paste any of it to you.
266
266
  - Git: the chat works on the branch the folder is on, and may commit, stage, switch or make branches, stash, merge and pull when asked; it may not push, reset, rebase, clean or clone. ${Q('nb.button')} (under the chat's box, beside the skills) fetches the latest of the remote's main and makes a new local branch from it for the next task — one that does not track main, so its work is never pushed there by mistake. When something is not committed, it asks whether to take it along, to put it aside on a branch of its own, or to commit it on the branch the folder is on now (with a message of their own or the default, not pushed); nothing is ever deleted. Whenever git needs a password, **Git opens its own window for it** (see "How you help", 12), and the work waits for it. The person commits and pushes **themselves** in the Git view: ${Q('git.commit')} (or ${Q('git.commitAll')} when nothing is staged) with a message of their own, under their own name for git, and ${Q('git.publish')} or the push beside it — that is theirs, not the chat's, which still never pushes. The project's hooks run there as in a terminal, unless one is not the project's own (not committed, changed since, or committed by the bot): then the view names it and asks. When a commit or a push does not go through, the view says why in a sentence, over git's own words; send them there first.
267
- - ${Q('nav.queue')} (in the bar on top): tasks written beforehand that run one after another while nobody watches, each in a new chat on its own model. Each has a name, ${Q('q.lead')} or a review on a model of its own, ${Q('q.skill')}, where it works (${Q('q.branchMain')} gives it a branch of its own made from main), and ${Q('q.dependsOn')}: when a task fails, the ones that depend on it are skipped and the others still run. ${Q('q.run')} starts it, ${Q('q.stop')} stops it. A task added while a message sent from the chat is working starts after it — the button then reads ${Q('q.addAfter')}. Every task needs a model named, in the task or in Settings, since nobody is there to choose one by hand. With ${Q('q.plan')}, each task's plan — the lead's, with two chats — is approved before anything changes. A task that waits for the person longer than ${Q('q.parkAfter')} allows (two minutes by default) is set aside, marked ${Q('q.parked')}, and the next task starts; its card is kept, even if the program is closed, and once answered it carries on from where it stopped. So a queue can be left running.
267
+ - ${Q('nav.queue')} (in the bar on top): tasks written beforehand that run one after another while nobody watches, each in a new chat on its own model. Each has a name, ${Q('q.lead')} or a review on a model of its own, ${Q('q.skill')}, where it works (${Q('q.branchMain')} gives it a branch of its own made from main), and ${Q('q.dependsOn')}: when a task fails, the ones that depend on it are skipped and the others still run. ${Q('q.run')} starts it, ${Q('q.stop')} stops it: the task at work, like one the program was closed under, carries on from where it stopped, in its own chat, when the queue is run again. A task added while a message sent from the chat is working starts after it — the button then reads ${Q('q.addAfter')}. Every task needs a model named, in the task or in Settings, since nobody is there to choose one by hand: the bot chooses it, even when Settings choose models by hand. With ${Q('q.plan')}, each task's plan — the lead's, with two chats — is approved before anything changes. A task that waits for the person longer than ${Q('q.parkAfter')} allows (two minutes by default) is set aside, marked ${Q('q.parked')}, and the next task starts; its card is kept, even if the program is closed, and once answered it carries on from where it stopped. So a queue can be left running.
268
268
  - ${Q('chat.lead')} (under the chat's box, for a new conversation; not ticked at first): not ticked, the chat works as it always has — one conversation that does the work; ticked, the message goes to a **lead** that directs a **worker** — see "Two chats" below. The person chooses for each conversation; to change it, they start a ${Q('chat.newChat')}.
269
269
  - ${Q('chat.kerrigan')} (under the chat's box, for a new conversation; not ticked at first): the program does by itself what the person would otherwise do with you by hand: a Kerrigan of the program's own — a conversation in the same Copilot window, told the program's foundations, the projects, the skills and the limits — directs chats of her own (${Q('kz.openChat')} shows one as it works) until the task is done (see "The way you work", step 4). Before she asks the person anything she looks in what Copilot reaches for them and has a chat look in the code. Commands still run as Settings say; platform access, scripts to run by hand, passwords and a model chosen by hand stay the person's. ${Q('exec.maxKerriganSends')} in Settings bounds how many messages she sends for one task. When the person wants a task done with the fewest stops, suggest it.
270
270
  - Limits from the settings: at most ${n(f.maxIterations)} messages to Copilot and ${n(f.maxRunMinutes)} minutes per task (the time paused, or waiting for the person — a card, Git's password window, a sign-in —, not counted), carried on by itself up to ${n(f.autoContinue)} time(s) when a limit is reached. One message in the chat can be at most ${n(MAX_INSTRUCTION_CHARS)} characters. A message the program sends to Copilot that is longer than Settings allow ("Longest message to the chat as text", 120,000 characters by default) — with a long level 2 or skill in it — goes as its beginning, with the whole text attached as a file.
271
- - ${Q('nav.defaults')} (the link at the top): the projects — each with its folder, its branch and its level 2, which is where the notes below come from —, ${Q('login.button')}, the models of the worker, the lead, Kerrigan and the review, the skills, the locators by which the bot finds things on Copilot's page (the model menu's, and "The chat's locators"), "Steps to the chat", and how a task runs, including retrying an interrupted subtask. Every field there has an ⓘ that says what it is for. A setting saved while a message is at work takes effect without a restart: the rules a step is judged by, the limits, the locators and the steps at once (in the Copilot window that is open, too); the models, plan mode, the project and the skills from the next message; the chat's address, browser and waits when the window opens again — a notice after saving says which. A project can be marked ${Q('proj.readOnly')}: the bot then reads it and runs what only reads it, but changes nothing in it — whatever a command changes there is put back and the chat is told; on the chat's own folder every message can then only read and report. The base prompt (level 1), the text that tells Copilot how to work, is shown there to read; it changes only when the program is updated, and the foundations at the top of this text are its rules: nothing written in Settings, in a skill or in a task changes them. ${Q('nav.system')} is the report on the machine — the version, the program's folder, what the terminal showed, and an export of everything the bot keeps, for when something has to be looked into.
271
+ - ${Q('nav.defaults')} (the link at the top): the projects — each with its folder, its branch and its level 2, which is where the notes below come from —, ${Q('login.button')}, the models of the worker, the lead, Kerrigan and the review, the skills, the locators by which the bot finds things on Copilot's page (the model menu's, and "The chat's locators"), "Steps to the chat", and how a task runs, including retrying an interrupted subtask. Every field there has an ⓘ that says what it is for. A setting saved while a message is at work takes effect without a restart: the rules a step is judged by, the limits, the locators, the steps and the window's waits at once (in the Copilot window that is open, too); the models, plan mode, the project and the skills from the next message; the chat's address and browser when the window opens again — a notice after saving says which. A project can be marked ${Q('proj.readOnly')}: the bot then reads it and runs what only reads it, but changes nothing in it — whatever a command changes there is put back and the chat is told; on the chat's own folder, or one that holds it, every message can then only read and report. The base prompt (level 1), the text that tells Copilot how to work, is shown there to read; it changes only when the program is updated, and the foundations at the top of this text are its rules: nothing written in Settings, in a skill or in a task changes them. ${Q('nav.system')} is the report on the machine — the version, the program's folder, what the terminal showed, and an export of everything the bot keeps, for when something has to be looked into.
272
272
  - **When Copilot's page changes.** The program finds the box, Send, the answers, the sidebar, an attached file and the model menu on Copilot's page by locators (CSS or XPath), all editable in Settings, and takes the steps on the way to the chat — declining first-run dialogs, closing Office's feedback panel, naming the conversation —, which can be switched off there, with steps of the person's own added ("if this is on the page, do this"). When a locator finds nothing, the work stops (or, for what it can do without, goes on), and a notice on every page names it, with ${Q('chatloc.file')}, ${Q('chatloc.fix')} (its field in red) and ${Q('chatloc.dismiss')}; ${Q('chatloc.check')} in Settings looks for all of them at once. The file holds all a chatbot needs to give the new locator — and you are such a chatbot: when the person attaches it to you, do what it says (see "How you help").
273
273
  - When the work is over — nothing runs, the queue is done, nothing waits — a large ${Q('done.label')} shows in the middle of the window ("Finished: …" when it did not end well); a click or a key takes it away. Before every message the program puts the Copilot window back on its own conversation — by its address, after a sign-in, or by its name in the sidebar; when it cannot, nothing is sent anywhere and the message stops, saying so: then look for the conversation in Copilot's sidebar, and carry on with ${Q('chat.carryOn')}, or start a ${Q('chat.newChat')}.
274
274
 
@@ -381,11 +381,11 @@ function bgText(f) {
381
381
  - Всяко съобщение е едно задание. Следващото съобщение отива в **същия разговор в Copilot**, така че може да надгражда („сега добави тестове за това“). ${Q('chat.newChat')} започва разговор без нищо от предишния. Преди всяко съобщение папката се „снима“ и с ${Q('chat.rewind')} папката се връща точно каквато е била тогава.
382
382
  - Разговорите са в списъка най-горе в чата; ${Q('chat.rename')} (✎ до него) дава на отворения разговор име по избор на човека. Всяка част от разговора — съобщение, отговор, команда с изписаното от нея, край, план, въпрос на ръководителя и отговорът му, списъкът с подзадачи на ръководителя — има бутон **Копирай**, така че човекът може да ти постави която и да е от тях.
383
383
  - Git: чатът работи на бранча, на който е папката, и може да комитва, да добавя, да сменя или прави бранчове, да прибира настрана (stash), да слива и да изтегля (pull), когато е помолен; не може да прави push, reset, rebase, clean или clone. ${Q('nb.button')} (под полето на чата, до skill-овете) взима последното от main на remote и прави от него нов локален бранч за следващата задача — такъв, който не следи main, така че работата му никога не отива там по грешка. Когато има некомитнато, пита дали да се вземе, да се остави настрана в отделен бранч или да се commit-не в бранча, на който е папката сега (със съобщение на човека или по подразбиране, без push); нищо никога не се изтрива. Когато git има нужда от парола, **Git отваря свой прозорец за нея** (виж „Как помагаш“, 12), а работата я чака. Човекът комитва и прави push **сам** в изгледа Git: ${Q('git.commit')} (или ${Q('git.commitAll')}, когато нищо не е подготвено) със свое съобщение и със своето име в git, и ${Q('git.publish')} или push-а до него — това е негово, не на чата, който пак никога не прави push. Hook-овете на проекта се пускат там както в терминал, освен ако някой не е собствен на проекта (не е комитнат, променен е след това или е комитнат от бота): тогава изгледът го назовава и пита. Когато комит или push не мине, изгледът казва защо с едно изречение, над собствените думи на git; първо прати човека там.
384
- - ${Q('nav.queue')} (в лентата горе): задачи, написани предварително, които се изпълняват една след друга, докато човекът го няма, всяка в нов чат със свой модел. Всяка има име, ${Q('q.lead')} или рецензия със собствен модел, ${Q('q.skill')}, къде работи (${Q('q.branchMain')} ѝ дава отделен бранч, направен от main) и ${Q('q.dependsOn')}: когато задача се провали, тези, които зависят от нея, се прескачат, а другите продължават. ${Q('q.run')} я пуска, ${Q('q.stop')} я спира. Задача, добавена, докато работи съобщение, пуснато от чата, започва след него — тогава бутонът е ${Q('q.addAfter')}. Всяка задача трябва да има посочен модел — в задачата или в Настройки, — защото няма кой да го избере ръчно. С ${Q('q.plan')} планът на всяка задача — на ръководителя, при два чата — се одобрява, преди нещо да се промени. Задача, която чака човека по-дълго, отколкото позволява ${Q('q.parkAfter')} (по подразбиране две минути), се оставя настрана, отбелязана ${Q('q.parked')}, и започва следващата; картата ѝ се пази, дори ако програмата бъде затворена, а след отговор продължава оттам, където е спряла. Така опашката може да се остави да работи.
384
+ - ${Q('nav.queue')} (в лентата горе): задачи, написани предварително, които се изпълняват една след друга, докато човекът го няма, всяка в нов чат със свой модел. Всяка има име, ${Q('q.lead')} или рецензия със собствен модел, ${Q('q.skill')}, къде работи (${Q('q.branchMain')} ѝ дава отделен бранч, направен от main) и ${Q('q.dependsOn')}: когато задача се провали, тези, които зависят от нея, се прескачат, а другите продължават. ${Q('q.run')} я пуска, ${Q('q.stop')} я спира: задачата в ход, както и тази, под която програмата е затворена, продължава оттам, докъдето е стигнала, в своя чат, когато опашката се пусне пак. Задача, добавена, докато работи съобщение, пуснато от чата, започва след него — тогава бутонът е ${Q('q.addAfter')}. Всяка задача трябва да има посочен модел — в задачата или в Настройки, — защото няма кой да го избере ръчно: ботът го избира, дори когато Настройки избират моделите на ръка. С ${Q('q.plan')} планът на всяка задача — на ръководителя, при два чата — се одобрява, преди нещо да се промени. Задача, която чака човека по-дълго, отколкото позволява ${Q('q.parkAfter')} (по подразбиране две минути), се оставя настрана, отбелязана ${Q('q.parked')}, и започва следващата; картата ѝ се пази, дори ако програмата бъде затворена, а след отговор продължава оттам, където е спряла. Така опашката може да се остави да работи.
385
385
  - ${Q('chat.lead')} (под полето на чата, за нов разговор; в началото не е отметнато): неотметнато, чатът работи както винаги — един разговор, който върши работата; отметнато, съобщението отива при **ръководител**, който ръководи **изпълнител** — виж „Два чата“ по-долу. Човекът избира за всеки разговор; за да го смени, започва ${Q('chat.newChat')}.
386
386
  - ${Q('chat.kerrigan')} (под полето на чата, за нов разговор; в началото не е отметнато): програмата прави сама това, което иначе човекът прави с теб на ръка: Кериган на самата програма — разговор в същия прозорец на Copilot, на който са дадени основите на програмата, проектите, skill-овете и ограниченията — ръководи свои чатове (${Q('kz.openChat')} показва такъв, докато работи), докато задачата стане готова (виж „Как работиш“, стъпка 4). Преди да попита човека нещо, търси в това, до което Copilot стига за него, и праща чат да погледне в кода. Командите пак вървят, както казват Настройки; достъпът до платформи, скриптовете за ръчно пускане, паролите и ръчно избраният модел остават на човека. ${Q('exec.maxKerriganSends')} в Настройки ограничава колко съобщения праща тя за една задача. Когато човекът иска задача да мине с възможно най-малко спирания, предложи го.
387
387
  - Ограничения от настройките: най-много ${n(f.maxIterations)} съобщения към Copilot и ${n(f.maxRunMinutes)} минути на задание (без времето на пауза и на чакане за човека — карта, прозорецът на Git за парола, вход), продължено само до ${n(f.autoContinue)} път(и), когато се стигне ограничение. Едно съобщение в чата може да е най-много ${n(MAX_INSTRUCTION_CHARS)} знака. Съобщение, което програмата праща на Copilot и което е по-дълго, отколкото позволяват Настройки („Най-дълго съобщение към чата като текст“, 120 000 знака по подразбиране) — с дълъг шаблон ниво 2 или skill в него, — отива като началото си, а целият текст се прикачва като файл.
388
- - ${Q('nav.defaults')} (връзката горе): проектите — всеки с папката, клона и шаблона си ниво 2, откъдето са бележките по-долу, —, ${Q('login.button')}, моделите на изпълнителя, на ръководителя, на Кериган и на рецензията, skill-овете, локаторите, по които ботът намира нещата в страницата на Copilot (на менюто с модели и „Локатори на чата“), „Стъпки до чата“ и как върви едно задание, включително повторението на прекъсната подзадача. Всяко поле там има ⓘ, което казва за какво е. Настройка, записана докато работи съобщение, важи без рестарт: правилата, по които се преценява стъпка, ограниченията, локаторите и стъпките — веднага (и в отворения прозорец на Copilot); моделите, „Първо план“, проектът и skill-овете — от следващото съобщение; адресът на чата, браузърът и изчакванията — когато прозорецът се отвори отново; съобщение след записа казва кое. Проект може да се отбележи ${Q('proj.readOnly')}: тогава ботът го чете и пуска това, което само го чете, но не променя нищо в него — каквото команда промени там, се връща, и чатът научава; ако е папката на чата, всяко съобщение може само да чете и да докладва. Основният prompt (ниво 1) — текстът, който казва на Copilot как да работи — е показан там за четене; сменя се само когато програмата се обнови, а основите в началото на този текст са негови правила: нищо, написано в Настройки, в skill или в задание, не ги променя. ${Q('nav.system')} е отчетът за машината — версията, папката на програмата, какво е показал терминалът и експорт на всичко, което ботът пази, когато нещо трябва да се проучи.
388
+ - ${Q('nav.defaults')} (връзката горе): проектите — всеки с папката, клона и шаблона си ниво 2, откъдето са бележките по-долу, —, ${Q('login.button')}, моделите на изпълнителя, на ръководителя, на Кериган и на рецензията, skill-овете, локаторите, по които ботът намира нещата в страницата на Copilot (на менюто с модели и „Локатори на чата“), „Стъпки до чата“ и как върви едно задание, включително повторението на прекъсната подзадача. Всяко поле там има ⓘ, което казва за какво е. Настройка, записана докато работи съобщение, важи без рестарт: правилата, по които се преценява стъпка, ограниченията, локаторите, стъпките и изчакванията на прозореца — веднага (и в отворения прозорец на Copilot); моделите, „Първо план“, проектът и skill-овете — от следващото съобщение; адресът на чата и браузърът — когато прозорецът се отвори отново; съобщение след записа казва кое. Проект може да се отбележи ${Q('proj.readOnly')}: тогава ботът го чете и пуска това, което само го чете, но не променя нищо в него — каквото команда промени там, се връща, и чатът научава; ако е папката на чата или я съдържа, всяко съобщение може само да чете и да докладва. Основният prompt (ниво 1) — текстът, който казва на Copilot как да работи — е показан там за четене; сменя се само когато програмата се обнови, а основите в началото на този текст са негови правила: нищо, написано в Настройки, в skill или в задание, не ги променя. ${Q('nav.system')} е отчетът за машината — версията, папката на програмата, какво е показал терминалът и експорт на всичко, което ботът пази, когато нещо трябва да се проучи.
389
389
  - **Когато страницата на Copilot се смени.** Програмата намира полето, „Send“, отговорите, страничната лента, прикачения файл и менюто с модели в страницата на Copilot по локатори (CSS или XPath), които всички се променят в Настройки, и минава стъпките до чата — отказва диалозите при първо пускане, затваря панела за обратна връзка на Office, именува разговора, — които там могат да се изключат, и към тях могат да се добавят стъпки на човека („ако това е на страницата, направи това“). Когато локатор не намери нищо, работата спира (или, за каквото може и без него, продължава), а съобщение на всяка страница го назовава, с ${Q('chatloc.file')}, ${Q('chatloc.fix')} (полето му в червено) и ${Q('chatloc.dismiss')}; ${Q('chatloc.check')} в Настройки търси всички наведнъж. Файлът съдържа всичко, нужно на чатбот, за да даде новия локатор — а ти си такъв чатбот: когато човекът ти го прикачи, направи каквото казва той (виж „Как помагаш“).
390
390
  - Когато работата свърши — нищо не работи, опашката е минала, нищо не чака, — голямо ${Q('done.label')} се показва в средата на прозореца („Приключи: …“, когато не е завършило добре); едно натискане или клавиш го махат. Преди всяко съобщение програмата връща прозореца на Copilot на собствения му разговор — по адреса му, след вход или по името му в страничната лента; когато не може, нищо не се изпраща никъде и съобщението спира, като го казва: тогава потърси разговора в страничната лента на Copilot и продължи с ${Q('chat.carryOn')} или започни ${Q('chat.newChat')}.
391
391
 
@@ -241,8 +241,8 @@ export const SYSTEM_GUIDE = [
241
241
  kind: 'note',
242
242
  en: 'Step {n} is waiting for you',
243
243
  bg: 'Стъпка {n} чака вашето решение',
244
- doesEn: 'A card for each step that waits for you, with the exact command. The browser tab shows "(n) waiting for you".',
245
- doesBg: 'Карта за всяка стъпка, която чака вас, с точната команда. Разделът на браузъра показва „(n) чака вас“.',
244
+ doesEn: 'A card for each step that waits for you, with the exact command. The browser tab says "Waiting for you (n) — copilot-operator".',
245
+ doesBg: 'Карта за всяка стъпка, която чака вас, с точната команда. Разделът на браузъра казва „Waiting for you (n) — copilot-operator“.',
246
246
  },
247
247
  {
248
248
  key: 'awaiting.title',
@@ -806,8 +806,8 @@ export const SYSTEM_GUIDE = [
806
806
  kind: 'badge',
807
807
  en: 'LIVE',
808
808
  bg: 'LIVE',
809
- doesEn: 'Beside "Chat" while the bot works, red (amber while paused); on hover it says who is at work. The browser tab says it too: "● Worker at work — copilot-operator", or "(1) waiting for you" when something waits for the operator.',
810
- doesBg: 'До „Чат“, докато ботът работи — червено (жълто на пауза); при посочване казва кой работи. Казва го и табът на браузъра: „● Работи: Изпълнител — copilot-operator“, или „(1) чака вас“, когато нещо чака оператора.',
809
+ doesEn: 'Beside "Chat" while the bot works, red (amber while paused); on hover it says who is at work. The browser tab says how it stands, in English whatever language the page is in: "Working... — copilot-operator", "Paused", "Waiting for you (1)" when something waits for the operator, "Waiting for your password"; then how the last message ended — "Done", "Error", "Stopped", "Blocked", "Limit reached".',
810
+ doesBg: 'До „Чат“, докато ботът работи — червено (жълто на пауза); при посочване казва кой работи. Табът на браузъра казва как стоят нещата, на английски на всеки език на страницата: „Working... — copilot-operator“, „Paused“, „Waiting for you (1)“, когато нещо чака оператора, „Waiting for your password“; после как е свършило последното съобщение — „Done“, „Error“, „Stopped“, „Blocked“, „Limit reached“.',
811
811
  },
812
812
  {
813
813
  key: 'actor.asks',
@@ -902,8 +902,8 @@ export const SYSTEM_GUIDE = [
902
902
  kind: 'button',
903
903
  en: 'Try again',
904
904
  bg: 'Опитай отново',
905
- doesEn: 'When the remote could not be fetched — a password not given, a network down: fetches again, and Git asks for the password again if it must. Beside it, the branch can be made from what was last fetched here.',
906
- doesBg: 'Когато remote-ът не е могъл да бъде взет — непоставена парола, липса на мрежа: взима отново, и Git пак пита за паролата, ако трябва. До него бранчът може да се направи от последно взетото тук.',
905
+ doesEn: 'When the remote could not be fetched — a password not given, a network down: fetches again, and Git asks for the password again if it must. Beside it, the branch can be made from what was last fetched here. Also when making the branch was refused (the folder changed since it was read): reads the folder again, the name kept.',
906
+ doesBg: 'Когато remote-ът не е могъл да бъде взет — непоставена парола, липса на мрежа: взима отново, и Git пак пита за паролата, ако трябва. До него бранчът може да се направи от последно взетото тук. Също когато създаването на бранча е отказано (папката се е променила, откакто е прочетена): прочита папката отново, името остава.',
907
907
  },
908
908
  {
909
909
  key: 'nb.making',
@@ -1954,8 +1954,8 @@ export const SYSTEM_GUIDE = [
1954
1954
  kind: 'button',
1955
1955
  en: 'Stop the queue',
1956
1956
  bg: 'Спри опашката',
1957
- doesEn: 'Stops the task at work, as the chat\'s Stop does; the rest wait.',
1958
- doesBg: 'Спира задачата, която работи, както Спри в чата; останалите чакат.',
1957
+ doesEn: 'Stops the task at work, as the chat\'s Stop does; it carries on from there, and the rest after it, when the queue is run again.',
1958
+ doesBg: 'Спира задачата, която работи, както Спри в чата; тя продължава оттам, а след нея и останалите, когато опашката се пусне пак.',
1959
1959
  },
1960
1960
  {
1961
1961
  key: 'q.stopping',
@@ -1994,8 +1994,8 @@ export const SYSTEM_GUIDE = [
1994
1994
  kind: 'button',
1995
1995
  en: 'Edit',
1996
1996
  bg: 'Редактирай',
1997
- doesEn: 'Opens a waiting task in the form below, to change it.',
1998
- doesBg: 'Отваря чакаща задача във формата отдолу, за да се промени.',
1997
+ doesEn: 'Opens a waiting task in the form below, to change it. One that carries on in its own chat starts over in a new chat when what it does is changed; a new name or what it depends on keeps it carrying on.',
1998
+ doesBg: 'Отваря чакаща задача във формата отдолу, за да се промени. Задача, която продължава в своя чат, започва отначало в нов чат, когато се промени това, което прави; ново име или зависимости я оставят да продължи.',
1999
1999
  },
2000
2000
  {
2001
2001
  key: 'q.up',
@@ -2217,8 +2217,8 @@ export const SYSTEM_GUIDE = [
2217
2217
  kind: 'note',
2218
2218
  en: 'While a message is at work, a change here takes effect at once where it can: the rules a step is judged by, the limits, the pauses and the reports. The models, plan mode, the project, the skills and the like apply from the next message; the chat window\'s own settings from the next time it opens.',
2219
2219
  bg: 'Докато работи съобщение, промяна тук влиза в сила веднага, където може: правилата, по които се преценява всяка стъпка, ограниченията, паузите и отчетите. Моделите, режимът с план, проектът, уменията и други такива важат от следващото съобщение, а настройките на самия прозорец на чата — от следващото му отваряне.',
2220
- doesEn: 'A setting saved while a message is at work: the rules a step is judged by (programs, scripts, downloads, deny patterns…), the limits, pauses and reports, the locators and the steps to the chat take effect at once, in the open Copilot window too; the models, plan mode, the folder, the project and the skills from the next message; the window\'s address, browser and waits when it opens again.',
2221
- doesBg: 'Настройка, записана докато работи съобщение: правилата за стъпките (програми, скриптове, изтегляния, забранени шаблони…), ограниченията, паузите и отчетите, локаторите и стъпките до чата важат веднага, и в отворения прозорец на Copilot; моделите, „Първо план“, папката, проектът и skill-овете — от следващото съобщение; адресът, браузърът и изчакванията на прозореца — когато се отвори отново.',
2220
+ doesEn: 'A setting saved while a message is at work: the rules a step is judged by (programs, scripts, downloads, deny patterns…), every limit, the pauses and reports, the locators, the steps to the chat and the window\'s waits take effect at once, in the open Copilot window too; the models, plan mode, the folder, the project and the skills from the next message; the window\'s address and browser when it opens again.',
2221
+ doesBg: 'Настройка, записана докато работи съобщение: правилата за стъпките (програми, скриптове, изтегляния, забранени шаблони…), всички ограничения, паузите и отчетите, локаторите, стъпките до чата и изчакванията на прозореца важат веднага, и в отворения прозорец на Copilot; моделите, „Първо план“, папката, проектът и skill-овете — от следващото съобщение; адресът и браузърът на прозореца — когато се отвори отново.',
2222
2222
  },
2223
2223
  {
2224
2224
  key: 'live.close',
@@ -120,6 +120,14 @@ export function mergeItems(current, edited) {
120
120
  // A parked task keeps what it waits for; its answer is given on its card, not by an edit of the list.
121
121
  if (was.status === 'parked')
122
122
  return { ...was, ...given, status: 'parked' };
123
+ /*
124
+ * A task that carries on in its own chat (`resume`: the queue stopped or the bot closed under it, or answered after it
125
+ * was set aside) carries on as it was given there, so an edit of what it does was kept and never used (bug hunt
126
+ * 2026-11-18). Such an edit starts it over, as "Run again" does, with the edit; its name and what it depends on are
127
+ * the queue's own, and leave it carrying on.
128
+ */
129
+ if (was.resume && WHAT_IT_DOES.some((key) => asSaid(was[key]) !== asSaid(given[key])))
130
+ return { ...given, status: 'waiting' };
123
131
  // Where it works changed: the branch made for it no longer is its.
124
132
  if (was.branch !== given.branch) {
125
133
  const { branchName: _name, branchBase: _base, ...rest } = was;
@@ -135,6 +143,10 @@ export function mergeItems(current, edited) {
135
143
  }
136
144
  /** What the operator gives a task, apart from what its runs give it. */
137
145
  const GIVEN = ['id', 'name', 'prompt', 'model', 'dependsOn', 'branch', 'review', 'reviewModel', 'lead', 'workerModel', 'skill', 'plan'];
146
+ /** Of what is given, what the task's chat is told: an edit of it starts over a task that carries on. */
147
+ const WHAT_IT_DOES = ['prompt', 'model', 'branch', 'review', 'reviewModel', 'lead', 'workerModel', 'skill', 'plan'];
148
+ /** A field as an edit says it: off, empty or left out are the same. */
149
+ const asSaid = (v) => JSON.stringify(v === false || v === '' || v === null ? undefined : v) ?? '';
138
150
  function asGiven(x) {
139
151
  const out = {};
140
152
  for (const key of GIVEN)
@@ -38,29 +38,54 @@ export async function makeQueueBranch(dir, id, title, start) {
38
38
  return { problem: (made.stderr || made.stdout || `the branch ${branch} could not be made`).split(/\r?\n/)[0] };
39
39
  return { branch, base: start.commit };
40
40
  }
41
+ /** The remotes of a repository, by name. */
42
+ async function remotesOf(dir) {
43
+ return (await git(dir, ['remote'])).stdout.split(/\r?\n/).map((r) => r.trim()).filter(Boolean);
44
+ }
45
+ /**
46
+ * The remote's branch a queue branch is brought up to: the one it was made from (`origin/master`, `upstream/main`), or,
47
+ * made from a local main when the remote could not be read then, that main on the remote (`origin` first). Not `main`
48
+ * of `origin` whatever the repository has (bug hunt 2026-11-18): one whose remote's default is `master`, or whose remote
49
+ * is not `origin`, was never brought up to date, and its chat was told it was made from a local main.
50
+ */
51
+ export async function remoteMainOf(dir, from) {
52
+ const remotes = await remotesOf(dir);
53
+ const said = (from ?? '').trim();
54
+ const at = said.indexOf('/');
55
+ if (at > 0 && remotes.includes(said.slice(0, at)))
56
+ return { remote: said.slice(0, at), ref: said.slice(at + 1) };
57
+ const remote = remotes.includes('origin') ? 'origin' : remotes[0];
58
+ return remote ? { remote, ref: said || 'main' } : null;
59
+ }
60
+ /** Whether a branch was made from a remote's branch (`origin/main`), not from a local one (`main`). */
61
+ export async function madeFromRemote(dir, from) {
62
+ const at = from.indexOf('/');
63
+ return at > 0 && (await remotesOf(dir)).includes(from.slice(0, at));
64
+ }
41
65
  /**
42
66
  * At the task's start: the branch brought up to the remote's main when nothing has been done on it yet — still at the
43
67
  * commit it was made at — and the remote can be read without asking anybody (nobody may be there). Forward only.
68
+ * `from`: what it was made from (`BranchStart.from`), which names the remote and its main.
44
69
  */
45
- export async function refreshQueueBranch(dir, branch, base) {
70
+ export async function refreshQueueBranch(dir, branch, base, from) {
46
71
  const tip = (await git(dir, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}^{commit}`])).stdout;
47
72
  if (!tip)
48
73
  return { base, moved: false, detail: `there is no branch ${branch} any more` };
49
74
  if (tip !== base)
50
75
  return { base, moved: false, detail: 'work is on it already' };
51
- const remotes = (await git(dir, ['remote'])).stdout.split(/\r?\n/).map((r) => r.trim()).filter(Boolean);
52
- const remote = remotes.includes('origin') ? 'origin' : remotes[0];
53
- if (!remote)
76
+ const main = await remoteMainOf(dir, from);
77
+ if (!main)
54
78
  return { base, moved: false, detail: 'no remote' };
55
- const fetched = await fetchAsOperator(dir, remote, { askpass: null, refspecs: [`+refs/heads/main:refs/remotes/${remote}/main`] });
79
+ const { remote, ref } = main;
80
+ const fetched = await fetchAsOperator(dir, remote, { askpass: null, refspecs: [`+refs/heads/${ref}:refs/remotes/${remote}/${ref}`] });
56
81
  if (!fetched.ok)
57
82
  return { base, moved: false, detail: fetched.detail };
58
- const latest = (await git(dir, ['rev-parse', '--verify', '--quiet', `refs/remotes/${remote}/main^{commit}`])).stdout;
83
+ const latest = (await git(dir, ['rev-parse', '--verify', '--quiet', `refs/remotes/${remote}/${ref}^{commit}`])).stdout;
59
84
  if (!latest || latest === base)
60
85
  return { base, moved: false };
61
86
  if (!(await isAncestor(dir, base, latest)))
62
- return { base, moved: false, detail: `${remote}/main went another way` };
87
+ return { base, moved: false, detail: `${remote}/${ref} went another way` };
63
88
  const current = (await git(dir, ['symbolic-ref', '--quiet', '--short', 'HEAD'])).stdout;
64
- const moved = current === branch ? await git(dir, ['merge', '--ff-only', '--quiet', latest]) : await git(dir, ['update-ref', '-m', `copilot-operator: ${branch} brought up to ${remote}/main`, `refs/heads/${branch}`, latest, base]);
65
- return moved.ok ? { base: latest, moved: true } : { base, moved: false, detail: (moved.stderr || moved.stdout).split(/\r?\n/)[0] };
89
+ const moved = current === branch ? await git(dir, ['merge', '--ff-only', '--quiet', latest]) : await git(dir, ['update-ref', '-m', `copilot-operator: ${branch} brought up to ${remote}/${ref}`, `refs/heads/${branch}`, latest, base]);
90
+ return moved.ok ? { base: latest, moved: true, from: `${remote}/${ref}` } : { base, moved: false, detail: (moved.stderr || moved.stdout).split(/\r?\n/)[0] };
66
91
  }
@@ -815,6 +815,15 @@ async function removeFile(path) {
815
815
  async function replaceFile(path, content) {
816
816
  const tmp = `${path}.${process.pid}.${randomUUID()}.tmp`;
817
817
  await writeFile(tmp, content, 'utf8');
818
+ await moveOver(tmp, path);
819
+ }
820
+ /**
821
+ * Moves a file written beside another over it, trying again while Windows refuses for a moment (see `replaceFile`), and
822
+ * takes the file written away when it cannot. Also the workbench editor's save (bug hunt 2026-11-18): it renamed once, so
823
+ * a save while VS Code or a virus scanner had the file open failed, and left its `.cop-save-…` file in the project,
824
+ * where "Commit all" could take it.
825
+ */
826
+ export async function moveOver(tmp, path) {
818
827
  const backoffMs = [10, 25, 60, 120, 250, 500];
819
828
  for (let attempt = 0;; attempt += 1) {
820
829
  try {
@@ -6,9 +6,10 @@
6
6
  */
7
7
  import { createHash } from 'node:crypto';
8
8
  import { existsSync, statSync } from 'node:fs';
9
- import { readdir, readFile, rename, stat, writeFile } from 'node:fs/promises';
9
+ import { readdir, readFile, stat, writeFile } from 'node:fs/promises';
10
10
  import { basename, isAbsolute, join, relative, resolve, sep } from 'node:path';
11
11
  import { git, looksLikeRepo, repoState } from '../vcs/git.js';
12
+ import { moveOver } from './store.js';
12
13
  export async function workspaceInfo(dir, name = '') {
13
14
  const d = dir.trim();
14
15
  if (!d)
@@ -135,6 +136,6 @@ export async function saveWorkspaceFile(dir, path, text, base) {
135
136
  // Written beside it and moved over it, so a file is never left half written.
136
137
  const temp = `${full}.cop-save-${process.pid}`;
137
138
  await writeFile(temp, bytes);
138
- await rename(temp, full);
139
+ await moveOver(temp, full);
139
140
  return { path: clean, version: versionOf(bytes), size: bytes.length };
140
141
  }
@@ -218,65 +218,65 @@ const NOTICE_ID = 'copilot-operator-notice';
218
218
  * impossible — the runner notes it before the click and waits for it to move, so a copy that
219
219
  * did not happen reads as a failure rather than as the previous answer.
220
220
  */
221
- export const CLIPBOARD_GUARD = `(() => {
222
- const state = { text: '', seq: 0 };
223
- try {
224
- Object.defineProperty(window, '__copClipboard', { value: state, enumerable: false });
225
- } catch (e) {
226
- window.__copClipboard = state;
227
- }
228
-
229
- const remember = (text) => {
230
- if (typeof text !== 'string' || text.length === 0) return;
231
- state.text = text;
232
- state.seq += 1;
233
- };
234
-
235
- const clip = navigator.clipboard;
236
- if (clip) {
237
- try {
238
- Object.defineProperty(clip, 'writeText', {
239
- configurable: true,
240
- writable: true,
241
- value: (text) => {
242
- remember(String(text));
243
- return Promise.resolve();
244
- },
245
- });
246
- } catch (e) { /* a frame that will not let its clipboard be replaced reads as a failure later */ }
247
-
248
- try {
249
- Object.defineProperty(clip, 'write', {
250
- configurable: true,
251
- writable: true,
252
- value: async (items) => {
253
- for (const item of items || []) {
254
- try {
255
- if (item && item.types && item.types.indexOf('text/plain') >= 0) {
256
- remember(await (await item.getType('text/plain')).text());
257
- }
258
- } catch (e) { /* one unreadable item is not a reason to drop the rest */ }
259
- }
260
- },
261
- });
262
- } catch (e) { /* as above */ }
263
- }
264
-
265
- // The old way: select text in a hidden field, then execCommand('copy'). The selection is
266
- // exactly the text being copied, so it is taken and the command is never run.
267
- try {
268
- const realExec = document.execCommand.bind(document);
269
- document.execCommand = (command, ...rest) => {
270
- if (String(command).toLowerCase() === 'copy') {
271
- const selected = String(window.getSelection() || '');
272
- if (selected.length > 0) {
273
- remember(selected);
274
- return true;
275
- }
276
- }
277
- return realExec(command, ...rest);
278
- };
279
- } catch (e) { /* as above */ }
221
+ export const CLIPBOARD_GUARD = `(() => {
222
+ const state = { text: '', seq: 0 };
223
+ try {
224
+ Object.defineProperty(window, '__copClipboard', { value: state, enumerable: false });
225
+ } catch (e) {
226
+ window.__copClipboard = state;
227
+ }
228
+
229
+ const remember = (text) => {
230
+ if (typeof text !== 'string' || text.length === 0) return;
231
+ state.text = text;
232
+ state.seq += 1;
233
+ };
234
+
235
+ const clip = navigator.clipboard;
236
+ if (clip) {
237
+ try {
238
+ Object.defineProperty(clip, 'writeText', {
239
+ configurable: true,
240
+ writable: true,
241
+ value: (text) => {
242
+ remember(String(text));
243
+ return Promise.resolve();
244
+ },
245
+ });
246
+ } catch (e) { /* a frame that will not let its clipboard be replaced reads as a failure later */ }
247
+
248
+ try {
249
+ Object.defineProperty(clip, 'write', {
250
+ configurable: true,
251
+ writable: true,
252
+ value: async (items) => {
253
+ for (const item of items || []) {
254
+ try {
255
+ if (item && item.types && item.types.indexOf('text/plain') >= 0) {
256
+ remember(await (await item.getType('text/plain')).text());
257
+ }
258
+ } catch (e) { /* one unreadable item is not a reason to drop the rest */ }
259
+ }
260
+ },
261
+ });
262
+ } catch (e) { /* as above */ }
263
+ }
264
+
265
+ // The old way: select text in a hidden field, then execCommand('copy'). The selection is
266
+ // exactly the text being copied, so it is taken and the command is never run.
267
+ try {
268
+ const realExec = document.execCommand.bind(document);
269
+ document.execCommand = (command, ...rest) => {
270
+ if (String(command).toLowerCase() === 'copy') {
271
+ const selected = String(window.getSelection() || '');
272
+ if (selected.length > 0) {
273
+ remember(selected);
274
+ return true;
275
+ }
276
+ }
277
+ return realExec(command, ...rest);
278
+ };
279
+ } catch (e) { /* as above */ }
280
280
  })();`;
281
281
  /**
282
282
  * A locator of the chat that found nothing where the bot needed it (operator, 2026-11-17: "a mechanism that detects
@@ -388,6 +388,16 @@ export class CopilotTransport {
388
388
  * a save while a message is at work does the same. What cannot be used is said as when a window opens.
389
389
  */
390
390
  takeSettings(o) {
391
+ /*
392
+ * The waits too (bug hunt 2026-11-18): the window kept open between messages went on, for days, with the reply,
393
+ * sign-in and verification waits it was opened with, though Settings had changed them.
394
+ */
395
+ if (o.replyTimeoutMs !== undefined)
396
+ this.opts.replyTimeoutMs = o.replyTimeoutMs;
397
+ if (o.signInTimeoutMs !== undefined)
398
+ this.opts.signInTimeoutMs = o.signInTimeoutMs;
399
+ if (o.humanWaitMs !== undefined)
400
+ this.opts.humanWaitMs = o.humanWaitMs;
391
401
  const picker = resolvePickerLocators(o.pickerLocators);
392
402
  this.locators = picker.locators;
393
403
  this.locatorProblems = picker.problems;
@@ -744,7 +754,7 @@ export class CopilotTransport {
744
754
  * this". One that must be there and is not, within its seconds, stops the work like a locator that found nothing,
745
755
  * said by its name; one that need not be is passed over.
746
756
  */
747
- async runSteps(when, signal) {
757
+ async runSteps(when, signal, lookOnly = false) {
748
758
  for (const problem of this.stepProblems.splice(0))
749
759
  this.emit('chat-step-not-used', { problem });
750
760
  for (const step of this.steps) {
@@ -752,7 +762,12 @@ export class CopilotTransport {
752
762
  continue;
753
763
  if (signal?.aborted)
754
764
  throw new StoppedByOperator('stopped by the operator during a step on the way to the chat');
755
- await this.runStep(step);
765
+ /*
766
+ * `lookOnly`: "Check the locators", which only reads (bug hunt 2026-11-18). A step that must be there and is not
767
+ * stopped the opening of the newest conversation, so what only a conversation holds was not looked for, and it was
768
+ * said as having stopped the work. Taken as one that need not be; the check looks for each step itself.
769
+ */
770
+ await this.runStep(lookOnly ? { ...step, must: false } : step);
756
771
  }
757
772
  }
758
773
  async runStep(step) {
@@ -862,7 +877,7 @@ export class CopilotTransport {
862
877
  const links = await look('conversationLink');
863
878
  const href = links > 0 ? await this.el('conversationLink').first().getAttribute('href').catch(() => null) : null;
864
879
  const chatId = href ? parseChatId(href) : null;
865
- const opened = chatId ? await this.openConversation(chatId).catch(() => false) : false;
880
+ const opened = chatId ? await this.openConversation(chatId, { stepsLookOnly: true }).catch(() => false) : false;
866
881
  if (opened && chatId) {
867
882
  for (const key of ['turn', 'userMessage', 'answer', 'copy'])
868
883
  await look(key);
@@ -1049,7 +1064,7 @@ export class CopilotTransport {
1049
1064
  // Most likely the box itself (2026-11-17: Copilot's chat was at /home, its box changed): said as the box's locator.
1050
1065
  return await this.locatorMissing('composer', `on ${whereIs(url)}, which did not turn into the chat`, {
1051
1066
  message: (files) => `Copilot showed its page ${whereIs(url)} instead of the chat, and the chat did not open from there ` +
1052
- `(by its address on that host, nor by a link to it on the page). Nothing was sent. ${files} ${this.composerHint()}
1067
+ `(by its address on that host, nor by a link to it on the page). Nothing was sent. ${files} ${this.composerHint()}
1053
1068
  Current URL: ${url}`,
1054
1069
  });
1055
1070
  }
@@ -1145,10 +1160,10 @@ Current URL: ${url}`,
1145
1160
  unknown: 'The page is not the Microsoft 365 Copilot chat.',
1146
1161
  };
1147
1162
  if (where === 'unknown') {
1148
- throw await this.locatorMissing('composer', `on ${whereIs(url)}`, { message: (files) => `${explain.unknown} ${files} ${this.composerHint()}
1163
+ throw await this.locatorMissing('composer', `on ${whereIs(url)}`, { message: (files) => `${explain.unknown} ${files} ${this.composerHint()}
1149
1164
  Current URL: ${url}` });
1150
1165
  }
1151
- throw new Error(`${explain[where] ?? explain.unknown}
1166
+ throw new Error(`${explain[where] ?? explain.unknown}
1152
1167
  Current URL: ${url}`);
1153
1168
  }
1154
1169
  /**
@@ -1292,7 +1307,7 @@ Current URL: ${url}`);
1292
1307
  throw await this.notTheChat();
1293
1308
  }
1294
1309
  await this.assertWorkSurface();
1295
- await this.runSteps('open', opts.signal);
1310
+ await this.runSteps('open', opts.signal, opts.stepsLookOnly);
1296
1311
  }
1297
1312
  async newChat() {
1298
1313
  this.onChat = null;
@@ -1313,7 +1328,7 @@ Current URL: ${url}`);
1313
1328
  this.onChat = 'new';
1314
1329
  }
1315
1330
  /** Reopens a conversation by its id. Returns false when it no longer opens. */
1316
- async openConversation(chatId) {
1331
+ async openConversation(chatId, opts = {}) {
1317
1332
  this.onChat = null;
1318
1333
  const path = Url.conversationPath(chatId);
1319
1334
  await this.p.goto(this.chatAddress(path), { waitUntil: 'domcontentloaded' });
@@ -1323,7 +1338,7 @@ Current URL: ${url}`);
1323
1338
  const there = parseChatId(this.p.url()) === chatId;
1324
1339
  if (there) {
1325
1340
  this.onChat = { id: chatId };
1326
- await this.runSteps('open');
1341
+ await this.runSteps('open', undefined, opts.stepsLookOnly);
1327
1342
  }
1328
1343
  return there;
1329
1344
  }
@@ -13,8 +13,10 @@ export class KeptWindow {
13
13
  /** Whether a message is at work: only then is a window closed under it opened again. */
14
14
  atWork = false;
15
15
  /** How many times it may still be opened again for the message at work, of how many. */
16
- left = 0;
17
- allowed = 0;
16
+ /** Times opened again for the message at work. */
17
+ used = 0;
18
+ /** How many Settings allow, read each time: saved during the message, it counts at once (bug hunt 2026-11-18). */
19
+ allowed = () => 0;
18
20
  signal;
19
21
  /** It is being opened again now. */
20
22
  back = null;
@@ -34,8 +36,8 @@ export class KeptWindow {
34
36
  */
35
37
  holdWindow(times, signal) {
36
38
  this.atWork = true;
37
- this.allowed = Math.max(0, Math.floor(times));
38
- this.left = this.allowed;
39
+ this.allowed = () => Math.max(0, Math.floor(typeof times === 'function' ? times() : times));
40
+ this.used = 0;
39
41
  this.signal = signal;
40
42
  this.gaveUp = null;
41
43
  }
@@ -50,7 +52,7 @@ export class KeptWindow {
50
52
  }
51
53
  /** How many times the window was opened again for the message at work. */
52
54
  reopenedTimes() {
53
- return this.allowed - this.left;
55
+ return this.used;
54
56
  }
55
57
  /** Told by the window when it went (its `window-closed`): opened again at once while a message is at work. */
56
58
  windowWent() {
@@ -67,23 +69,24 @@ export class KeptWindow {
67
69
  this.gaveUp = new WindowClosed('the browser window was closed, and the work was stopped before it was opened again; nothing more was sent');
68
70
  return;
69
71
  }
70
- if (this.left <= 0) {
71
- this.gaveUp = new WindowClosed(this.allowed === 0
72
+ const allowed = this.allowed();
73
+ if (this.used >= allowed) {
74
+ this.gaveUp = new WindowClosed(this.used === 0
72
75
  ? CLOSED_NOT_REOPENED
73
- : `the browser window was closed ${this.allowed + 1} times while this message was at work; it was opened again ${this.allowed} time(s), ` +
74
- 'as many as Settings allow for one message (limits.reopenWindow), so nothing more was sent');
75
- this.speak('window-not-reopened', { reason: this.gaveUp.message, times: this.allowed });
76
+ : `the browser window was closed ${this.used + 1} times while this message was at work; it was opened again ${this.used} time(s), ` +
77
+ `${this.used === allowed ? 'as many as Settings allow' : `and Settings now allow ${allowed}`} for one message (limits.reopenWindow), so nothing more was sent`);
78
+ this.speak('window-not-reopened', { reason: this.gaveUp.message, times: this.used });
76
79
  return;
77
80
  }
78
- this.left -= 1;
79
- const time = this.allowed - this.left;
81
+ this.used += 1;
82
+ const time = this.used;
80
83
  const gen = this.generation;
81
- this.speak('window-reopening', { time, of: this.allowed });
84
+ this.speak('window-reopening', { time, of: allowed });
82
85
  try {
83
86
  const at = await this.inner.reopen({ signal: this.signal });
84
87
  if (this.generation !== gen)
85
88
  continue;
86
- this.speak('window-reopened', { time, of: this.allowed, ...('chatId' in at ? { chatId: at.chatId } : {}) });
89
+ this.speak('window-reopened', { time, of: allowed, ...('chatId' in at ? { chatId: at.chatId } : {}) });
87
90
  return;
88
91
  }
89
92
  catch (e) {
@@ -223,6 +223,29 @@ export async function setAsideUncommitted(folder, why, prefix = 'cop/') {
223
223
  }
224
224
  return { saved, commit: kept.commit, files: changed.length + untracked.length };
225
225
  }
226
+ /**
227
+ * What `setAsideUncommitted` kept on `saved`, put back into the folder, uncommitted again: its changes laid on what the
228
+ * folder holds now, the new files new again (bug hunt 2026-11-18: a queue's task on "the folder as it is", set aside
229
+ * with its work not committed, carried on without it — the next task on a branch of its own had put it aside). The
230
+ * branch stays: nothing is deleted. One that cannot be laid on what is there is not forced: the folder is left as it
231
+ * was, and said.
232
+ */
233
+ export async function putBackAside(folder, saved) {
234
+ const top = await git(folder, ['rev-parse', '--show-toplevel']);
235
+ const repoDir = top.ok && top.stdout ? resolve(top.stdout) : folder;
236
+ const commit = (await git(repoDir, ['rev-parse', '--verify', '--quiet', `refs/heads/${saved}^{commit}`])).stdout;
237
+ if (!commit)
238
+ return { problem: `there is no branch ${saved} any more` };
239
+ const files = lines((await git(repoDir, ['diff', '--name-only', `${commit}^`, commit])).stdout).length;
240
+ const laid = await git(repoDir, [...BOT_AUTHOR, 'cherry-pick', '--no-commit', commit], 300_000);
241
+ if (!laid.ok) {
242
+ await git(repoDir, ['cherry-pick', '--abort']);
243
+ return { problem: `its changes could not be laid on what the folder holds now (${(laid.stderr || laid.stdout).split(/\r?\n/)[0]}); they are kept on ${saved}` };
244
+ }
245
+ // Not staged, as they were: the new files new again, the changed ones changed.
246
+ await git(repoDir, ['reset', '--quiet']);
247
+ return { files };
248
+ }
226
249
  /** The bot's own name on a commit. */
227
250
  const BOT_AUTHOR = ['-c', 'user.name=copilot-operator', '-c', `user.email=${RUNNER_EMAIL}`];
228
251
  /** The commit message when the operator wrote none. */