feat(telegram-manager): Chat + Schemas tabs with nodes view; fix Chat panel showing 0 messages - #11
Draft
Secret297-CODER-SOURCE with Copilot wants to merge 14 commits into
Draft
feat(telegram-manager): Chat + Schemas tabs with nodes view; fix Chat panel showing 0 messages#11Secret297-CODER-SOURCE with Copilot wants to merge 14 commits into
Secret297-CODER-SOURCE with Copilot wants to merge 14 commits into
Conversation
Introduce scoped WorkspaceTools for Telegram agents (createWorkspaceTools) with explicit readable/writable file lists and Anthropic tool definitions. Add an Anthropic tool-calling loop (runAnthropicWithTools) to AiReplyEngine and accept an optional workspaceTools parameter in aiReply; when ANTHROPIC_API_KEY is present, use the tool-calling path (up to 5 iterations) and otherwise fall back to the existing adapter. Update BotAgent and UserBotAgent to create and pass per-agent workspace tools into aiReply so agents can safely read/write their own workspace files. Also adjust the UI file loader to always reload Telegram agent file contents to avoid showing stale/shared cache entries.
Remove the TG_ID pattern from PII_PATTERNS to avoid treating short numeric Telegram IDs as PII. Improve Telegram agent files loading UX: set agentFilesLoading=true when initiating file load to prevent a flash of the "click to load" callout, auto-load files when returning to an already-active Files panel, and import loadTelegramAgentFiles where needed. Update the Files panel UI to show a "Loading files…" state and replace the static callout with a clickable callout button that invokes the provided onLoadFiles handler.
Import loadTelegramAgentFileContent and, when returning to the Telegram Files panel, clear the shared agentFileContents cache and reload the agent's file list. If an active file is selected, also fetch its content so the Files panel doesn't show stale data left over from the main Agents tab. Adds a clarifying comment about the shared cache behavior.
… agent management
…dex.ts - UserBotAgent: add `EntityLike` type import from telegram/define and cast the BigInt peer to silence TS2345; gramjs handles native bigint at runtime - Delete extensions/telegram-manager/src/index.ts — orphaned dead-code file that was never imported, had broken module paths, and contained the Cyrillic identifier character that caused the historical ReferenceError at load time Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Secret297-CODER-SOURCE <73541046+Secret297-CODER-SOURCE@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add dialog structure tab to Telegram managers
feat(telegram-manager): add Communication Structure tab to agent detail panel
Mar 13, 2026
…w behavior status in UI Co-authored-by: Secret297-CODER-SOURCE <73541046+Secret297-CODER-SOURCE@users.noreply.github.com>
Copilot
AI
changed the title
feat(telegram-manager): add Communication Structure tab to agent detail panel
feat(telegram-manager): Communication Structure tab + auto-wire CommunicationBehavior on missions
Mar 13, 2026
…rview panel Co-authored-by: Secret297-CODER-SOURCE <73541046+Secret297-CODER-SOURCE@users.noreply.github.com>
Copilot
AI
changed the title
feat(telegram-manager): Communication Structure tab + auto-wire CommunicationBehavior on missions
feat(telegram-manager): Communication Structure — auto-wire CommunicationBehavior + UI discoverability
Mar 13, 2026
Co-authored-by: Secret297-CODER-SOURCE <73541046+Secret297-CODER-SOURCE@users.noreply.github.com>
Copilot
AI
changed the title
feat(telegram-manager): Communication Structure — auto-wire CommunicationBehavior + UI discoverability
feat(telegram-manager): Chat + Schemas tabs with nodes/graph view
Mar 13, 2026
… state (loadTelegramAllMissionMessages) Co-authored-by: Secret297-CODER-SOURCE <73541046+Secret297-CODER-SOURCE@users.noreply.github.com>
Copilot
AI
changed the title
feat(telegram-manager): Chat + Schemas tabs with nodes/graph view
feat(telegram-manager): Chat + Schemas tabs with nodes view; fix Chat panel showing 0 messages
Mar 13, 2026
Secret297-CODER-SOURCE
force-pushed
the
main
branch
from
April 11, 2026 11:11
7985cb9 to
c652340
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Chat and Schemas tabs to each Telegram agent detail panel, and fixes a data bug that caused the Chat panel to always show zero messages.
Summary
loadTelegramMissionMessagesreplacesstate.telegramMissionMessageson every call — looping over N missions left only the last mission's messages (race-to-last-write).telegramChatMessagesaccumulator state +loadTelegramAllMissionMessages(parallelPromise.allfetch) replacing the broken serial-overwrite loop;TelegramPropsextended withchatMessages/onChatRefresh.telegramMissionMessages(used by Communication panel single-mission view) is untouched; no backend/gateway server code changed; no WebSocket protocol changes.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
New tabs (order: Overview | Auth? | Chat | Schemas | Communication | Behaviors | Tasks | Events | Cron | Files):
Chat tab — two toggle modes:
💬 Chat— chronological message bubbles across all missions; outgoing right-aligned (accent border), incoming left-aligned; each bubble shows sender→receiver, mission name, timestamp◎ Nodes— per-mission cards showing master agent → participants as a visual graph with status badgesSchemas tab — communication structure blueprint per mission: title/status, agent hierarchy tree (master → participants with role/type labels), goal text, optional system prompt
Bug fix: Chat panel now correctly shows messages from all missions (was always empty due to state overwrite).
Security Impact (required)
NoNoNo— reuses existingtelegram.mission.messagesWS method, now called in parallel per missionNoNoRepro + Verification
Environment
telegram-managerextensionSteps
◎ Nodes→ mission graph rendersExpected
Actual (before fix)
Evidence
Human Verification (required)
TelegramPanelunion,TelegramProps,AppViewState,app.ts, controller type all consistent;Promise.allpattern accumulates messages correctly; agent switch resetstelegramChatMessages;telegramMissionsError = nullcleared before early-return guardonChatRefreshreloads both missions and messagesCompatibility / Migration
YesNoNoFailure Recovery (if this breaks)
telegram.ts,app-render.ts,app-view-state.ts,app.ts,controllers/telegram.tsmissionsErrorcallout); Schemas empty (same); nodes view shows no cards if missions haven't loaded yet (Refresh resolves it)Risks and Mitigations
Promise.allover many missions could generate N parallel WS requests on Chat tab open✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.