fix(agents): make Team Mode work correctly with proper prompt and session handling#408
Merged
bobleer merged 3 commits intoGCWing:mainfrom Apr 14, 2026
Merged
Conversation
added 3 commits
April 14, 2026 13:26
…sion handling
The Team Mode agent was behaving identically to the default agentic mode
due to several issues across the prompt and frontend layers:
1. team_mode.md used invalid placeholders ({CUSTOM_RULES},
{RECENTLY_VIEWED_FILES}) that PromptBuilder does not process, and was
missing critical placeholders ({ENV_INFO}, {PROJECT_LAYOUT}, {RULES},
{MEMORIES}, {PROJECT_CONTEXT_FILES}) — so the agent had no project
context, no user rules, and no environment info.
2. ChatInput passed `effectiveTargetSession?.mode || modeState.current`
as the agent type, which caused a stale session.mode (often "agentic")
to override the user's UI selection. Fixed to use modeState.current
directly as the authoritative source.
3. useFlowChat.ts hardcoded agentType to 'agentic' when creating
sessions, ignoring config.agentType. Fixed to pass through the
requested mode.
4. MessageModule.ts did not sync session.mode when the caller provided
a different agentType, causing subsequent turns to lose the mode.
Added ONE_SHOT_AGENT_TYPES_FOR_SESSION guard and mode sync logic.
5. FlowChatStore VALID_AGENT_TYPES whitelist was missing 'Team' and
'DeepResearch', causing restored historical sessions to fall back
to 'agentic'.
Move the submit button and status indicator below the questions list so users naturally answer all questions before reaching the submit action.
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.
Summary
Fixes Team Mode behaving identically to the default agentic mode. Five root causes identified and fixed:
{CUSTOM_RULES}and{RECENTLY_VIEWED_FILES}(not supported by PromptBuilder), and was missing{ENV_INFO},{PROJECT_LAYOUT},{RULES},{MEMORIES},{PROJECT_CONTEXT_FILES}— so the Team agent had no project context, user rules, or environment infoeffectiveTargetSession?.mode || modeState.currentcaused the session's original mode (often "agentic") to override the user's UI selection. Changed to usemodeState.currentas the authoritative source'agentic'regardless of the requested mode. Fixed to pass throughconfig.agentTypeVALID_AGENT_TYPESwas missing'Team'and'DeepResearch', causing restored historical sessions to fall back to'agentic'Test plan
cargo check -p bitfun-corepasses