[BUG REPORT] Library save returns "Internal error" on /* */ doc-header block (FW 2.4.4.156 + 2.5.0.126)

Hi all -- reporting a Libraries Code save bug isolated yesterday. Reproduces deterministically on both 2.4.4.156 and 2.5.0.126 (FW upgrade did not fix). Filing because end users hitting this through HPM see only a generic "Internal error" toast with no further detail, and there's no log trace -- took ~30 in-browser bisection variants to find.

Symptom

Saving a library source via Settings -> Developer Tools -> Libraries Code -> Add library returns:

  POST /library/saveOrUpdateJson
  -> 200 {"success":false,"message":"Internal error"}

UI shows "Internal error" toast. Hub Logs (/logs) do NOT surface any underlying compile exception -- checked at ERROR level and across hub-admin source filter, nothing appears for the save timestamp.

Minimal reproducer (syntax-only flip)

Same content, two comment forms. One saves, the other fails.

Fails -- success:false, message:"Internal error":

 /*
   * Library overview -- shared helpers
   *
   * Exports:
   *   foo()  -- one thing
   *   bar()  -- another thing
   *   baz()  -- yet another
   *
   * Notes: some longer prose explaining design choices,
   * with multiple paragraphs and method-call shapes like
   * doSomething(String arg, Map opts) -- the ring-buffer
   * pattern used in this library.
   */

  library(
      name: "MyLib",
      namespace: "myns",
      author: "Me",
      description: "test"
  )

  void foo() { log.info "hi" }

Saves cleanly -- same content as // line comments:

 // Library overview -- shared helpers
  //
  // Exports:
  //   foo()  -- one thing
  //   bar()  -- another thing
  //   baz()  -- yet another
  //
  // Notes: some longer prose explaining design choices,
  // with multiple paragraphs and method-call shapes like
  // doSomething(String arg, Map opts) -- the ring-buffer
  // pattern used in this library.

  library(
      name: "MyLib",
      namespace: "myns",
      author: "Me",
      description: "test"
  )

  void foo() { log.info "hi" }

Trigger is the file-scope /* / block AFTER the optional MIT/copyright header and BEFORE the library(...) declaration. javadoc / */ blocks inside method bodies are unaffected. Driver files (using definition() instead of library()) are unaffected.

Bisection findings

~30 variants tested via CodeMirror.setValue + Save + response capture:

  • library() block alone, all 6 metadata fields -> saves
  • Each method body individually + library() -> saves
  • MIT-license /* / block + library() -> saves (one / */ is fine)
  • Doc /* */ block (~19 lines, ~1.2 KB) + library() -> FAILS
  • Either half of doc block + library() -> saves
  • Full doc block + library() -> FAILS
  • Doc block converted to // line comments + library() -> saves
  • Em-dashes -> -- -> still FAILS (Unicode ruled out)

Not a size threshold -- the 1.2 KB doc block fails while a 7 KB single method body passes. Correlation is with the file-scope multi-line /* */ form at this content shape.

Environment

  • FW versions confirmed: 2.4.4.156, 2.5.0.126
  • Hub model: C-8 Pro

cc @bravenel @mike.maxwell -- happy to provide additional reproducers or run targeted tests if useful.