When your agent calls Jules, it doesn't know which repo or branch you're on — so Jules starts a blank session with no code context.
The fix: before creating a session, auto-read the current git repo and branch from your workspace and pass it to Jules automatically. 🎯
Bug / Feature: Auto-Detect owner/repo and branch in Jules MCP Session Creation
Problem
When the Jules MCP tool creates a new session, it initializes without any repository context — resulting in a repoless session — even when the agent is actively operating inside a Git repository.
Root Cause
The session creation tool likely accepts owner, repo, and branch as optional or manually-provided params. The agent doesn't attempt to resolve them from the environment before calling the tool, so it falls through to a context-less session.
Expected Behavior
Before creating a session, the MCP tool (or the agent invoking it) should:
- Detect current repo — resolve
owner/repo from the Git remote URL (e.g., git remote get-url origin)
- Detect current branch — resolve from
git branch --show-current or HEAD
- Auto-inject these into the session creation payload
- Fallback gracefully — if not in a Git repo or remote isn't GitHub, surface a clear error instead of silently creating a repoless session
Fix Surface
Either:
- The MCP server-side
create_session tool resolves repo context itself (if it has shell/env access), or
- The tool description/schema explicitly instructs the calling agent to resolve and pass
owner, repo, branch before invoking — so the LLM agent does the resolution step first