@estebanforge/pi-antigravity-bridge 1.16.0 → 1.16.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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/provider.ts +11 -8
- package/src/sysprompt-agent.ts +47 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.16.1] - 2026-11-28
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- stream-json provider sessions no longer fail every turn with `RESOURCE_EXHAUSTED (code 429)` at 0% quota use when pi runs with its default system prompt. Two lines of that prompt make the Antigravity backend reject any request of a session whose carrier agent holds them: the opening sentence ("running inside pi, a coding agent harness") and the docs-index line ("- When asked about: extensions (docs/..."). The carrier now rewords the first and omits the second; a custom system prompt passes through unchanged. The backend rule behind the two lines is unknown (the upstream match is not exact text), so this is a point fix: an upstream reword of pi's default prompt can bring the 429 back, and the `sysprompt-scrub` staging log event then shows whether the scrub still matched (needs `AGY_DEBUG=1`; the daily log is error-only by default).
|
|
10
|
+
|
|
5
11
|
## [1.16.0] - 2026-11-26
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@estebanforge/pi-antigravity-bridge",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"description": "Gemini provider for Pi on the Antigravity ACP server (official Google ACP) or the stream-json agy CLI. Use antigravity/* models in Pi. Full /model picker support. Models runs Pi's tools. ToS safe to use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
package/src/provider.ts
CHANGED
|
@@ -48,7 +48,7 @@ import { GATE_MARKER, mapNativeToShadow, stripMarkerFields } from "./approval-ga
|
|
|
48
48
|
import type { ApprovalDecision, ApprovalPayload, ApprovalParkApi } from "./mcp-server.js";
|
|
49
49
|
import path from "node:path";
|
|
50
50
|
import { TurnDiffContext, createExecGitOps, formatInlineDiff, parseEditToolInput } from "./diff-render.js";
|
|
51
|
-
import { stageSyspromptAgent } from "./sysprompt-agent.js";
|
|
51
|
+
import { carrierScrubInfo, stageSyspromptAgent } from "./sysprompt-agent.js";
|
|
52
52
|
import { buildImageNote, stagePromptImages } from "./prompt-images.js";
|
|
53
53
|
|
|
54
54
|
const DEFAULT_TIMEOUT_MIN = 10;
|
|
@@ -2340,14 +2340,17 @@ async function runTurnDriver(
|
|
|
2340
2340
|
let agent = config.agent;
|
|
2341
2341
|
if (deps.engine !== "acp") {
|
|
2342
2342
|
if (rawSysPrompt && !config.agent) {
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
);
|
|
2343
|
+
const stagedBody = [
|
|
2344
|
+
SYSTEM_PROMPT_PREAMBLE,
|
|
2345
|
+
rawSysPrompt,
|
|
2346
|
+
toolNotes({ codemodeOnly: codemodeNote, acpToolsDirect }),
|
|
2347
|
+
].join("\n\n");
|
|
2348
|
+
const stagedName = stageSyspromptAgent(stagedBody);
|
|
2350
2349
|
if (stagedName) {
|
|
2350
|
+
// Issue #30 telemetry: separates "scrub ran, still 429" from
|
|
2351
|
+
// "pi reworded upstream and the scrub no longer matches".
|
|
2352
|
+
const scrub = carrierScrubInfo(stagedBody);
|
|
2353
|
+
deps.log?.("sysprompt-scrub", { opening: scrub.opening, docsLine: scrub.docsLine }, "info");
|
|
2351
2354
|
agent = stagedName;
|
|
2352
2355
|
sysPrompt = undefined;
|
|
2353
2356
|
stagedAgentName = stagedName;
|
package/src/sysprompt-agent.ts
CHANGED
|
@@ -46,6 +46,52 @@ export function syspromptAgentsRoot(): string {
|
|
|
46
46
|
return process.env.AGY_AGENTS_ROOT ?? path.join(os.homedir(), ".gemini", "config", "agents");
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/** Opening sentence of pi's default system prompt, and the wording the carrier
|
|
50
|
+
* ships instead. */
|
|
51
|
+
export const PI_OPENING = "running inside pi, a coding agent harness";
|
|
52
|
+
const PI_OPENING_REWORDED = "running inside the pi coding agent harness";
|
|
53
|
+
/** Start of the docs-index line of pi's default system prompt. */
|
|
54
|
+
export const PI_DOCS_INDEX_PREFIX = "- When asked about: extensions (docs/";
|
|
55
|
+
|
|
56
|
+
/** Scrubbed carrier text plus which scrubs applied (the `sysprompt-scrub`
|
|
57
|
+
* staging event's payload). */
|
|
58
|
+
export interface CarrierScrub {
|
|
59
|
+
text: string;
|
|
60
|
+
opening: boolean;
|
|
61
|
+
docsLine: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Two lines of pi's default system prompt make the Antigravity backend answer
|
|
65
|
+
* `RESOURCE_EXHAUSTED (code 429)` to every request of a carrier session, each
|
|
66
|
+
* on its own and at 0% quota use (probed 2026-11-27, agy 1.5.18, with
|
|
67
|
+
* gemini-4-hydrogen, gemini-4-neon and claude-sonnet-5-5): the opening
|
|
68
|
+
* sentence and the docs-index line. A carrier holding either one never
|
|
69
|
+
* completes a turn. Reword the first (same meaning) and drop the second (it
|
|
70
|
+
* only maps pi's own docs for questions about the harness). The match is
|
|
71
|
+
* exact on purpose: a custom system prompt passes through untouched.
|
|
72
|
+
* Point fix (issue #30): the backend rule behind the two lines is unknown
|
|
73
|
+
* (the upstream match is not exact text), so a future reword of pi's prompt
|
|
74
|
+
* can silently re-break staging; the provider's `sysprompt-scrub` staging
|
|
75
|
+
* event exists to tell "scrub ran, still 429" from "scrub no longer
|
|
76
|
+
* matches" (needs AGY_DEBUG=1: the daily log is error-only by default). */
|
|
77
|
+
export function carrierScrubInfo(body: string): CarrierScrub {
|
|
78
|
+
const lines = body.split("\n");
|
|
79
|
+
const kept = lines.filter((line) => !line.startsWith(PI_DOCS_INDEX_PREFIX));
|
|
80
|
+
const keptText = kept.join("\n");
|
|
81
|
+
return {
|
|
82
|
+
text: keptText.replaceAll(PI_OPENING, PI_OPENING_REWORDED),
|
|
83
|
+
// On the kept text: the phrase sitting only inside a dropped docs line
|
|
84
|
+
// must not report a reword that never happened.
|
|
85
|
+
opening: keptText.includes(PI_OPENING),
|
|
86
|
+
docsLine: kept.length !== lines.length,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** carrierScrubInfo's text, for callers that do not log the flags. */
|
|
91
|
+
export function carrierSafeBody(body: string): string {
|
|
92
|
+
return carrierScrubInfo(body).text;
|
|
93
|
+
}
|
|
94
|
+
|
|
49
95
|
/** agent.md for the carrier. The body is the pi system prompt composed by the
|
|
50
96
|
* provider (preamble + transcript system prompt + tool-priority note). */
|
|
51
97
|
export function syspromptAgentMd(name: string, body: string): string {
|
|
@@ -70,7 +116,7 @@ export function syspromptAgentMd(name: string, body: string): string {
|
|
|
70
116
|
" - search_web",
|
|
71
117
|
"---",
|
|
72
118
|
"",
|
|
73
|
-
body,
|
|
119
|
+
carrierSafeBody(body),
|
|
74
120
|
"",
|
|
75
121
|
].join("\n");
|
|
76
122
|
}
|