Skip to content

fix(agents): make Team Mode work correctly with proper prompt and session handling#408

Merged
bobleer merged 3 commits intoGCWing:mainfrom
bobleer:fix/team-mode-prompt-and-session-fixes
Apr 14, 2026
Merged

fix(agents): make Team Mode work correctly with proper prompt and session handling#408
bobleer merged 3 commits intoGCWing:mainfrom
bobleer:fix/team-mode-prompt-and-session-fixes

Conversation

@bobleer
Copy link
Copy Markdown
Collaborator

@bobleer bobleer commented Apr 14, 2026

Summary

Fixes Team Mode behaving identically to the default agentic mode. Five root causes identified and fixed:

  • team_mode.md missing critical placeholders: The prompt used invalid {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 info
  • ChatInput stale session.mode override: effectiveTargetSession?.mode || modeState.current caused the session's original mode (often "agentic") to override the user's UI selection. Changed to use modeState.current as the authoritative source
  • useFlowChat.ts hardcoded agentType: Session creation always passed 'agentic' regardless of the requested mode. Fixed to pass through config.agentType
  • MessageModule.ts no mode sync: When the caller provided a different agentType, session.mode was not updated, causing subsequent turns to lose the mode
  • FlowChatStore whitelist: VALID_AGENT_TYPES was missing 'Team' and 'DeepResearch', causing restored historical sessions to fall back to 'agentic'

Test plan

  • cargo check -p bitfun-core passes
  • All unit tests pass (77 agentic tests)
  • No linter errors
  • Select Team mode in UI, send a message — agent should reference sprint workflow and suggest gstack skills
  • Restore a historical Team session — mode should remain Team (not fall back to agentic)
  • Switch between Team and agentic modes mid-conversation — correct prompts should load

bowen628 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.
@bobleer bobleer merged commit d01db3e into GCWing:main Apr 14, 2026
4 checks passed
@bobleer bobleer deleted the fix/team-mode-prompt-and-session-fixes branch April 15, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant