@bivy/bivy 0.16.16-staging.3 → 0.16.16-staging.4
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.
|
@@ -145,10 +145,11 @@ export function loadCodexTranscriptFile(file) {
|
|
|
145
145
|
* locates. Message turns carry a Responses-API `message` item (`input_text` for
|
|
146
146
|
* the user, `output_text` for the assistant), which reads back through `textOf`.
|
|
147
147
|
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
148
|
+
* Verified against Codex 0.151.0 by inspecting the resumed turn's model request.
|
|
149
|
+
* Response items must be enclosed in task_started/task_complete events: without
|
|
150
|
+
* that envelope resume succeeds but silently omits the history from model input.
|
|
151
|
+
* Codex's rollout schema is version-variable. The fork engine calls this only
|
|
152
|
+
* as its "replayed" tier and
|
|
152
153
|
* falls back to a seeded continuation prompt if it throws; a node can force that
|
|
153
154
|
* fallback outright with `BIVY_CODEX_NO_FORK_REPLAY=1` when its Codex build
|
|
154
155
|
* doesn't accept synthesised rollouts.
|
|
@@ -167,6 +168,7 @@ export function writeCodexRollout(history, cwd) {
|
|
|
167
168
|
fs.mkdirSync(dir, { recursive: true });
|
|
168
169
|
const stamp = iso.replace(/[:.]/g, "-").replace(/Z$/, "");
|
|
169
170
|
const file = path.join(dir, `rollout-${stamp}-${id}.jsonl`);
|
|
171
|
+
const turnId = randomUUID();
|
|
170
172
|
const records = [
|
|
171
173
|
// Codex's SessionMeta parser requires `originator`. Without it the first
|
|
172
174
|
// record is discarded as malformed; `thread/resume` then reaches the first
|
|
@@ -178,6 +180,9 @@ export function writeCodexRollout(history, cwd) {
|
|
|
178
180
|
timestamp: iso,
|
|
179
181
|
payload: { session_id: id, id, timestamp: iso, cwd, originator: "bivy", cli_version: "bivy-fork" },
|
|
180
182
|
},
|
|
183
|
+
// Import the portable conversation as one completed historical task. Codex
|
|
184
|
+
// reconstructs model context from task boundaries, not bare response items.
|
|
185
|
+
{ type: "event_msg", timestamp: iso, payload: { type: "task_started", turn_id: turnId } },
|
|
181
186
|
...history.map((message) => ({
|
|
182
187
|
type: "response_item",
|
|
183
188
|
timestamp: iso,
|
|
@@ -187,6 +192,7 @@ export function writeCodexRollout(history, cwd) {
|
|
|
187
192
|
content: [{ type: message.role === "user" ? "input_text" : "output_text", text: message.text }],
|
|
188
193
|
},
|
|
189
194
|
})),
|
|
195
|
+
{ type: "event_msg", timestamp: iso, payload: { type: "task_complete", turn_id: turnId } },
|
|
190
196
|
];
|
|
191
197
|
fs.writeFileSync(file, records.map((r) => JSON.stringify(r)).join("\n") + "\n");
|
|
192
198
|
return { sessionFile: id, id };
|
package/package.json
CHANGED