codex-overleaf-link 1.6.0 → 1.6.1
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.
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<h1>Codex Overleaf Link</h1>
|
|
4
4
|
<p><strong>Empower Overleaf with Codex.</strong></p>
|
|
5
5
|
<p>
|
|
6
|
-
<img src="https://img.shields.io/badge/version-1.6.
|
|
6
|
+
<img src="https://img.shields.io/badge/version-1.6.1-blue" alt="version">
|
|
7
7
|
<img src="https://img.shields.io/badge/platform-macOS%20%2F%20Windows%20%2F%20Linux-lightgrey" alt="platform">
|
|
8
8
|
<img src="https://img.shields.io/badge/chrome-MV3-green" alt="chrome manifest v3">
|
|
9
9
|
<img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="node version">
|
|
@@ -38,14 +38,14 @@ One command installs the native host **and** sets up the extension: the script r
|
|
|
38
38
|
macOS / Linux:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
CODEX_OVERLEAF_REF=v1.6.
|
|
41
|
+
CODEX_OVERLEAF_REF=v1.6.1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.6.1/install.sh)"
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Windows PowerShell:
|
|
45
45
|
|
|
46
46
|
```powershell
|
|
47
|
-
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.6.
|
|
48
|
-
$env:CODEX_OVERLEAF_REF='v1.6.
|
|
47
|
+
iwr https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.6.1/install.ps1 -OutFile install.ps1
|
|
48
|
+
$env:CODEX_OVERLEAF_REF='v1.6.1'
|
|
49
49
|
powershell -ExecutionPolicy Bypass -File install.ps1
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -56,10 +56,10 @@ Then, in the `chrome://extensions` tab the script opened: enable **Developer mod
|
|
|
56
56
|
`npm exec` installs and updates the **native host only** — it does not include the Chrome extension. Use it if you prefer a pinned npm package to a source checkout.
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm exec --yes codex-overleaf-link@1.6.
|
|
59
|
+
npm exec --yes codex-overleaf-link@1.6.1 -- install-native
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Then add the extension yourself: download `codex-overleaf-link-extension-v1.6.
|
|
62
|
+
Then add the extension yourself: download `codex-overleaf-link-extension-v1.6.1.zip` from the [v1.6.1 GitHub Release](https://github.com/Ghqqqq/codex-overleaf-link/releases/tag/v1.6.1), unzip it to a stable folder, and in `chrome://extensions` enable **Developer mode**, click **Load unpacked**, and select that folder.
|
|
63
63
|
|
|
64
64
|
### Open Overleaf
|
|
65
65
|
|
|
@@ -86,9 +86,9 @@ npm installs, updates, uninstalls, and diagnoses the native host only. npm does
|
|
|
86
86
|
|
|
87
87
|
| Action | Command |
|
|
88
88
|
|--------|---------|
|
|
89
|
-
| Install / update | `npm exec --yes codex-overleaf-link@1.6.
|
|
90
|
-
| Diagnose | `npm exec --yes codex-overleaf-link@1.6.
|
|
91
|
-
| Uninstall | `npm exec --yes codex-overleaf-link@1.6.
|
|
89
|
+
| Install / update | `npm exec --yes codex-overleaf-link@1.6.1 -- install-native` |
|
|
90
|
+
| Diagnose | `npm exec --yes codex-overleaf-link@1.6.1 -- doctor` |
|
|
91
|
+
| Uninstall | `npm exec --yes codex-overleaf-link@1.6.1 -- uninstall-native` |
|
|
92
92
|
|
|
93
93
|
Use `--extension-id <chrome-extension-id>` only for a custom/dev unpacked extension id that differs from the official bundled id.
|
|
94
94
|
|
|
@@ -98,13 +98,13 @@ To update, re-run any of the [native host installers](#install) — they install
|
|
|
98
98
|
|
|
99
99
|
## GitHub Release Artifacts
|
|
100
100
|
|
|
101
|
-
The v1.6.
|
|
101
|
+
The v1.6.1 GitHub Release contains:
|
|
102
102
|
|
|
103
|
-
- `codex-overleaf-link-extension-v1.6.
|
|
104
|
-
- `codex-overleaf-native-host-v1.6.
|
|
105
|
-
- `codex-overleaf-link-1.6.
|
|
106
|
-
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.6.
|
|
107
|
-
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.6.
|
|
103
|
+
- `codex-overleaf-link-extension-v1.6.1.zip`: loadable Chrome extension package for manual unpacked installation.
|
|
104
|
+
- `codex-overleaf-native-host-v1.6.1.tar.gz`: native host runtime files used by the installer and release verification.
|
|
105
|
+
- `codex-overleaf-link-1.6.1.tgz`: npm native host CLI package for pinned install, doctor, and uninstall flows.
|
|
106
|
+
- `install.sh`: release-pinned macOS / Linux installer that defaults to `v1.6.1` when run directly from the release artifact.
|
|
107
|
+
- `install.ps1`: release-pinned Windows PowerShell installer that defaults to `v1.6.1` when run directly from the release artifact.
|
|
108
108
|
- `uninstall-native-host.mjs`: native host uninstaller that removes the Chrome Native Messaging manifest, bridge executable, and runtime copy.
|
|
109
109
|
- `nativeHostPlatform.js`, `manifest.js`, `runtimeInstaller.js`: helper files required by the loose uninstaller asset.
|
|
110
110
|
- `SHA256SUMS` and `release-manifest.json`: checksum and artifact metadata for release verification.
|
|
@@ -115,7 +115,7 @@ The v1.6.0 GitHub Release contains:
|
|
|
115
115
|
Remove the native host (use `--browser chromium` on Linux Chromium):
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
|
-
npm exec --yes codex-overleaf-link@1.6.
|
|
118
|
+
npm exec --yes codex-overleaf-link@1.6.1 -- uninstall-native
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
The same command works on Windows PowerShell. If you installed from a manual checkout or source installer, you can also run `npm run uninstall:native` inside the repo, use `node ~/.codex-overleaf/source/scripts/uninstall-native-host.mjs` on macOS / Linux, or use `node $env:LOCALAPPDATA\CodexOverleaf\source\scripts\uninstall-native-host.mjs` on Windows PowerShell.
|
|
@@ -150,13 +150,13 @@ Then remove the extension from `chrome://extensions`. To delete local data: on m
|
|
|
150
150
|
Linux Chromium install or update:
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
CODEX_OVERLEAF_REF=v1.6.
|
|
153
|
+
CODEX_OVERLEAF_REF=v1.6.1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Ghqqqq/codex-overleaf-link/v1.6.1/install.sh)" -- --browser chromium
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
Linux Chromium uninstall:
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
|
-
npm exec --yes codex-overleaf-link@1.6.
|
|
159
|
+
npm exec --yes codex-overleaf-link@1.6.1 -- uninstall-native --browser chromium
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
## Features
|
|
@@ -289,7 +289,7 @@ Composer attachments are turn-scoped Codex context. Limits are 8 attachments per
|
|
|
289
289
|
Re-run any [native host installer](#install), reload the extension in `chrome://extensions`, then refresh the Overleaf tab. This also fixes extension/native version mismatch and native protocol mismatch.
|
|
290
290
|
|
|
291
291
|
```bash
|
|
292
|
-
npm exec --yes codex-overleaf-link@1.6.
|
|
292
|
+
npm exec --yes codex-overleaf-link@1.6.1 -- install-native
|
|
293
293
|
```
|
|
294
294
|
|
|
295
295
|
**The Windows popup or panel shows a Bash recovery command**
|
|
@@ -338,8 +338,8 @@ Use this matrix for release-candidate signoff and compatibility reports. Record
|
|
|
338
338
|
| Browser/channel/version | Google Chrome channel and version. | Google Chrome channel and version. | Google Chrome channel and version. | Chromium channel/package and version. |
|
|
339
339
|
| Install mode | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout. | Manual unpacked extension from GitHub Release zip or checkout; native host installed with `--browser chromium`. |
|
|
340
340
|
| Extension id | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. | Bundled id `illdpneeeopfffmiepaejglgmhpmdhdc`, or actual custom id passed with `--extension-id`. |
|
|
341
|
-
| Installer/update command | `npm exec --yes codex-overleaf-link@1.6.
|
|
342
|
-
| Uninstall command | `npm exec --yes codex-overleaf-link@1.6.
|
|
341
|
+
| Installer/update command | `npm exec --yes codex-overleaf-link@1.6.1 -- install-native` | `npm exec --yes codex-overleaf-link@1.6.1 -- install-native` | `npm exec --yes codex-overleaf-link@1.6.1 -- install-native` | `npm exec --yes codex-overleaf-link@1.6.1 -- install-native --browser chromium` |
|
|
342
|
+
| Uninstall command | `npm exec --yes codex-overleaf-link@1.6.1 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.6.1 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.6.1 -- uninstall-native` | `npm exec --yes codex-overleaf-link@1.6.1 -- uninstall-native --browser chromium` |
|
|
343
343
|
| Manifest/registry path | `~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.codex.overleaf.json` | `HKCU\Software\Google\Chrome\NativeMessagingHosts\com.codex.overleaf` -> `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime\com.codex.overleaf.json` | `~/.config/google-chrome/NativeMessagingHosts/com.codex.overleaf.json` | `~/.config/chromium/NativeMessagingHosts/com.codex.overleaf.json` |
|
|
344
344
|
| Bridge/runtime/source path | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. | Bridge `%LOCALAPPDATA%\CodexOverleaf\codex-overleaf-bridge.cmd`; runtime `%LOCALAPPDATA%\CodexOverleaf\native-host-runtime`; source `%LOCALAPPDATA%\CodexOverleaf\source`. | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. | Bridge `~/.codex-overleaf/codex-overleaf-bridge`; runtime `~/.codex-overleaf/native-host-runtime`; source `~/.codex-overleaf/source`. |
|
|
345
345
|
| Node/Git/Codex/TeX | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. | Node.js >= 20; Git; Codex CLI installed and logged in; TeX optional. |
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const MIN_NATIVE_VERSION = '1.0.0';
|
|
13
13
|
const MIN_COMPATIBLE_NATIVE_VERSION = '1.0.0';
|
|
14
14
|
const MIN_COMPATIBLE_EXTENSION_VERSION = '1.0.0';
|
|
15
|
-
const BUILD_TARGET_VERSION = '1.6.
|
|
15
|
+
const BUILD_TARGET_VERSION = '1.6.1';
|
|
16
16
|
const DEFAULT_CHROME_EXTENSION_ID = 'illdpneeeopfffmiepaejglgmhpmdhdc';
|
|
17
17
|
const REQUIRED_CAPABILITIES = Object.freeze([
|
|
18
18
|
'bridgePing',
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: parallel-subagents
|
|
3
3
|
description: >
|
|
4
|
-
When a task decomposes into independent
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
When a task decomposes into independent slices — separate files, OR
|
|
5
|
+
separate sections of ONE file — fan it out: write job files to the subagent
|
|
6
|
+
queue and the host runs real parallel Codex workers for you. For a single
|
|
7
|
+
file, extract per-section slice files into the queue's work/ zone, let
|
|
8
|
+
workers polish them in parallel, then reassemble (scatter-gather). Every
|
|
9
|
+
job must state an explicit, non-overlapping scope.
|
|
9
10
|
---
|
|
10
11
|
|
|
11
12
|
# Parallel Subagents
|
|
@@ -18,18 +19,26 @@ Codex agent confined to the files you assign it.
|
|
|
18
19
|
## 1. When to use
|
|
19
20
|
|
|
20
21
|
Use this when ALL of these hold:
|
|
21
|
-
- The task splits into ≥ 2 independent slices
|
|
22
|
-
|
|
22
|
+
- The task splits into ≥ 2 independent slices: different **files**, or
|
|
23
|
+
different **sections of one file** (use the scatter-gather workflow in §5).
|
|
23
24
|
- Slices do not depend on each other's output.
|
|
24
25
|
- Each slice is small enough to finish in a few minutes.
|
|
25
26
|
|
|
26
27
|
Do NOT use it (work sequentially yourself instead) when:
|
|
27
|
-
- The project keeps everything in one monolithic file — never split one file
|
|
28
|
-
across jobs.
|
|
29
28
|
- Slices are deeply cross-referenced and must be edited together.
|
|
30
29
|
- There are fewer than 2 real slices.
|
|
31
30
|
- The handshake file below is missing or not `ready`.
|
|
32
31
|
|
|
32
|
+
## 1b. Explicit scope — the iron rule
|
|
33
|
+
|
|
34
|
+
Every job's `task` MUST state its exact working scope, and scopes MUST NOT
|
|
35
|
+
overlap:
|
|
36
|
+
- multi-file job: name the file(s) and what inside them is in scope;
|
|
37
|
+
- single-file slice job: name the section (`\section{...}` title) and quote
|
|
38
|
+
the slice's exact first and last source lines.
|
|
39
|
+
Never write two jobs whose scopes could touch the same text. If you cannot
|
|
40
|
+
state a slice's boundaries precisely, do that slice yourself instead.
|
|
41
|
+
|
|
33
42
|
## 2. Handshake
|
|
34
43
|
|
|
35
44
|
Read `.codex-overleaf-subagents/broker.json`. If it is missing or its
|
|
@@ -60,8 +69,10 @@ Rules:
|
|
|
60
69
|
- `id`: lowercase letters/digits/hyphens, ≤ 32 chars, unique.
|
|
61
70
|
- `task`: complete, self-contained instructions — workers cannot ask
|
|
62
71
|
questions. Repeat shared style guidance in EVERY job.
|
|
63
|
-
- `files`: workspace-relative paths the job may edit
|
|
64
|
-
|
|
72
|
+
- `files`: workspace-relative paths the job may edit — project files or
|
|
73
|
+
slice files under `.codex-overleaf-subagents/work/`. Jobs that share a
|
|
74
|
+
file are admitted but run ONE AT A TIME (the broker serializes them);
|
|
75
|
+
disjoint jobs run in parallel.
|
|
65
76
|
- `readOnlyContext`: files the worker may read but must not edit.
|
|
66
77
|
|
|
67
78
|
## 4. Poll for results
|
|
@@ -77,23 +88,61 @@ Then read each `results/<id>.json` (`status`: completed | failed | rejected |
|
|
|
77
88
|
timeout | cancelled; `summary`; `changedFiles`) and, when you need the full
|
|
78
89
|
close-out, `results/<id>.last-message.md`.
|
|
79
90
|
|
|
80
|
-
## 5.
|
|
91
|
+
## 5. Single file? Two safe modes
|
|
92
|
+
|
|
93
|
+
Two workers must NEVER edit the same file at the same moment (whole-file
|
|
94
|
+
writes race and silently drop each other's edits) — the broker guarantees
|
|
95
|
+
this for you. Pick per task:
|
|
96
|
+
|
|
97
|
+
**Mode A — serialized scoped jobs (simple, no slicing).** Just write one job
|
|
98
|
+
per section, all owning the same file, each `task` stating its exact section
|
|
99
|
+
scope (iron rule §1b). The broker runs them one at a time, each seeing the
|
|
100
|
+
previous job's output. No parallel speedup within that file (jobs on OTHER
|
|
101
|
+
files still run alongside), but zero assembly work. Prefer this for 2-3
|
|
102
|
+
sections or quick passes.
|
|
103
|
+
|
|
104
|
+
**Mode B — scatter-gather slices (true parallelism).** For a big file where
|
|
105
|
+
wall-clock matters, give each worker its own physical slice:
|
|
106
|
+
|
|
107
|
+
1. **Scatter** — for each independent section, copy its EXACT text (from its
|
|
108
|
+
`\section{...}` line up to, not including, the next `\section`) into a
|
|
109
|
+
slice file, verbatim, atomically:
|
|
110
|
+
`cat > .codex-overleaf-subagents/work/.tmp-sec2 <<'EOF' ... EOF` then
|
|
111
|
+
`mv .codex-overleaf-subagents/work/.tmp-sec2 .codex-overleaf-subagents/work/sec2.tex`.
|
|
112
|
+
Preamble, frontmatter, and anything you cannot bound precisely stays with
|
|
113
|
+
you.
|
|
114
|
+
2. **Jobs** — one per slice. `files` = that slice file only. The `task` must
|
|
115
|
+
say: this is a fragment of `<original file>` covering section `<title>`
|
|
116
|
+
(quote first + last line); polish it IN PLACE; do not add a preamble or
|
|
117
|
+
document wrapper; keep the project's edit conventions (e.g.
|
|
118
|
+
annotated-rewrite). Put the original file in `readOnlyContext` so the
|
|
119
|
+
worker sees surrounding context.
|
|
120
|
+
3. **Gather** — after all results: verify each slice still starts with its
|
|
121
|
+
`\section{...}` line, then replace the corresponding original block in
|
|
122
|
+
the source file with the slice content, one section at a time, yourself.
|
|
123
|
+
If a slice lost its boundary line, treat that slice as failed and redo it
|
|
124
|
+
inline.
|
|
125
|
+
|
|
126
|
+
Slice files live inside the queue zone, so they are scratch: they never sync
|
|
127
|
+
to Overleaf — only your reassembled edits to the real file do.
|
|
128
|
+
|
|
129
|
+
## 6. Wave discipline (important)
|
|
81
130
|
|
|
82
131
|
While any job is queued or running, do **not** edit project files yourself —
|
|
83
132
|
write jobs, poll, wait. Do your own edits before the first job or after the
|
|
84
133
|
last result. Files changed during a wave that no job owns are reported as
|
|
85
134
|
ownership violations and **excluded from the Overleaf writeback**.
|
|
86
135
|
|
|
87
|
-
##
|
|
136
|
+
## 7. Integrate
|
|
88
137
|
|
|
89
138
|
- For each `completed` job: read its summary, spot-check the owned files, and
|
|
90
139
|
smooth terminology/transitions ACROSS slice boundaries yourself.
|
|
91
140
|
- For each `failed` / `timeout` / `rejected` job: do that slice inline
|
|
92
|
-
yourself now (check `reason
|
|
141
|
+
yourself now (check `reason`).
|
|
93
142
|
- Mention any violations in your close-out so the user knows those edits were
|
|
94
143
|
withheld from writeback.
|
|
95
144
|
|
|
96
|
-
##
|
|
145
|
+
## 8. Close out
|
|
97
146
|
|
|
98
147
|
End with a per-slice one-liner (job → what changed) plus an overall summary.
|
|
99
148
|
This becomes the run report the user reads.
|
|
@@ -76,6 +76,7 @@ function createSubagentBroker(options = {}) {
|
|
|
76
76
|
fs.mkdirSync(jobsDir, { recursive: true });
|
|
77
77
|
fs.mkdirSync(resultsDir, { recursive: true });
|
|
78
78
|
fs.mkdirSync(logsDir, { recursive: true });
|
|
79
|
+
fs.mkdirSync(path.join(queueRoot, 'work'), { recursive: true });
|
|
79
80
|
startedAt = Date.now();
|
|
80
81
|
accepting = true;
|
|
81
82
|
writeBrokerFile('ready');
|
|
@@ -194,15 +195,10 @@ function createSubagentBroker(options = {}) {
|
|
|
194
195
|
}
|
|
195
196
|
owned.push(safe);
|
|
196
197
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const overlap = entry.job.files.find(file => owned.includes(file));
|
|
202
|
-
if (overlap) {
|
|
203
|
-
return { reason: 'file_conflict', path: overlap, conflictsWith: otherId };
|
|
204
|
-
}
|
|
205
|
-
}
|
|
198
|
+
// Overlapping ownership no longer rejects: same-file jobs are admitted
|
|
199
|
+
// and SERIALIZED by the scheduler (fillSlots never runs two jobs whose
|
|
200
|
+
// files intersect). Prompt-scoped same-file delegation is then safe —
|
|
201
|
+
// the physical lost-update race only exists under concurrency (v1.6.1).
|
|
206
202
|
// Wave-aware admission: the parent turn has no default absolute deadline,
|
|
207
203
|
// so the broker enforces its own wall-clock envelope across ALL waves.
|
|
208
204
|
const projectedWaves = Math.ceil((queued.length + running.size + 1) / limits.maxWorkers);
|
|
@@ -229,6 +225,13 @@ function createSubagentBroker(options = {}) {
|
|
|
229
225
|
return null;
|
|
230
226
|
}
|
|
231
227
|
if (segments[0] === SUBAGENT_QUEUE_DIR) {
|
|
228
|
+
// The queue control plane (jobs/results/logs/broker.json) is never
|
|
229
|
+
// ownable — but the work/ scratch zone IS: single-file fan-out slices
|
|
230
|
+
// live there (v1.6.1 scatter-gather), excluded from writeback by the
|
|
231
|
+
// mirror-scan rule yet fully owned/hashed like any other job file.
|
|
232
|
+
if (segments[1] === 'work' && segments.length >= 3) {
|
|
233
|
+
return segments.join('/');
|
|
234
|
+
}
|
|
232
235
|
return null;
|
|
233
236
|
}
|
|
234
237
|
return segments.join('/');
|
|
@@ -252,7 +255,20 @@ function createSubagentBroker(options = {}) {
|
|
|
252
255
|
|
|
253
256
|
function fillSlots() {
|
|
254
257
|
while (accepting && !cancelled && queued.length && running.size < limits.maxWorkers) {
|
|
255
|
-
const
|
|
258
|
+
const runningFiles = new Set();
|
|
259
|
+
for (const id of running.keys()) {
|
|
260
|
+
for (const file of jobs.get(id).job.files) {
|
|
261
|
+
runningFiles.add(file);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// FIFO with skip: pick the first queued job whose ownership does not
|
|
265
|
+
// intersect any running job's files — overlapping jobs wait their turn
|
|
266
|
+
// (temporal exclusivity replaces the old overlap rejection).
|
|
267
|
+
const index = queued.findIndex(id => !jobs.get(id).job.files.some(file => runningFiles.has(file)));
|
|
268
|
+
if (index === -1) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const [jobId] = queued.splice(index, 1);
|
|
256
272
|
startWorker(jobs.get(jobId));
|
|
257
273
|
}
|
|
258
274
|
}
|
|
@@ -408,6 +424,10 @@ function createSubagentBroker(options = {}) {
|
|
|
408
424
|
return;
|
|
409
425
|
}
|
|
410
426
|
for (const entry of entries) {
|
|
427
|
+
// The whole queue zone (incl. the work/ slice scratch) stays out of
|
|
428
|
+
// wave hashing: scratch can never reach Overleaf, same-wave slices
|
|
429
|
+
// are all in the owned union anyway, and a lead staggering slice
|
|
430
|
+
// creation mid-wave must not read as a violation (v1.6.1).
|
|
411
431
|
if (entry.name === '.DS_Store' || entry.name === SUBAGENT_QUEUE_DIR || entry.name === '.codex-overleaf-attachments') {
|
|
412
432
|
continue;
|
|
413
433
|
}
|
|
@@ -446,7 +466,7 @@ function createSubagentBroker(options = {}) {
|
|
|
446
466
|
'You are a subagent working on one slice of a larger task.',
|
|
447
467
|
'HARD CONSTRAINTS:',
|
|
448
468
|
`- You may modify ONLY these files: ${job.files.join(', ')}.`,
|
|
449
|
-
readOnly + '- Do not modify, create, or delete any other file.
|
|
469
|
+
readOnly + '- Do not modify, create, or delete any other file. Inside .codex-overleaf-subagents/ you may touch ONLY the slice files listed above (if any).',
|
|
450
470
|
'- Work fully autonomously; nobody can answer questions.',
|
|
451
471
|
'',
|
|
452
472
|
job.task
|