Repository navigation
refactor(telegram): split bot handler runtime - #106324
Conversation
|
Land-ready at exact head Proof:
Known gap/baseline:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 377c734596
ℹ️ 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".
| if (!agentId) { | ||
| continue; |
There was a problem hiding this comment.
Include unprefixed sessions in transcript search
When the visible list contains unprefixed/default sessions such as main, resolveAgentId(row.key) returns undefined, so this continue drops those rows from keysByAgent. The previous page-level transcript search still covered the default agent, and the gateway supports disambiguating unscoped sessionKeys with agentId; with this change, transcript search on an all-default Sessions page can silently return no results even though the visible main transcript matches. Please group unprefixed keys under the resolved default/selected agent instead of skipping them.
Useful? React with 👍 / 👎.
| @@ -20,6 +20,7 @@ async function loadSessionsRoute( | |||
| const gatewaySnapshot = gateway.snapshot; | |||
| const options = routeOptions(location); | |||
| const checkpointAgentId = parseAgentSessionKey(options.expandedSessionKey)?.agentId; | |||
| const scopeAgentId = checkpointAgentId ?? context.agentSelection.state.scopeId; | |||
There was a problem hiding this comment.
Keep unprefixed session deep links unscoped
When a user is scoped to another agent and opens a deep link like /settings/sessions?session=main, parseAgentSessionKey() returns no checkpointAgentId, so this falls back to the current page scope and the loader sends sessions.list with search=main plus that unrelated agentId. The previous behavior only scoped prefixed deep links, and sessionListOptions() still leaves unprefixed deep links unscoped; this change can show an empty page for a valid shared/default session link. Keep deep-link lookups unscoped unless the session key itself identifies an agent.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 8:31 AM ET / 12:31 UTC. Summary Reproducibility: yes. at source level: the unchanged head still skips session keys whose agent cannot be parsed and scopes unprefixed deep links to the current selected agent. No live runtime reproduction was supplied. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Recreate the change from current main as a Telegram-only extraction preserving registration order and shared lifecycle state, include focused regression coverage, and attach a redacted live Telegram smoke transcript or runtime logs before merge. Do we have a high-confidence way to reproduce the issue? Yes at source level: the unchanged head still skips session keys whose agent cannot be parsed and scopes unprefixed deep links to the current selected agent. No live runtime reproduction was supplied. Is this the best way to solve the issue? No. Extracting the Telegram runtime is reasonable, but carrying unrelated compatibility-sensitive changes in the same dirty branch is not the narrowest or safest implementation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 29ac6d6c8c61. Label changesLabel changes:
Label justifications:
Evidence reviewedSecurity concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
377c734 to
13e2ae3
Compare
13e2ae3 to
d0efd89
Compare
|
Land-ready at
|
|
Merged via squash.
|
* refactor(telegram): split bot handler runtime * fix(telegram): keep extracted helper types local * refactor(telegram): bound bot handler modules * fix(telegram): name callback action results * fix(telegram): keep inbound input types local
Closes #106268
What Problem This Solves
The Telegram bot handler runtime concentrated unrelated authorization, callback, inbound message, migration, reaction, and message-event responsibilities in one 4,200-line module. That made ownership and focused maintenance difficult.
Why This Change Was Made
Split the runtime into a 20-line public composer plus 19 responsibility-owned runtime modules. Registration order, factory scope, behavior, configuration, and APIs remain unchanged. Every extracted module stays below 500 lines; the largest is 424 lines.
User Impact
No user-visible behavior change. Maintainers get smaller modules with clearer responsibility boundaries.
Evidence
5def24fc7b05b349f8d08d5543891debc006642f.tbx_01kxe3zrth9srfg7kvp9pk4xen; Actions run.pnpm check:changed: passed formatting, production/test TypeScript, lint, import-cycle, and repository guards.pnpm test:extension telegram: 143 files and 2,727 tests passed.