Repository navigation
Conversation
A deployment can name one toolbox tool to run when a room is set up and before its first message. The result is stored as a hidden note and acknowledgement, so the model starts with it in context and the UI does not show it. - Agent harness: AGENT_DEFAULT_TOOLS_PRE_CHAT_TOOL (plus optional _ARGS and _MAX_CHARS), looked up in the AGENT_DEFAULT_TOOLS_MCP_ID toolbox and skipped when the agent turns that tool off. - Playground: playground.preChatTool in the active theme map, applied by AskPlayground and returned to the client as preChatMessages. - Both run through PreChatContext: access-checked MCP execution, skipped for missing, disabled or ask tools, truncated, and never failing the chat. - Room auto-naming skips platform-generated messages.
When playground.preChatTool has no toolboxId, look for the tool in the theme's playground.defaultTools (the toolboxes the UI attaches to every new room), in order, and run it from the first toolbox that has it.
…rewrite The pre-chat note now goes in front of the first user message instead of a stored hidden pair, so room naming no longer needs to skip platform-generated messages, and PreChatContext no longer uses IModelEngine or AbstractMessage.
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
The pre-chat docs and PreChatContext Javadoc still described the earlier stored hidden pair, preChatTool ornament and preChatMessages field. Describe the current behaviour: the note goes in front of the first user message's text, the UI shows uiText, and nothing else is added to room history.
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.
Description
Lets a deployment name one toolbox tool to run once, when a room is set up and before its first message. The tool's result is put in front of the first user message as model-only text: the model reads it, and the UI shows only what the user typed (
uiText). A typical choice is ECU'sGetRoomResources, so the model starts with the room's documents, skills and toolboxes in context instead of spending its first step calling the tool.It works in both the agent harness and Playground chat, each configured where that surface already gets its default tools.
Changes Made
PreChatContext(new): shared by both paths.MCPUtility.executeTool, so the user's access to the toolbox is checked andSMSS_FUNCTION_NAMEapplies.disabledorask, and skips if the insight is bound to a different room.maxChars(default 60,000) and wraps it in<pre_chat_context tool="…">, with a note telling the model it doesn't need to call the tool again.SemossAgentHarness,PlatformAgentTools): new propertiesAGENT_DEFAULT_TOOLS_PRE_CHAT_TOOL, plus optional…_ARGSand…_MAX_CHARS. They only apply whenAGENT_DEFAULT_TOOLS_MCP_ID/…_MCP_PROJECT_IDreplaces the default tools, and the tool is looked up in that toolbox. Skipped when the agent turns default tools off, when it lists the tool intool_policy.default_tools.disabled, for PPTX workflow runs, and when the room already has messages.PlaygroundThemeUtils,AskRoomReactor,AskPlaygroundReactor): new theme map keyplayground.preChatTool: {tool, toolboxId?, args?, maxChars?}. WithouttoolboxId, the tool is looked up inplayground.defaultTools.AskRoomReactorhas a new override method,getPreChatTool(); plainAskRoomreturnsnull, so its behaviour is unchanged. Skipped for prebuilt turns (responseParts).docs/agents/mcp_tools.md.PreChatContextUnitTestsandPlaygroundThemeUtilsUnitTests.