Repository navigation
feat(bridge): opt-in appControl session discovery (read-only) - #15
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Roadmap stage 12. The new appControlEnabled setting (default off) flows
into the runtime-preferences flag, so CLI >= 3.18 registers its native
App-control tools for sessions started with it on. The bridge answers the
twelve closed appControl/* reverse RPC intents:
- listProjects: an empty host-scoped catalog (bb has no project surface
for the tools; listSessions works without a project filter);
- listSessions: this worker's live ZCode sessions as app-scoped session
summaries ({kind: app, sessionId, workspacePath}, title = the bb thread
id, running/idle from the live timeline);
- readSession: summary view, or a messages view mapped from the native
session/messages lane (read-only, 5 s bound) onto the {id, role, text}
wire - afterMessageId and limit are forwarded;
- appControl/cancel answers {cancelled: false};
every mutating or UI action (create, fork, send, wait, interrupt, rename,
open, archive, pin) is rejected with the stable unavailable error code,
and the caller binding must match the live connection the reverse request
arrived on. The setting description records the security posture: any
session started with it on can read the other live ZCode threads of this
bb.
With the setting off the methods fall through to the typed
not-implemented reply and the CLI never registers the tools. Wire shapes
extracted from upstream @zcode/session-control contracts at fec9759;
live CLI verification is pending (the local Desktop 3.17.2 bundle predates
the surface).
27b31e5 to
7c6768f
Compare
|
No findings were raised on this PR (Codex: clean on |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c6768ff63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| used = count(p.contextUsed) ?? snapshot?.usedTokens, | ||
| size = | ||
| count(windowOverride ?? p.contextWindow) ?? | ||
| snapshot?.contextWindowTokens; |
There was a problem hiding this comment.
Keep the context meter aligned with its attached snapshot
When the projection's contextUsed differs from the composition's providerContextTokens, this emits two different usage totals in the same delta: used comes from the projection, while snapshot.usedTokens and its free category come from the composition. These are separate measurements fetched sequentially in finishTurn, so they need not agree. For example, a projection reporting 1,234 tokens and a composition reporting 1,000 produces a meter and breakdown with contradictory totals. When attaching a snapshot, use its usage and window consistently for the enclosing meter; retain the projection values for the snapshot-less fallback.
Useful? React with 👍 / 👎.
caf1559 to
6ddd27e
Compare
Review finding: the projection read and the composition query are two sequential fetches whose totals need not agree, so a delta that took from the projection while its snapshot carried the composition's providerContextTokens reported contradictory usage in one place. When a snapshot is attached it now supplies the meter's usage and window; the projection values remain authoritative only for the snapshot-less fallback.
|
P2 fixed in |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Stage 12 of the November upstream plan — the decision that was parked
Decision taken: ship the read-only subset behind an off-by-default
setting (
appControlEnabled), same posture as automations and dynamicworkflows. Mutating actions are rejected, cross-thread read access is
documented in the setting description.
Change
With the setting on, the runtime-preferences flag makes CLI ≥ 3.18 register
the native App-control tools; the bridge answers the twelve closed
appControl/*reverse-RPC intents (wire shapes from upstream@zcode/session-controlcontracts atfec9759):listProjectslistSessionsneeds no filter)listSessions{kind: app, sessionId, workspacePath}summaries, title = bb thread id, running/idle from the live timeline,availableActions: [readSession]readSession(summary)readSession(messages)session/messageslane (read-only, 5 s bound) mapped onto{id, role, text};afterMessageId/limitforwardedappControl/cancel{cancelled: false}{ok: false, error: {code: "unavailable", …}}The caller binding (
callerSessionId) must match the live connection thereverse request arrived on. With the setting off, the methods fall through
to the typed not-implemented reply and the CLI never registers the tools.
Verification
list/summary/messages round-trip (fake
session/messagesfixture); on →mutation + foreign-binding denials.
typecheck,format:checkclean.the appControl surface (recorded in knowledge).
Docs: roadmap stage 12 closed with the decision rationale, CHANGELOG,
docs/configuration.md(security posture),knowledge/log.md.Stack: based on #14 ← #13; merge in that order.