Skip to content

al_publish LM tool hangs after successful full dependency tree publish when debug: false #8280

Description

@jwikman

1. Describe the bug

When calling the al_publish LM tool with fulldependencytree: true and debug: false, the tool never returns after a successful publish. All projects are published successfully and "Done publishing the full dependency tree." is logged to the AL output channel, but the tool call hangs indefinitely.

2. To Reproduce

Steps to reproduce the behavior:

  1. Open a workspace with a multi-project AL solution.
  2. Invoke the al_publish LM tool via a GitHub Copilot agent with:
    • debug: false
    • fulldependencytree: true
    • Eg. write this in the copilot chat: call #al_publish with debug: false, fulldependencytree: true
  3. Observe the AL output channel — all projects publish successfully.
  4. Observe the agent — it hangs indefinitely after the last log line.

No AL code snippet required — the issue is in the tool's command dispatch logic, not in AL source code.

3. Expected behavior

After all projects are published and "Done publishing the full dependency tree." is logged, the al_publish tool should return a result to the calling agent without starting a debug session, consistent with the behavior of debug: false in all other publish paths.

4. Actual behavior

The tool never returns. The AL output log ends with:

[2026-06-22 11:49:19.03] Success: The package 'Me_MyApp_27.9.0.0.app' has been published to the server.
[2026-06-22 11:49:19.03] Done publishing project 2 of 2: MyApp
[2026-06-22 11:49:19.03] Done publishing the full dependency tree.

No further output is produced and the agent never proceeds.

Root cause analysis

In executeCore (the LM tool), the debug parameter is respected for all publish paths except fulldependencytree: true:

// Incremental and standard paths: debug flag respected ✅
r === a.Incremental
  ? (c = t ? "al.incrementalPublish" : "al.incrementalPublishNoDebug")
  : (c = t ? "al.publish" : "al.publishNoDebug")

// Full dependency path: debug flag silently ignored ❌
u ? (c = "al.fullDependencyPublish")

al.fullDependencyPublish unconditionally calls initalizeDebugAdapterService.getDebugAdapterConfiguration() and passes it to the language server request (al/fullDependencyPublish). The language server publishes all projects but its LSP response is gated on a subsequent debug session start — which never completes when debug: false was requested. The yield serverProxy.sendRequest(...) awaits forever.

There is no al.fullDependencyPublishNoDebug counterpart, which is the missing piece.

Suggested fix

Add an al.fullDependencyPublishNoDebug command (mirroring the existing al.publishNoDebug) and dispatch to it when fulldependencytree: true and debug: false.

5. Versions:

  • AL Language: 17.0.2273547 and 18.0.2498801
  • Visual Studio Code: 1.125.1
  • Business Central: 28.1.49838.51179
  • List of Visual Studio Code extensions that you have installed: N/A
  • Operating System:
    • Windows
    • Linux
    • MacOS

Final Checklist

  • Search the issue repository to ensure you are reporting a new issue
  • Reproduce the issue after disabling all extensions except the AL Language extension
  • Simplify your code around the issue to better isolate the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedal-toolsMicrosoft.Dynamics.BusinessCentral.Development.Tools or related packagesbugProduct bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions