instar 1.3.266 → 1.3.268
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/dist/core/IdentityRenderer.d.ts.map +1 -1
- package/dist/core/IdentityRenderer.js +1 -0
- package/dist/core/IdentityRenderer.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +5 -1
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/monitoring/PromptGate.d.ts +3 -2
- package/dist/monitoring/PromptGate.d.ts.map +1 -1
- package/dist/monitoring/PromptGate.js +77 -0
- package/dist/monitoring/PromptGate.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +4 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +20 -20
- package/src/scaffold/templates.ts +4 -0
- package/src/templates/scripts/telegram-reply.sh +22 -0
- package/upgrades/1.3.267.md +25 -0
- package/upgrades/1.3.268.md +55 -0
- package/upgrades/side-effects/gemini-interactive-modal-autofill.md +85 -0
- package/upgrades/side-effects/telegram-reply-robust-content.md +31 -0
- package/upgrades/telegram-reply-robust-content.eli16.md +11 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Side-effects review — Gemini interactive modal autofill
|
|
2
|
+
|
|
3
|
+
## What changed
|
|
4
|
+
|
|
5
|
+
`PromptGate` now has a structural matcher for known Gemini CLI framework modals
|
|
6
|
+
that block autonomous sessions:
|
|
7
|
+
|
|
8
|
+
- loop detection: sends the explicit "keep loop detection enabled" option when
|
|
9
|
+
visible, otherwise sends `Enter` for the live default path Justin observed;
|
|
10
|
+
- workspace trust: sends the explicit trust/yes/allow option when visible,
|
|
11
|
+
otherwise sends `Enter`;
|
|
12
|
+
- install confirmation: sends `Enter` to accept Gemini CLI's highlighted/default
|
|
13
|
+
response.
|
|
14
|
+
|
|
15
|
+
These matches run before the generic question, selection, and LLM prompt
|
|
16
|
+
detection paths. The existing server wiring already consumes `autoDismissKey` by
|
|
17
|
+
sending that key to the tmux session and skipping the relay/classifier pipeline.
|
|
18
|
+
|
|
19
|
+
## Why
|
|
20
|
+
|
|
21
|
+
The failure mode is a real autonomy wedge. Instar detected the Gemini modal and
|
|
22
|
+
forwarded it to Telegram, but the Gemini CLI process stayed blocked waiting for
|
|
23
|
+
keypress input in the pane. YOLO mode does not suppress these Gemini CLI modals.
|
|
24
|
+
|
|
25
|
+
Loop detection is a safety rail, so the auto-answer keeps it enabled. Workspace
|
|
26
|
+
trust is part of normal agent operation in the bound project. Install-confirm is
|
|
27
|
+
handled as Gemini CLI's own highlighted/default decision, not as a broad "yes to
|
|
28
|
+
any install" rule.
|
|
29
|
+
|
|
30
|
+
## Risk
|
|
31
|
+
|
|
32
|
+
Blast radius is limited to prompt detection. There is no schema, database,
|
|
33
|
+
configuration, route, migration, Telegram adapter, or session-spawn change.
|
|
34
|
+
|
|
35
|
+
The main risk is false positive auto-answering. The patterns are constrained to
|
|
36
|
+
Gemini-specific modal text or Gemini/MCP/tool install context, and the generic
|
|
37
|
+
non-Gemini install fixture proves a plain install question does not receive an
|
|
38
|
+
auto-answer. Existing broad prompt patterns still handle unrelated questions and
|
|
39
|
+
confirmations the same way they did before.
|
|
40
|
+
|
|
41
|
+
The second risk is semantic drift if Gemini CLI changes its wording. The loop
|
|
42
|
+
modal uses the live phrase Justin observed ("A potential loop was detected") and
|
|
43
|
+
falls back to `Enter` when no numbered row is visible. Workspace and install
|
|
44
|
+
patterns also accept option rows where Gemini renders numeric choices.
|
|
45
|
+
|
|
46
|
+
## Framework generality
|
|
47
|
+
|
|
48
|
+
Claude Code and Codex CLI behavior is unchanged. Their existing Prompt Gate
|
|
49
|
+
patterns still run after this new Gemini-specific matcher, and the new matcher
|
|
50
|
+
requires Gemini-specific loop/trust/install context before it emits an
|
|
51
|
+
`autoDismissKey`.
|
|
52
|
+
|
|
53
|
+
This fix is explicitly for `gemini-cli`, and it reaches Gemini sessions through
|
|
54
|
+
the same provider-neutral `PromptGate` and `SessionManager.sendKey` abstraction
|
|
55
|
+
already used by Claude optional-survey dismissal and manual Telegram prompt
|
|
56
|
+
responses.
|
|
57
|
+
|
|
58
|
+
## Tests
|
|
59
|
+
|
|
60
|
+
- Unit: `tests/unit/PromptGate.test.ts` covers Gemini loop detection with
|
|
61
|
+
numbered options, the live no-option loop modal shape, workspace trust,
|
|
62
|
+
install confirmation, and a generic non-Gemini install question that must not
|
|
63
|
+
auto-answer.
|
|
64
|
+
- Unit: existing `InputClassifier` and `AutoApprover` tests stay green, proving
|
|
65
|
+
the normal classification and approval layers were not widened.
|
|
66
|
+
- Focused run: `npm test -- --run tests/unit/PromptGate.test.ts tests/unit/InputClassifier.test.ts tests/unit/AutoApprover.test.ts`
|
|
67
|
+
passed with 95 tests.
|
|
68
|
+
- Integration: `npm test -- --run tests/integration/stall-recovery-e2e.test.ts`
|
|
69
|
+
passed with 12 tests.
|
|
70
|
+
- E2E: `npm test -- --run tests/e2e/gemini-loop-driver-lifecycle.test.ts tests/e2e/gemini-capacity-policy-lifecycle.test.ts`
|
|
71
|
+
passed with 4 tests.
|
|
72
|
+
- Type/lint: `npm run lint` passed.
|
|
73
|
+
|
|
74
|
+
An attempted broader session-management e2e smoke was not used as acceptance
|
|
75
|
+
evidence: `tests/e2e/session-management-e2e.test.ts` hit the existing respawn
|
|
76
|
+
fixture timing/session-loss path (`waitFor timed out after 15000ms`) while 30/31
|
|
77
|
+
tests passed under a longer timeout. That file does not exercise this PromptGate
|
|
78
|
+
matcher and the failure was in tmux respawn injection, not modal detection.
|
|
79
|
+
|
|
80
|
+
## Rollback
|
|
81
|
+
|
|
82
|
+
Revert the PromptGate matcher and tests. No persisted state or migration is
|
|
83
|
+
introduced. Rollback restores the previous behavior where Gemini CLI modals are
|
|
84
|
+
detected/relayed but may remain blocked until a human presses the key in the
|
|
85
|
+
terminal.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Side-effects review — telegram reply robust content mode
|
|
2
|
+
|
|
3
|
+
## What changed
|
|
4
|
+
|
|
5
|
+
`telegram-reply.sh` now accepts `--stdin-base64` / `--base64-stdin`. In that mode, the script decodes the provided base64 payload before building the existing JSON request body. This gives agents a transport-safe path when the reply text itself contains shell metacharacters, quotes, JSON-looking text, or a literal heredoc delimiter line.
|
|
6
|
+
|
|
7
|
+
The normal heredoc path remains unchanged. The new mode is additive and only activates when the flag is present.
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
The standard relay instruction uses a single-quoted heredoc. That protects most shell-sensitive text, but it still fails when the response body contains a line that exactly matches the heredoc delimiter. During Gemini mentoring, Gemi hit this class directly: its heredoc relay attempt ended in a shell syntax error, then it recovered by squeezing the response into a quoted argument. That workaround is fragile for long or structured replies.
|
|
12
|
+
|
|
13
|
+
Base64 stdin moves the fragile bytes out of shell syntax entirely. The shell only carries base64 characters; the canonical reply script restores the original text before sending.
|
|
14
|
+
|
|
15
|
+
## Migration footprint
|
|
16
|
+
|
|
17
|
+
Existing unmodified `telegram-reply.sh` copies are SHA-migrated by `PostUpdateMigrator`. This PR registers the v1.3.266 template SHA as a prior shipped version so deployed agents receive the new script on update. Locally modified scripts are still preserved: the migrator writes a `.new` candidate and reports the existing relay-script-modified-locally degradation instead of overwriting custom content.
|
|
18
|
+
|
|
19
|
+
Generated identity/scaffold guidance now keeps the familiar heredoc example and adds the base64 fallback for delimiter-sensitive content.
|
|
20
|
+
|
|
21
|
+
## Risk
|
|
22
|
+
|
|
23
|
+
Low. The default send path, HTTP route, auth headers, port resolution, tone-gate handling, 408 ambiguous handling, recoverable relay queue, and JSON body shape are unchanged. The new branch only decodes input before the existing JSON builder.
|
|
24
|
+
|
|
25
|
+
The main operational risk is invalid base64 input; the script exits before contacting the server and prints a clear error.
|
|
26
|
+
|
|
27
|
+
## Tests
|
|
28
|
+
|
|
29
|
+
- Unit: `tests/unit/telegram-reply-port-resolution.test.ts` now proves `--stdin-base64` sends shell-sensitive text and a literal `EOF` line as exact message text.
|
|
30
|
+
- Unit: existing `PostUpdateMigrator-telegramReply`, `migration-relay-script-hash`, `IdentityRenderer`, and `telegramRelayPrompt` tests cover migration and generated guidance.
|
|
31
|
+
- Focused run: 58 tests passed across those five files.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# ELI16 — Telegram Reply Robust Content Mode
|
|
2
|
+
|
|
3
|
+
Agents usually send Telegram replies by pasting the reply into a shell heredoc. That is fine for normal text, but it can break if the reply itself contains the heredoc closing word on its own line.
|
|
4
|
+
|
|
5
|
+
This change adds a safer backup path. The reply script can now accept base64 text, decode it, and send the original message. That means the shell only sees safe base64 characters, while Telegram receives the real reply text.
|
|
6
|
+
|
|
7
|
+
Nothing changes for ordinary replies. The normal heredoc command still works, the server route is the same, and the script still builds the same JSON body after it has the final text. The new flag only changes how the text gets into the script.
|
|
8
|
+
|
|
9
|
+
Existing agents with the standard reply script are upgraded automatically. The migrator recognizes the last shipped script by its hash, backs it up, and installs the new version. If an operator edited the script locally, Instar does not overwrite it. Instead it writes the new version next to it as a review candidate, preserving the local customization.
|
|
10
|
+
|
|
11
|
+
This matters for agents because reply failures are easy to miss: the user sees silence, while the agent may only see a shell error in its pane. The safer path gives agents a reliable escape hatch for long reports, code examples, JSON snippets, or any text that accidentally contains the heredoc closing line.
|