Skip to content

Add join_corporation as a direct voice agent tool - #302

Open
atomantic wants to merge 1 commit into
pipecat-ai:mainfrom
atomantic:fix/voice-agent-join-corporation
Open

Add join_corporation as a direct voice agent tool#302
atomantic wants to merge 1 commit into
pipecat-ai:mainfrom
atomantic:fix/voice-agent-join-corporation

Conversation

@atomantic

Copy link
Copy Markdown
Contributor

When a pilot asks the voice agent to join a corporation, the agent has no join_corporation tool registered (only create_corporation and leave_corporation are in VOICE_TOOLS). Because the prompt's start_task fallback isn't reliably triggered, the LLM hallucinates a non-existent "corporations panel" and refuses to act.

This is especially visible for pilots who skipped the tutorial: they never pass through the scripted corp onboarding step, there is no corporation-join UI in the client for them to fall back to, and they have no in-game way to discover a list of corporations or join one. They get stuck — the voice agent is the only entry point, and it can't complete the action.

  • Register JOIN_CORPORATION in VOICE_TOOLS alongside create_corporation and leave_corporation
  • Add _handle_join_corporation to VoiceAgent, including corp_namecorp_id resolution via list_corporations (mirrors the task-agent handler so a pilot can say "join Crimson Fleet" without a UUID)
  • Update voice_agent.md to list join_corporation / leave_corporation as direct tools and drop them from the start_task required list
  • Add unit tests covering both the corp_id and corp_name-resolution join paths; update EXPECTED_TOOLS set

Previously only create_corporation and leave_corporation were in
VOICE_TOOLS, so when a pilot (especially one who skipped the tutorial)
asked to join a corporation the voice agent had no matching tool
and would hallucinate a non-existent UI panel instead of calling
start_task to delegate to the task agent.

- Register JOIN_CORPORATION in VOICE_TOOLS alongside create/leave
- Add _handle_join_corporation with corp_name→corp_id resolution
- Update voice_agent.md to list join/leave as direct tools and drop
  them from the start_task required list
- Extend test_voice_agent.py with join_corporation coverage
@jptaylor

Copy link
Copy Markdown
Collaborator

@atomantic thanks for this PR, will review. I have inflight work to address and test joining corporations, primarily around task engines with larger fleets. I will branch from this PR and merge once we're fully confident.

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.

2 participants