pi-openai-codex-compat 0.0.9 → 0.0.10-alpha.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/APPLY_PATCH_INSTRUCTION_FEEDBACK.md +11 -55
- package/CHANGELOG.md +38 -0
- package/README.md +38 -6
- package/THIRD_PARTY_NOTICES.md +1 -27
- package/extensions/openai-codex-compat/apply-patch-diff-render.ts +20 -344
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-contracts.ts +91 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-details-schema.ts +310 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-details.ts +227 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-errors.ts +60 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-executor.ts +583 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-failure-inspection.ts +493 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-feedback.ts +445 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-filesystem-inspection.ts +49 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-filesystem-model.ts +188 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-filesystem-mutations.ts +324 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-mutation-queue.ts +95 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-operation-semantics.ts +142 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-parser.ts +384 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-path-identity.ts +78 -0
- package/extensions/openai-codex-compat/apply-patch-engine/apply-patch-engine-semantic-planner.ts +1363 -0
- package/extensions/openai-codex-compat/apply-patch-engine.ts +80 -4572
- package/extensions/openai-codex-compat/apply-patch-matcher/apply-patch-matcher-contracts.ts +12 -0
- package/extensions/openai-codex-compat/apply-patch-matcher/apply-patch-matcher-line-matching.ts +123 -0
- package/extensions/openai-codex-compat/apply-patch-matcher/apply-patch-matcher-strict-content.ts +101 -0
- package/extensions/openai-codex-compat/apply-patch-matcher.ts +10 -1527
- package/extensions/openai-codex-compat/apply-patch-render.ts +14 -57
- package/extensions/openai-codex-compat/apply-patch.ts +31 -9
- package/extensions/openai-codex-compat/codex-cache-diagnostics.ts +24 -24
- package/extensions/openai-codex-compat/codex-identifiers.ts +8 -0
- package/extensions/openai-codex-compat/codex-installation.ts +3 -10
- package/extensions/openai-codex-compat/codex-metadata.ts +49 -28
- package/extensions/openai-codex-compat/codex-protocol.ts +260 -161
- package/extensions/openai-codex-compat/codex-provider/codex-provider-contracts.ts +108 -0
- package/extensions/openai-codex-compat/codex-provider/codex-provider-history.ts +106 -0
- package/extensions/openai-codex-compat/codex-provider/codex-provider-response-attempts.ts +408 -0
- package/extensions/openai-codex-compat/codex-provider/codex-provider-runtime.ts +1274 -0
- package/extensions/openai-codex-compat/codex-provider.ts +11 -1651
- package/extensions/openai-codex-compat/codex-stream.ts +76 -77
- package/extensions/openai-codex-compat/codex-thread-lineage.ts +83 -37
- package/extensions/openai-codex-compat/codex-tool-surface.ts +18 -8
- package/extensions/openai-codex-compat/codex-transport/codex-transport-contracts.ts +262 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-diagnostics.ts +263 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-errors.ts +172 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-events.ts +68 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-request-headers.ts +315 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-retry.ts +124 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-sse-stream.ts +214 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-turn-state.ts +23 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-websocket-continuation.ts +107 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-websocket-pool.ts +257 -0
- package/extensions/openai-codex-compat/codex-transport/codex-transport-websocket-stream.ts +320 -0
- package/extensions/openai-codex-compat/codex-transport.ts +251 -2074
- package/extensions/openai-codex-compat/compaction-checkpoint.ts +151 -77
- package/extensions/openai-codex-compat/config-context.ts +10 -0
- package/extensions/openai-codex-compat/config.ts +102 -88
- package/extensions/openai-codex-compat/error-from-thrown.ts +3 -0
- package/extensions/openai-codex-compat/footer.ts +77 -17
- package/extensions/openai-codex-compat/image-generation-render.ts +31 -33
- package/extensions/openai-codex-compat/image-generation-schema.ts +5 -9
- package/extensions/openai-codex-compat/image-generation.ts +81 -51
- package/extensions/openai-codex-compat/index.ts +13 -10
- package/extensions/openai-codex-compat/model-context.ts +20 -0
- package/extensions/openai-codex-compat/model-policy.ts +77 -12
- package/extensions/openai-codex-compat/namespaced-tools.ts +2 -1
- package/extensions/openai-codex-compat/native-history.ts +55 -55
- package/extensions/openai-codex-compat/output-limit-continuation.ts +89 -21
- package/extensions/openai-codex-compat/remote-compaction.ts +151 -58
- package/extensions/openai-codex-compat/request-options.ts +29 -22
- package/extensions/openai-codex-compat/required-value.ts +6 -0
- package/extensions/openai-codex-compat/responses-event-schema.ts +7 -0
- package/extensions/openai-codex-compat/responses-item-schema.ts +461 -0
- package/extensions/openai-codex-compat/responses-lite.ts +16 -16
- package/extensions/openai-codex-compat/responses-replay.ts +18 -4
- package/extensions/openai-codex-compat/responses-tool-schema.ts +92 -0
- package/extensions/openai-codex-compat/settings-pane.ts +105 -45
- package/extensions/openai-codex-compat/tool-definition-contract.ts +28 -0
- package/extensions/openai-codex-compat/tool-runtime.ts +27 -13
- package/extensions/openai-codex-compat/tools.ts +14 -11
- package/extensions/openai-codex-compat/value-contracts.ts +37 -0
- package/extensions/openai-codex-compat/vendor/pi-ai/openai-responses-serialization.ts +101 -71
- package/extensions/openai-codex-compat/web-run-output.ts +22 -13
- package/extensions/openai-codex-compat/web-run-render.ts +54 -40
- package/extensions/openai-codex-compat/web-run-schema.ts +5 -55
- package/extensions/openai-codex-compat/web-run.ts +83 -39
- package/package.json +5 -8
- package/LICENSES/tree-sitter-wasms-MIT.txt +0 -21
- package/LICENSES/web-tree-sitter-MIT.txt +0 -21
- package/extensions/openai-codex-compat/provider-error.ts +0 -79
|
@@ -17,8 +17,8 @@ Feedback must:
|
|
|
17
17
|
1. retain the aggregate changed-file summary;
|
|
18
18
|
2. when an instruction ledger is needed, report every instruction without a
|
|
19
19
|
model-facing limit;
|
|
20
|
-
3. attribute filesystem effects
|
|
21
|
-
|
|
20
|
+
3. attribute filesystem effects and errors to the instruction that produced
|
|
21
|
+
them;
|
|
22
22
|
4. report failed and not-run instructions;
|
|
23
23
|
5. use concise, simplified technical English;
|
|
24
24
|
6. report deterministic facts rather than speculative outcomes; and
|
|
@@ -134,8 +134,7 @@ Add a short clause only for:
|
|
|
134
134
|
- a failure;
|
|
135
135
|
- a non-obvious externally visible filesystem effect;
|
|
136
136
|
- a partial effect;
|
|
137
|
-
- a final state that is not verified
|
|
138
|
-
- concise matcher evidence.
|
|
137
|
+
- a final state that is not verified.
|
|
139
138
|
|
|
140
139
|
Do not include:
|
|
141
140
|
|
|
@@ -143,7 +142,6 @@ Do not include:
|
|
|
143
142
|
- a diff-availability warning;
|
|
144
143
|
- verbose proof sections;
|
|
145
144
|
- a duplicated raw error section;
|
|
146
|
-
- a detached matcher section; or
|
|
147
145
|
- prose that merely restates an ordinary successful operation.
|
|
148
146
|
|
|
149
147
|
## Terminology
|
|
@@ -227,7 +225,6 @@ Each instruction result stores:
|
|
|
227
225
|
- completed externally visible filesystem effects;
|
|
228
226
|
- relevant final path states;
|
|
229
227
|
- an optional error;
|
|
230
|
-
- optional matcher evidence; and
|
|
231
228
|
- related instruction numbers.
|
|
232
229
|
|
|
233
230
|
The operation label is sufficient for ordinary successful effects. Explicit
|
|
@@ -346,37 +343,17 @@ Do not tell the model that previous content was unreadable, a diff is
|
|
|
346
343
|
unavailable, history is incomplete, or the result is inexact. Diff
|
|
347
344
|
availability is a TUI/history concern, not an operation result.
|
|
348
345
|
|
|
349
|
-
##
|
|
350
|
-
|
|
351
|
-
Matcher feedback belongs to the failed update instruction. Do not emit a
|
|
352
|
-
detached `Matcher diagnostics:` section or repeat old/replacement patch text.
|
|
353
|
-
|
|
354
|
-
Examples:
|
|
346
|
+
## Matching failures
|
|
355
347
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
348
|
+
A strict matching failure belongs to the failed update instruction. Do not
|
|
349
|
+
emit a detached matcher-diagnostics section or repeat old/replacement patch
|
|
350
|
+
text:
|
|
359
351
|
|
|
360
352
|
```text
|
|
361
|
-
3. [FAILED] Update file.ts -
|
|
353
|
+
3. [FAILED] Update file.ts - Old content was not found.
|
|
362
354
|
```
|
|
363
355
|
|
|
364
|
-
|
|
365
|
-
3. [FAILED] Update file.ts - Matching locations at lines 10-12 and lines 40-42 produce different results. Use apply_patch again with more specific surrounding context or smaller changes if needed.
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
```text
|
|
369
|
-
3. [FAILED] Update file.ts - More than 256 possible ways to apply the requested changes were found. Use apply_patch again with more specific surrounding context or smaller changes if needed.
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
```text
|
|
373
|
-
3. [FAILED] Update file.ts - Requested replacement found at lines 40-44, but old content was not found. Inspect the reported lines and use apply_patch again with updated instructions if needed.
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
The 64-location limit, different-result ambiguity, and 256-way limit use the
|
|
377
|
-
same guidance because each requires more specific surrounding context or
|
|
378
|
-
smaller requested changes. Reverse-order and overlap failures instead tell the
|
|
379
|
-
model to reorder or separate the requested changes.
|
|
356
|
+
Missing `@@` anchors analogously report `Context was not found.`.
|
|
380
357
|
|
|
381
358
|
## Not-run results
|
|
382
359
|
|
|
@@ -457,7 +434,6 @@ Expanded rendering nests these details beneath the relevant instruction:
|
|
|
457
434
|
- applied textual diffs;
|
|
458
435
|
- non-obvious filesystem effects;
|
|
459
436
|
- final-state verification;
|
|
460
|
-
- concise matcher locations; and
|
|
461
437
|
- useful system-error details.
|
|
462
438
|
|
|
463
439
|
Partial effects are not rendered as detached successful operations. Failed
|
|
@@ -483,7 +459,6 @@ type InstructionResult = {
|
|
|
483
459
|
effects: InstructionEffect[];
|
|
484
460
|
finalStates: FinalPathState[];
|
|
485
461
|
error?: InstructionError;
|
|
486
|
-
matching?: MatchingEvidence;
|
|
487
462
|
relatedInstructions?: number[];
|
|
488
463
|
};
|
|
489
464
|
```
|
|
@@ -512,18 +487,6 @@ Only presentation differs:
|
|
|
512
487
|
|
|
513
488
|
Semantic wording and facts remain shared.
|
|
514
489
|
|
|
515
|
-
## Matcher candidate deduplication
|
|
516
|
-
|
|
517
|
-
Before applying candidate and mapping limits:
|
|
518
|
-
|
|
519
|
-
1. canonicalize candidates by complete byte-edit effect;
|
|
520
|
-
2. remove byte-identical duplicate candidates;
|
|
521
|
-
3. retain every semantically distinct candidate; and
|
|
522
|
-
4. do not rank candidates or use heuristic preference.
|
|
523
|
-
|
|
524
|
-
This prevents duplicate line-level and structural candidates from consuming
|
|
525
|
-
the exhaustive mapping bound.
|
|
526
|
-
|
|
527
490
|
## Required tests
|
|
528
491
|
|
|
529
492
|
### Completeness
|
|
@@ -552,7 +515,6 @@ Generated model and TUI feedback does not contain:
|
|
|
552
515
|
- `installed`
|
|
553
516
|
- `dead`
|
|
554
517
|
- `dominated`
|
|
555
|
-
- `Matcher diagnostics`
|
|
556
518
|
- the heading `Instructions:`
|
|
557
519
|
|
|
558
520
|
When the conditional ledger is present, its heading is
|
|
@@ -583,8 +545,8 @@ Cover:
|
|
|
583
545
|
- temporary entry remains without a false no-change statement; and
|
|
584
546
|
- post-operation verification failure.
|
|
585
547
|
|
|
586
|
-
|
|
587
|
-
|
|
548
|
+
Strict mismatch coverage verifies the source is unchanged and the original
|
|
549
|
+
context or expected-lines error is reported.
|
|
588
550
|
|
|
589
551
|
### No patch-content repetition
|
|
590
552
|
|
|
@@ -602,16 +564,10 @@ With `applyPatchDebug` enabled:
|
|
|
602
564
|
- changing the setting updates existing result components; and
|
|
603
565
|
- partial previews remain unchanged.
|
|
604
566
|
|
|
605
|
-
### Matcher deduplication
|
|
606
|
-
|
|
607
|
-
A multi-group formatter-recovery fixture proves duplicate candidates do not
|
|
608
|
-
consume the mapping limit.
|
|
609
|
-
|
|
610
567
|
## Documentation
|
|
611
568
|
|
|
612
569
|
Implementation changes must also update:
|
|
613
570
|
|
|
614
571
|
- `APPLY_PATCH_SEMANTIC_OPERATIONS.md`
|
|
615
|
-
- `APPLY_PATCH_REMAINING_WORK.md`
|
|
616
572
|
- `README.md`
|
|
617
573
|
- `CHANGELOG.md`
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Preserve regular-file permission modes across sequential `apply_patch`
|
|
8
|
+
replacements and state-changing moves, including files created by earlier
|
|
9
|
+
instructions in the same patch.
|
|
10
|
+
- Resolve descendants through symlink parents established by earlier
|
|
11
|
+
instructions, keeping subsequent aliased operations in one virtual
|
|
12
|
+
filesystem state.
|
|
13
|
+
- Resolve relative symlink targets from the canonical source or moved
|
|
14
|
+
destination directory when a parent path is itself a symlink.
|
|
15
|
+
- Verify the complete final byte buffer after `apply_patch` adds and text
|
|
16
|
+
updates, so requested bytes appearing in a duplicate or unrelated region
|
|
17
|
+
cannot satisfy the result postcondition.
|
|
18
|
+
- Classify repeated identical `apply_patch` adds from source-ordered virtual
|
|
19
|
+
content and exact spelling, avoiding redundant replacements after earlier
|
|
20
|
+
adds or moves while preserving case, Unicode, and symlink-parent identity.
|
|
21
|
+
- Use actual or planned directory-entry spelling when proving dead
|
|
22
|
+
`apply_patch` operations and classifying same-entry moves on case-insensitive
|
|
23
|
+
or Unicode-normalizing filesystems.
|
|
24
|
+
- Validate supplied identity and context chunks before `apply_patch` moves while preserving chunkless opaque moves and successful symlink and hard-link topology.
|
|
25
|
+
- Remove formatter-tolerant `apply_patch` matching permanently and rely exclusively on the official Codex-compatible exact, trailing-trim, full-trim, and Unicode matcher.
|
|
26
|
+
- Treat streamed Codex misalignment-policy violations as terminal without retrying and preserve the provider's error message.
|
|
27
|
+
- Preserve unexpected parser, matcher, and asynchronous transport failures instead of replacing or detaching them.
|
|
28
|
+
- Recover expired 60-minute Codex WebSockets in the provider response loop, retaining committed items, discarding provisional output, and waiting for Pi to record completed tool outputs before continuing.
|
|
29
|
+
- Validate complete apply-patch result details against schema-derived contracts before rendering, including integer metadata and nested instruction relationships.
|
|
30
|
+
- Distinguish an unavailable Pi compaction append capability from a missing percentage-compaction retention boundary.
|
|
31
|
+
- Validate supported Responses input, completed-output, content, and tool-definition variants with closed schema-derived unions, failing closed on unknown or malformed item types while preserving additional fields on known variants.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Simplify `apply_patch` for its queued single-writer operating model: retain
|
|
36
|
+
Pi's mutation queue, remove the extension-local alias queue and
|
|
37
|
+
preflight-to-execution drift machinery, use direct writes for in-place text
|
|
38
|
+
updates, and preserve source-ordered no-change checkpoints without
|
|
39
|
+
filesystem revalidation.
|
|
40
|
+
- Adopt the shared 2h2d Oxlint policy and exact supported Oxlint and Oxfmt versions.
|
|
41
|
+
- Run isolated test files across four workers, bypass unasserted wall-clock response-retry waits in integration coverage, and assert the retry-delay calculation directly.
|
|
42
|
+
|
|
5
43
|
## 0.0.9 - 2026-08-16
|
|
6
44
|
|
|
7
45
|
### Fixed
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Authenticate through Pi if needed:
|
|
|
31
31
|
|
|
32
32
|
## Compatibility baseline and differences
|
|
33
33
|
|
|
34
|
-
The compatibility baseline is official Codex CLI `0.
|
|
34
|
+
The compatibility baseline is official Codex CLI `0.149.0`, released August 20, 2026, at commit `758ef40f50c1a458425c7cfbf1eb12cbc07af0b0`. It retains the `0.147.0` Responses Lite contract that groups direct function and custom declarations into one canonical `functions` namespace for namespace-capable providers. The `0.148.0`–`0.149.0` review adopted typed misalignment-policy failures while recording official unbounded connection recovery as an intentional bounded-transport deviation. The [official release compatibility log](OFFICIAL_CODEX_CLI_RELEASES.md) is the canonical release-by-release record of protocol and `apply_patch` alignment, intentional deviations, and excluded runtimes. This section is the package's user-facing compatibility contract. See the [Responses Lite compatibility report](RESPONSES_LITE_COMPATIBILITY.md) and [Codex caching and transport comparison](CODEX_CACHE_RESEARCH.md) for detailed request-path findings and live cache trajectories.
|
|
35
35
|
|
|
36
36
|
### Configurable defaults that differ from Codex
|
|
37
37
|
|
|
@@ -63,6 +63,7 @@ The compatibility baseline is official Codex CLI `0.146.0`, released July 29, 20
|
|
|
63
63
|
| Cache preparation | Before the first cache-enabled WebSocket turn, the package prewarms only the stable instruction/tool prefix: ordinary Responses uses empty `input`, while Responses Lite uses `additional_tools` plus the developer instructions. The first generated request then contributes only dynamic conversation input to the continuation. No explicit prompt-cache breakpoints are added. |
|
|
64
64
|
| Mid-turn compaction | Provider-boundary percentage compaction preserves a successful `end_turn:false` prefix as its own Pi assistant message, installs a checkpoint, and continues without synthetic model input. Pi threshold compaction normally runs after the agent response; after Codex output-token truncation, the extension queues a hidden continuation so threshold compaction completes before sampling resumes. Official Codex owns this sampling and compaction loop directly. |
|
|
65
65
|
| Provider-owned follow-up | Completed responses with `end_turn: false` continue immediately from completed native output without synthetic user input. Retryable `response.failed` and all `response.incomplete` events are resampled with the official five-retry stream budget, preserving completed output and cumulative usage while excluding unfinished attempt content. A `max_output_tokens` response that exhausts this budget still becomes Pi `stopReason: "length"` and uses the extension's unbounded host-level continuation recovery. |
|
|
66
|
+
| Transport recovery | WebSocket failures before model-visible output receive five fresh-connection retries before sticky SSE fallback; SSE transport failures receive five retries. Official Codex `0.149.0` separately retries sampling connection-establishment failures indefinitely with delays capped at 60 seconds. The package remains bounded because Fetch does not expose Reqwest's narrower connection-error category, and a phase-only approximation could indefinitely repeat requests that reached the server. |
|
|
66
67
|
| Compaction lifecycle events | Pre-turn percentage compaction writes through Pi's mutable session manager and cannot emit Pi's internal `session_compact` event through the public extension API. Mid-response percentage boundaries and manual, threshold, or overflow compactions initiated by Pi emit the normal lifecycle. |
|
|
67
68
|
| Header hooks | An internal percentage-compaction request reuses the already transformed provider headers. It cannot independently rerun Pi's `before_provider_headers` hook. |
|
|
68
69
|
| Native retained context | Deliberately differs from current Codex. The package retains recent user/developer/system messages under the 64k budget before the opaque compaction item. Current Codex applies a second installed-history filter that drops developer/system wrappers and non-real-user messages, can retain eligible structured agent commentary, and trims oversized function outputs before compaction. Pi keeps its existing checkpoint shape by design. |
|
|
@@ -297,10 +298,17 @@ Compatibility behavior:
|
|
|
297
298
|
- `*** Add File` overwrites an existing file, matching Codex.
|
|
298
299
|
- `*** Move to` overwrites an existing destination, matching Codex.
|
|
299
300
|
- Hunk matching retries exact text, trailing-whitespace-insensitive text, fully trimmed text, and Codex's Unicode punctuation normalization.
|
|
300
|
-
-
|
|
301
|
-
-
|
|
301
|
+
- Matching stops after the official Codex-compatible line matcher. There is no Tree-sitter, Markdown-table, code-fence, formatter-reflow, candidate-ranking, or output-equivalence fallback.
|
|
302
|
+
- Move identity and context chunks must match before the entry is moved; chunkless moves remain byte-opaque.
|
|
302
303
|
- The parser accepts Codex's lenient marker whitespace, blank update-context lines, and direct heredoc wrappers.
|
|
303
304
|
- Empty and identity updates, identical adds, absent deletes, self-moves, and same-patch fulfilled moves succeed with concise `NO CHANGE` results. Inapplicable operations are `SKIPPED` only when later operations deterministically make every effect unobservable.
|
|
305
|
+
- Repeated identical adds use source-ordered virtual content and exact
|
|
306
|
+
spelling, so an earlier add or move can satisfy a later add without a
|
|
307
|
+
redundant replacement.
|
|
308
|
+
- State-dependent `NO CHANGE` results retain source-ordered execution
|
|
309
|
+
checkpoints without rereading the filesystem. A checkpoint after an earlier
|
|
310
|
+
failure is `NOT RUN`; empty updates, identity updates without moves, and
|
|
311
|
+
chunkless lexical self-moves remain unconditional.
|
|
304
312
|
- Model-facing results retain the aggregate A/M/D summary. When any instruction is not applied or an applied instruction has feedback, they list every source-ordered instruction under `Patch instruction results:` as `N. [STATUS] operation`, without an instruction limit; ordinary all-applied results omit the ledger.
|
|
305
313
|
- Combined text updates and moves are labeled `Update & Move`; move-only operations remain `Move`.
|
|
306
314
|
- Replacement feedback always identifies the verified previous and resulting entry types. Symlink feedback also uses the raw target pathname stored in the symlink.
|
|
@@ -308,19 +316,43 @@ Compatibility behavior:
|
|
|
308
316
|
- Opaque moves and symlink deletions use path-only history, so binary bytes and link-target bytes are not serialized as textual deletions.
|
|
309
317
|
- The TUI retains Codex-style changed-file summaries and uses the same conditional instruction ledger; when present, `Ctrl+O` nests complete diffs beneath the instruction that produced them.
|
|
310
318
|
- With `applyPatchDebug` enabled, the tool title becomes `apply_patch (debug)` and a completed collapsed result shows the exact text returned to the model without an extra renderer-only heading; expanding it with `Ctrl+O` still shows the normal visual summary and complete diffs.
|
|
311
|
-
- Failed instruction feedback colocates its error, completed effects, final path states
|
|
319
|
+
- Failed instruction feedback colocates its error, completed effects, and final path states without repeating patch text or using speculative language. Matching failures report the original context or expected-lines mismatch.
|
|
312
320
|
|
|
313
321
|
Filesystem behavior:
|
|
314
322
|
|
|
315
323
|
- Relative paths resolve from Pi's current working directory; absolute paths and `..` traversal are honored.
|
|
316
324
|
- `.git` paths are unrestricted.
|
|
317
325
|
- Text updates follow live symlinks; adds replace live or dangling symlinks without writing through them; deletes remove only the symlink; pure moves move the source symlink; and state-changing moves create a regular file at the destination without writing updated text through a source or destination symlink.
|
|
326
|
+
- Relative symlink targets, including targets containing `..`, resolve from
|
|
327
|
+
the canonical directory containing the link even when the source or moved
|
|
328
|
+
destination is reached through a symlink-parent alias.
|
|
318
329
|
- Entry-only operations and no-op updates do not dereference cyclic or inaccessible symlink targets during mutation-queue acquisition.
|
|
319
330
|
- Same-filesystem pure moves use native rename topology. Cross-filesystem moves copy through a temporary entry, create or replace the destination, and then unlink the source, producing an inode independent from remaining source hard links.
|
|
320
|
-
-
|
|
331
|
+
- Supplied identity or context chunks validate a pure move through the text matcher without rewriting the moved entry. A blank `@@` therefore requires valid UTF-8; omit chunks for arbitrary binary content.
|
|
332
|
+
- Strict edits preserve the matched region's local CRLF or mixed line endings.
|
|
333
|
+
- In-place text updates use a direct path write, following source symlinks and
|
|
334
|
+
preserving normal hard-link visibility.
|
|
335
|
+
- Adds and text updates verify the complete expected final byte buffer
|
|
336
|
+
byte-for-byte before succeeding. This is whole-file equality, not a
|
|
337
|
+
substring search, so duplicate or unrelated regions cannot satisfy the
|
|
338
|
+
postcondition. Deletes verify absence; moves verify their source,
|
|
339
|
+
destination type, exact destination spelling, native identity where
|
|
340
|
+
available, known bytes, and raw symlink target.
|
|
321
341
|
- The extension does not add path filtering, sandboxing, or approval prompts.
|
|
322
342
|
- Every hunk is parsed and validated before filesystem writes begin.
|
|
323
|
-
-
|
|
343
|
+
- No-change checkpoints are interleaved with mutations in patch order, so
|
|
344
|
+
later checkpoints are not reported as completed after an earlier failure.
|
|
345
|
+
- Mutations participate in Pi's per-file mutation queue for the complete
|
|
346
|
+
preflight-and-execution window. Queue paths are acquired deterministically,
|
|
347
|
+
follow operation-specific symlink semantics, and include every move source
|
|
348
|
+
and destination. There is no additional extension-local alias queue.
|
|
349
|
+
|
|
350
|
+
Operating model: relevant filesystem state is not modified outside the queued
|
|
351
|
+
`apply_patch` execution window. This includes ancestor paths, symlink targets,
|
|
352
|
+
hard-link aliases, callbacks, injected filesystem hooks, separate Pi sessions,
|
|
353
|
+
and external processes. Preflight is authoritative under this model; the
|
|
354
|
+
executor does not attempt cross-process drift detection or transactional
|
|
355
|
+
isolation.
|
|
324
356
|
|
|
325
357
|
A low-level I/O failure can still complete part of an instruction. The failed
|
|
326
358
|
instruction reports every confirmed effect and final path state; when a path
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## OpenAI Codex
|
|
4
4
|
|
|
5
|
-
The `apply_patch` grammar, parser behavior,
|
|
5
|
+
The `apply_patch` grammar, parser behavior, line matching, mutation semantics, result formatting, diff rendering, standalone image-generation behavior, standalone web-search behavior, tool schemas, and compatibility scenarios in this package are adapted for Pi from the public OpenAI Codex implementation.
|
|
6
6
|
|
|
7
7
|
OpenAI Codex, Copyright 2025 OpenAI
|
|
8
8
|
|
|
@@ -19,29 +19,3 @@ Pi AI, Copyright (c) 2025 Mario Zechner
|
|
|
19
19
|
Pi AI is licensed under the MIT License. A copy is included at [`LICENSES/pi-ai-MIT.txt`](LICENSES/pi-ai-MIT.txt).
|
|
20
20
|
|
|
21
21
|
Source: <https://github.com/earendil-works/pi/tree/main/packages/ai>
|
|
22
|
-
|
|
23
|
-
## Tree-sitter WASMs
|
|
24
|
-
|
|
25
|
-
`@2h2d/tree-sitter-wasms` supplies lifecycle-free grammar WASM assets used for
|
|
26
|
-
formatter-tolerant `apply_patch` matching.
|
|
27
|
-
|
|
28
|
-
Tree-sitter WASMs, Copyright (c) 2026 Kaan Ozdokmeci
|
|
29
|
-
|
|
30
|
-
Tree-sitter WASMs is licensed under the MIT License. A copy is included at
|
|
31
|
-
[`LICENSES/tree-sitter-wasms-MIT.txt`](LICENSES/tree-sitter-wasms-MIT.txt).
|
|
32
|
-
The dependency package includes the exact upstream license for each bundled
|
|
33
|
-
grammar under its own `LICENSES` directory.
|
|
34
|
-
|
|
35
|
-
Source: <https://github.com/2h2d-co/tree-sitter-wasms>
|
|
36
|
-
|
|
37
|
-
## Web Tree-sitter
|
|
38
|
-
|
|
39
|
-
`web-tree-sitter` supplies the official Tree-sitter WASM runtime used to load
|
|
40
|
-
and execute the packaged grammars.
|
|
41
|
-
|
|
42
|
-
Web Tree-sitter, Copyright (c) 2018 Max Brunsfeld
|
|
43
|
-
|
|
44
|
-
Web Tree-sitter is licensed under the MIT License. A copy is included at
|
|
45
|
-
[`LICENSES/web-tree-sitter-MIT.txt`](LICENSES/web-tree-sitter-MIT.txt).
|
|
46
|
-
|
|
47
|
-
Source: <https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_web>
|