Skip to content

Copilot App: create_pull_request fails with "runtime settings are not configured for this session" but the PR is created #5028

Open

Description

@achamayou

Describe the bug

In the GitHub Copilot app, the create_pull_request session tool returns an error for a session running on a remote WSL host, even though the pull request is created successfully:

Failed to create pull request: runtime settings are not configured for this session

After the error:

  • The PR exists on GitHub, created at the time of the call, with exactly the title and body passed to the tool.
  • The app has linked the PR to the session: get_session reports created_pr_number and created_pr_state: open, and the session has been renamed to the PR title.

So creating and linking the PR both succeed, and the error comes from some later step. This happens consistently in this setup: the user sees it on essentially every PR opened through the tool.

Impact: the agent treats the call as failed. It either stops to ask the user, or falls back to gh pr create, which then fails with a pull request for branch "<branch>" into branch "main" already exists. Every PR creation costs extra turns and an interruption, and the misleading error invites repeated attempts.

Affected version

GitHub Copilot app 1.1.25 (Windows); GitHub Copilot CLI 1.0.85 (the SDK-bundled CLI started by copilotd on the remote host); copilotd 0.9.0.

Steps to reproduce the behavior

  1. In the GitHub Copilot app on Windows, use a remote host backed by a WSL2 distro (copilotd running in the distro).
  2. Create a worktree session for a GitHub repository on that host.
  3. Commit a change and push the session branch.
  4. Ask the agent to open a pull request; it calls create_pull_request with a title and body.
  5. The tool returns Failed to create pull request: runtime settings are not configured for this session.
  6. On GitHub, the PR exists with the given title and body, and the app shows it linked to the session.

Expected behavior

When the PR is created, create_pull_request reports success with the PR number and URL. If a non-essential step after creation fails, the result should say that the PR was created (partial success, including the PR URL) instead of reporting that creation failed.

Additional context

  • OS: Windows desktop app; remote host is a WSL2 distro (Azure Linux 4.0, kernel 6.6.87.2-microsoft-standard-WSL2), x86_64.
  • Session: worktree session, executing on the remote (WSL) host.
  • The error string does not appear in the copilotd 0.9.0 binary on the remote host, so it appears to come from the desktop app.
  • Hypothesis (unverified): a step after PR creation reads per-session runtime settings that are not configured for remote-host sessions, and the tool reports that as a failure to create the PR.
  • Not checked: whether this also happens for local (non-remote) sessions.
  • No existing issue found for this error message.

Activity

  1. added
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    and removed on Oct 2, 2026
  2. johnnyhaggs commented on Oct 6, 2026

    @johnnyhaggs

    I'm seeing the same issue on Copilot app 1.1.26 (Windows, commit 5ab79c8) with copilotd 0.9.2 on a WSL2 remote host. I compared the app logs with the remote session's events.jsonl. The results point to a cause other than the hypothesis in the issue body.

    Findings

    1. It fails for every remote-host session and none of the local sessions.

    Session location create_pull_request calls Result
    WSL remote host (copilotd) 7 calls across 6 sessions (2026-09-24 → 2026-10-06) 7 of 7 returned runtime settings are not configured for this session, and each PR was created
    Local (Windows) sessions 63 calls since 2026-08-19 No calls returned this error; the only failures had real causes (422 / unlinked account)

    2. The desktop app creates the PR and records success. The remote agent receives a different, failed result for the same tool call ID.

    Desktop app log (github-app.65308.log) for one call:

    19:11:37.846 remote event pump: tool lifecycle dispatch event_type=tool.user_requested tool_call_id=toolu_01L8gx… tool_name=create_pull_request delivered=true
    19:11:38.718 tools::create_pull_request: issuing GitHub pull request create request … head_ref=copilot/… base_branch=main
    19:11:41.485 tools::create_pull_request: GitHub pull request create request succeeded … pull_request_number=3
    19:11:41.501 remote event pump: translated action action_type="chat/toolCallComplete" tool_call_id=toolu_01L8gx… success=true content=[text:1]
    

    Remote host ~/.copilot/session-state/40b6bb55-…/events.jsonl for the same call:

    {"type":"tool.execution_complete","data":{"toolCallId":"toolu_01L8gx…","success":false,
     "error":{"message":"Failed to create pull request: runtime settings are not configured for this session","code":"failure"}}}

    The remote CLI's start timestamp (19:11:37.845Z) matches the app's tool.user_requested timestamp to the millisecond. Two handlers appear to run for one call:

    • The desktop app's handler, which succeeds and creates the PR.
    • A handler on the remote host, which fails right away because the remote host has no runtime settings for the session. Its result is the one the model receives.

    So the error doesn't come from a step after PR creation. The app's success result never reaches the remote session, or a remote handler's failure replaces it.

    3. This causes duplicate calls. In the same session, the agent retried create_pull_request about 1 second later (toolu_01EjHy…). The app showed success=true for that retry but made no GitHub request (no issuing GitHub pull request create request line). The remote agent again received the "runtime settings" failure.

    Suggested fix

    For remote-host sessions, route the app's create_pull_request result back to the remote session. Alternatively, don't register or run a remote-side create_pull_request handler when the desktop app owns that tool.

    I can share redacted log excerpts if needed.

  3. kranthikirang commented on Oct 7, 2026

    @kranthikirang

    I am seeing the same problem from MS copilot studio (github copilot harness) from last 4 days. It used to work fine. Now I wonder whether this is a problem in github-copilot vs github-mcp-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions