Skip to content

fix(compose): forward extra models and idle unload knobs to laya-serve - #1053

Merged
NandhaKishorM merged 2 commits into
NandhaKishorM:mainfrom
NAVEENPRASAATH23:fix/compose-extra-models-passthrough
Oct 10, 2026
Merged

NandhaKishorM merged 2 commits into
NandhaKishorM:mainfrom
NAVEENPRASAATH23:fix/compose-extra-models-passthrough

Conversation

@NAVEENPRASAATH23

@NAVEENPRASAATH23 NAVEENPRASAATH23 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What & Why

  1. Compose Knobs Passthrough (Closes feat(serve): register extra checkpoints from LAYA_EXTRA_MODELS #1047):
    In compose.http.yaml, LAYA_EXTRA_MODELS and LAYA_IDLE_UNLOAD_SECONDS were not forwarded under environment:, causing Docker Compose to silently drop them when configured on the host.
  2. TypeScript Runtime Build & Type Fixes:
    Fixes strict TypeScript compilation and packaging failures introduced in recent upstream commits:
    • Syntax error in laya-ts/src/hooks.ts: unclosed template literal in runWithTimeout error rejection.
    • Type error (TS2339) in laya-ts/src/hooks.ts: missing hook?: Hook on dispatch options interface.
    • Strict type error (TS2532) in laya-ts/src/agent.ts: Object is possibly 'undefined' in predictBatch when calculating this.hooksTimeout * 1000 under strict null checks.

Detailed Code Changes

  • compose.http.yaml:
    • Added ${LAYA_EXTRA_MODELS:-} and ${LAYA_IDLE_UNLOAD_SECONDS:-} host passthroughs to laya-serve.
  • docs/docker.md:
    • Documented both variables with descriptions, types, and defaults in the Server configuration reference table.
  • tests/test_compose_env.py:
    • Added test assertions to ensure both knobs are verified and reach the container without regression.
  • laya-ts/src/hooks.ts:
    • Fixed template literal syntax error in runWithTimeout.
    • Added hook?: Hook to dispatch opts interface.
    • Made runWithTimeout accept unknown and return Promise<void> to safely handle synchronous and asynchronous hook executions.
  • laya-ts/src/agent.ts:
    • Safely computed timeoutMs via typeof hooksTimeout === "number" ? hooksTimeout * 1000 : null to eliminate TS2532 and properly allow per-call opts.hooksTimeout overrides.

Testing & Verification

  • Local Python Test Suites:
    • python -m unittest tests/test_compose_env.py: 263 passed, 0 failed (+26 checks verified)
    • python -m unittest tests/test_env_docs.py: 27 passed, 0 failed
    • python -m unittest tests/test_packaging.py: 138 passed, 0 failed
  • GitHub Actions CI (All 6 Workflows Passing - 100% Green):
    • CI: All 14/14 checks passed (TypeScript node20/22/24, Python 3.10–3.13, Windows, ONNX, Lint, Package).
    • Security (CodeQL): Passed with 0 alerts.
    • Docker: Passed.
    • Java: Passed.
    • .NET: Passed.
    • Docs: Passed.

Comment thread laya-ts/tests/package-e2e.mjs Fixed
Comment thread laya-ts/tests/package-e2e.mjs Fixed
@NAVEENPRASAATH23
NAVEENPRASAATH23 force-pushed the fix/compose-extra-models-passthrough branch from 09da824 to acc23b0 Compare October 8, 2026 19:27
@NAVEENPRASAATH23

Copy link
Copy Markdown
Contributor Author

Hi @NandhaKishorM

This PR is ready for review:

  1. Docker Compose (feat(serve): register extra checkpoints from LAYA_EXTRA_MODELS #1047): Forwards LAYA_EXTRA_MODELS and LAYA_IDLE_UNLOAD_SECONDS to laya-serve, complete with documentation and unit tests.
  2. CI Pipeline & TypeScript Syntax Fix: A recent upstream commit introducing hook timeouts had an unclosed template literal in hooks.ts and a strict null-check error (TS2532) in agent.ts that broke the TypeScript (node20/node22) build and packaging pipeline. Both have been patched.

All CI pipelines across Python, TypeScript, Java, .NET, Docker, and CodeQL are now 100% green. Ready to merge when you get a chance!

@NandhaKishorM
NandhaKishorM merged commit bf31e15 into NandhaKishorM:main Oct 10, 2026
40 checks passed
@NandhaKishorM

Copy link
Copy Markdown
Owner

Merged.

LAYA_EXTRA_MODELS and LAYA_IDLE_UNLOAD_SECONDS were both readable by the runtime and documented, and neither reached the laya-serve service through compose, so an operator following the docs set a variable that went nowhere. Same gap I fixed on the NixOS side when merging #1047: a variable the HTTP process reads but no deployment surface can set is only half shipped.

Pinning the names as literals in tests/test_compose_env.py, rather than deriving them, is right for this check and your comment says why: a derived list would pass if compose.http.yaml stopped carrying them, which is exactly the regression.

One thing travelled with this PR that is not in its title, and it is the most important change in this batch. Commit acc23b0c, "fix(ts): resolve TypeScript compilation errors in hooks timeout runner", is in here. It fixes an unterminated template literal in laya-ts/src/hooks.ts that was breaking 22 of the 34 TypeScript test files on main, introduced by #1032 in the last release. I merged that breakage and my Python-only gate did not catch it, so I am glad it rode along, but it should have been its own PR: a compose change carrying a TypeScript parser fix is not something a reviewer looks for.

Worth checking your branch point. This looks like it was cut from a fix branch rather than from main, which is how an unrelated commit ends up in a compose PR. Branching from main keeps a PR's diff to its own subject.

Merged with #1054, which extends the same env-var tuple; both sets are kept. tests/test_compose_env.py is 284 of 284 on the merged tree.

NandhaKishorM added a commit that referenced this pull request Oct 10, 2026
14 pull requests from 8 contributors.

* the TypeScript tree parses again: an unterminated template literal shipped in
  0.4.1 and stopped 22 of 34 test files loading (#1056)
* x_jev_confidence on /v1/systemone, computed locally (#1066, #302)
* a narrowed shortlist drops option_order with a warning instead of failing (#1063)
* registering a name one edit from a built-in warns (#1055, #919)
* compose forwards four knobs the runtime already read (#1053, #1054)
* Java Router.predictBatch and Shortlist.predictTournament (#1060, #1061)
* teacher-agreement evals, with the self-agreement ceiling (#1071, #919)

Security: no malicious content found; the audit is recorded locally.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

3 participants