@oh-my-pi/pi-coding-agent 15.10.1 → 15.10.2
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/CHANGELOG.md +67 -0
- package/dist/types/cli/startup-cwd.d.ts +2 -0
- package/dist/types/commands/launch.d.ts +3 -0
- package/dist/types/config/keybindings.d.ts +2 -2
- package/dist/types/config/model-provider-priority.d.ts +1 -0
- package/dist/types/config/model-resolver.d.ts +4 -1
- package/dist/types/config/settings.d.ts +7 -2
- package/dist/types/debug/report-bundle.d.ts +3 -0
- package/dist/types/edit/file-snapshot-store.d.ts +18 -10
- package/dist/types/eval/py/__tests__/prelude.test.d.ts +1 -0
- package/dist/types/extensibility/extensions/types.d.ts +4 -1
- package/dist/types/lsp/client.d.ts +10 -0
- package/dist/types/main.d.ts +3 -9
- package/dist/types/mcp/tool-bridge.d.ts +2 -0
- package/dist/types/modes/components/custom-editor.d.ts +1 -1
- package/dist/types/modes/components/status-line.d.ts +2 -0
- package/dist/types/modes/controllers/event-controller.d.ts +17 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/magic-keywords.d.ts +1 -1
- package/dist/types/modes/markdown-prose.d.ts +1 -1
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/modes/workflow.d.ts +3 -3
- package/dist/types/session/auth-storage.d.ts +1 -1
- package/dist/types/session/session-manager.d.ts +5 -2
- package/dist/types/task/executor.d.ts +10 -0
- package/dist/types/tools/eval.d.ts +8 -0
- package/dist/types/tools/gh-cache-invalidation.d.ts +6 -0
- package/dist/types/tools/github-cache.d.ts +12 -0
- package/dist/types/tools/path-utils.d.ts +8 -0
- package/dist/types/tools/search.d.ts +2 -2
- package/dist/types/tools/yield.d.ts +8 -0
- package/package.json +9 -9
- package/src/cli/args.ts +3 -1
- package/src/cli/dry-balance-cli.ts +2 -4
- package/src/cli/startup-cwd.ts +68 -0
- package/src/commands/launch.ts +3 -0
- package/src/commit/model-selection.ts +3 -2
- package/src/config/model-provider-priority.ts +55 -0
- package/src/config/model-registry.ts +4 -22
- package/src/config/model-resolver.ts +39 -7
- package/src/config/settings.ts +86 -41
- package/src/debug/index.ts +8 -0
- package/src/debug/raw-sse-buffer.ts +7 -4
- package/src/debug/report-bundle.ts +9 -0
- package/src/edit/file-snapshot-store.ts +33 -1
- package/src/edit/hashline/filesystem.ts +2 -1
- package/src/eval/__tests__/llm-bridge.test.ts +20 -0
- package/src/eval/js/context-manager.ts +32 -15
- package/src/eval/llm-bridge.ts +14 -3
- package/src/eval/py/__tests__/prelude.test.ts +19 -0
- package/src/eval/py/executor.ts +23 -11
- package/src/eval/py/prelude.py +1 -1
- package/src/extensibility/extensions/types.ts +10 -1
- package/src/internal-urls/docs-index.generated.ts +3 -3
- package/src/lsp/client.ts +23 -11
- package/src/lsp/config.ts +11 -1
- package/src/lsp/index.ts +61 -9
- package/src/main.ts +91 -65
- package/src/mcp/tool-bridge.ts +2 -0
- package/src/memories/index.ts +2 -2
- package/src/modes/components/custom-editor.ts +143 -111
- package/src/modes/components/model-selector.ts +59 -13
- package/src/modes/components/oauth-selector.ts +33 -7
- package/src/modes/components/status-line.ts +19 -4
- package/src/modes/components/tips.txt +1 -1
- package/src/modes/components/user-message.ts +1 -1
- package/src/modes/controllers/event-controller.ts +26 -0
- package/src/modes/controllers/input-controller.ts +46 -7
- package/src/modes/interactive-mode.ts +107 -20
- package/src/modes/magic-keywords.ts +1 -1
- package/src/modes/markdown-prose.ts +1 -1
- package/src/modes/theme/shimmer.ts +20 -9
- package/src/modes/types.ts +3 -0
- package/src/modes/workflow.ts +10 -10
- package/src/prompts/system/workflow-notice.md +1 -1
- package/src/prompts/tools/bash.md +9 -0
- package/src/prompts/tools/browser.md +1 -1
- package/src/prompts/tools/eval.md +2 -1
- package/src/prompts/tools/read.md +2 -2
- package/src/sdk.ts +26 -9
- package/src/session/agent-session.ts +37 -12
- package/src/session/auth-storage.ts +2 -0
- package/src/session/session-manager.ts +96 -23
- package/src/task/executor.ts +71 -36
- package/src/task/render.ts +3 -4
- package/src/tools/bash.ts +7 -0
- package/src/tools/browser/tab-supervisor.ts +13 -1
- package/src/tools/browser/tab-worker.ts +33 -4
- package/src/tools/eval.ts +13 -2
- package/src/tools/find.ts +7 -0
- package/src/tools/gh-cache-invalidation.ts +200 -0
- package/src/tools/github-cache.ts +25 -0
- package/src/tools/inspect-image.ts +2 -2
- package/src/tools/path-utils.ts +28 -2
- package/src/tools/plan-mode-guard.ts +52 -7
- package/src/tools/read.ts +25 -12
- package/src/tools/search.ts +38 -3
- package/src/tools/write.ts +2 -2
- package/src/tools/yield.ts +10 -1
- package/src/utils/commit-message-generator.ts +2 -2
- package/src/utils/enhanced-paste.ts +30 -2
- package/src/web/search/providers/codex.ts +37 -8
|
@@ -114,8 +114,34 @@ interface CodexResponse {
|
|
|
114
114
|
usage?: CodexUsage;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Known Codex "image placeholder" answers — short prose the assistant emits in
|
|
119
|
+
* place of a real answer when it produced a screenshot instead of text. These
|
|
120
|
+
* carry no information, so callers treat them as non-answers and advance the
|
|
121
|
+
* chain to a provider that returns text. Extend by adding the normalized
|
|
122
|
+
* literal below; no regex tuning required.
|
|
123
|
+
*/
|
|
124
|
+
const IMAGE_PLACEHOLDER_ANSWERS: ReadonlySet<string> = new Set([
|
|
125
|
+
"see attached image",
|
|
126
|
+
"attached image",
|
|
127
|
+
"see the attached image",
|
|
128
|
+
"see image",
|
|
129
|
+
"see image above",
|
|
130
|
+
"image above",
|
|
131
|
+
"see image below",
|
|
132
|
+
"image below",
|
|
133
|
+
]);
|
|
134
|
+
|
|
117
135
|
function isImagePlaceholderAnswer(text: string): boolean {
|
|
118
|
-
|
|
136
|
+
// Strip surrounding brackets/quotes and trailing punctuation, lowercase,
|
|
137
|
+
// then match against the known-placeholder set.
|
|
138
|
+
const normalized = text
|
|
139
|
+
.trim()
|
|
140
|
+
.replace(/^[[("'`*_]+/, "")
|
|
141
|
+
.replace(/[\])"'`*_.!?]+$/, "")
|
|
142
|
+
.trim()
|
|
143
|
+
.toLowerCase();
|
|
144
|
+
return IMAGE_PLACEHOLDER_ANSWERS.has(normalized);
|
|
119
145
|
}
|
|
120
146
|
|
|
121
147
|
function addSource(sources: SearchSource[], source: SearchSource): void {
|
|
@@ -423,15 +449,18 @@ async function callCodexSearch(
|
|
|
423
449
|
|
|
424
450
|
const finalAnswer = answerParts.join("\n\n").trim();
|
|
425
451
|
const streamedAnswer = streamedAnswerParts.join("").trim();
|
|
426
|
-
|
|
452
|
+
// Throw to advance the chain whenever Codex emitted nothing but image
|
|
453
|
+
// placeholder prose — including the case where the streamed delta itself
|
|
454
|
+
// is the placeholder (the model occasionally streams the same text it
|
|
455
|
+
// publishes as the final output_text).
|
|
456
|
+
const finalIsPlaceholder = finalAnswer.length > 0 && isImagePlaceholderAnswer(finalAnswer);
|
|
457
|
+
const streamedIsPlaceholder = streamedAnswer.length > 0 && isImagePlaceholderAnswer(streamedAnswer);
|
|
458
|
+
const hasFinalText = finalAnswer.length > 0 && !finalIsPlaceholder;
|
|
459
|
+
const hasStreamedText = streamedAnswer.length > 0 && !streamedIsPlaceholder;
|
|
460
|
+
if (!hasFinalText && !hasStreamedText && sources.length === 0) {
|
|
427
461
|
throw new SearchProviderError("codex", "Codex returned image-only response", 502);
|
|
428
462
|
}
|
|
429
|
-
const answer =
|
|
430
|
-
finalAnswer.length > 0 && !isImagePlaceholderAnswer(finalAnswer)
|
|
431
|
-
? finalAnswer
|
|
432
|
-
: streamedAnswer.length > 0
|
|
433
|
-
? streamedAnswer
|
|
434
|
-
: finalAnswer;
|
|
463
|
+
const answer = hasFinalText ? finalAnswer : hasStreamedText ? streamedAnswer : "";
|
|
435
464
|
|
|
436
465
|
// Fallback: when Codex omits url_citation annotations, scrape markdown links
|
|
437
466
|
// and bare URLs from the synthesized answer so callers still receive sources.
|