Skip to content

chore: remove dead code across Go and TypeScript - #245

Merged
Gajesh2007 merged 2 commits into
Layr-Labs:masterfrom
hankbobtheresearchoor:fix/dead-code-cleanup
May 29, 2026
Merged

Gajesh2007 merged 2 commits into
Layr-Labs:masterfrom
hankbobtheresearchoor:fix/dead-code-cleanup

Conversation

@hankbobtheresearchoor

@hankbobtheresearchoor hankbobtheresearchoor commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes dead code found by jscpd + ts-prune + staticcheck scan.

Changes

  • console-ui/src/components/brand/Logo.tsx — deleted (zero imports anywhere)
  • console-ui/src/lib/google-analytics.ts — removed dead export getGoogleAnalyticsConsentStorageKey()
  • console-ui/src/lib/telemetry-types.ts — removed dead export TelemetryBatch interface
  • e2e/integration_test.go — removed duplicate/unused profile package imports (both aliases never referenced)
  • coordinator/api/fullstack_integration_test.go — fixed unused body variable (SA4006)

Detection tools

  • jscpd (copy-paste detector) — initial scan surfaced duplication hotspots
  • ts-prune — found 3 dead TypeScript exports
  • staticcheck — found the unused body var + duplicate import

Validation

  • go test -race ./api/... -count=1 -timeout 300s — PASS
  • gofmt -l . — clean
  • npm run build (console-ui) — PASS

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

- Delete unused Logo.tsx component (zero imports)
- Remove dead export getGoogleAnalyticsConsentStorageKey()
- Remove dead export TelemetryBatch interface
- Remove duplicate/unused profile package imports in e2e/integration_test.go
- Fix unused body variable in coordinator/api/fullstack_integration_test.go

Found via: jscpd + ts-prune + staticcheck
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

@hankbobtheresearchoor is attempting to deploy a commit to the EigenLabs Team on Vercel.

A member of the Team first needs to authorize it.

@hankbobtheresearchoor

Copy link
Copy Markdown
Contributor Author

I'll take a look at this.

@Gajesh2007
Gajesh2007 merged commit eef768f into Layr-Labs:master May 29, 2026
Gajesh2007 added a commit that referenced this pull request May 30, 2026
…int)

#245 removed both `testbed/profile` imports from e2e/integration_test.go
as "duplicate/unused", but they were in use: `tbprofile.NewProfiler`
(x3) and `profile.NewProfiler` (x1). The e2e package then failed to
typecheck, which golangci-lint reports as a hard error (its v2 config
ignores the v1-style `run.skip-dirs: [e2e]`, so e2e is still linted).

Restore a single aliased import and switch the lone `profile.` call site
to `tbprofile.` so all four uses are consistent — this keeps #245's
de-duplication intent while fixing the build.

Verified with golangci-lint v2.1.6 (the CI version): 0 issues; gofmt clean.
Gajesh2007 added a commit that referenced this pull request May 30, 2026
…ole messages; stop masking decode errors (#253)

* fix(provider): accept hosted/custom tools, content-less & developer-role messages; stop masking decode errors (#252)

The inbound chat-request decoder rejected several valid OpenAI-shaped
requests with HTTP 400 and surfaced a misleading error. A two-stage
decoder discarded the primary parser's real error in its `catch` and
re-threw the stricter legacy `ChatCompletionRequest` decoder's complaint
instead (the `tools[0].function` red herring). When the legacy path did
succeed, the lift mapped only role+text and silently dropped `tools`.

Affected (all → 400 before): OpenAI hosted/builtin tools without a
`function`/`name` (web_search, file_search, code_interpreter, ...),
`{"type":"custom",...}` tools, messages that omit the `content` key
(e.g. an assistant turn carrying only `tool_calls`), and the `developer`
role.

Fix: make the inbound path tolerant and un-mask the error.
- decodeOpenAIRequest now strict-decodes on the fast path (unchanged for
  well-formed requests) and, on failure, normalises the known
  valid-but-rejected shapes and retries. The genuine strict-decoder
  error is surfaced when normalisation can't repair the body; the lossy
  legacy fallback is retired.
- InboundChatNormalization (new, pure/testable): aliases developer->system
  and function->tool, injects an explicit null for a missing `content`
  key, and drops tool shapes that can't be represented as the upstream
  OpenAITool. The provider is pass-through and never invokes tools
  server-side, so unrepresentable hosted/custom tools are accepted-and-
  ignored rather than 400-ing the request; function tools are preserved.
  Unknown roles throw a clear invalidRole (400) naming the role.

The internal ChatCompletionRequest type is unchanged (it remains the
engine's internal representation); only the inbound byte-decode path is
affected.

Adds InboundDecodeTests covering web_search, custom, mixed tools,
content-less assistant tool_calls, developer/function/unknown roles,
explicit content:null, the masking-regression guard, and the unchanged
fast path. swift build clean; new + related decode/translation/error
tests green.

* fix(e2e): restore profile import dropped by #245 (fixes Coordinator Lint)

#245 removed both `testbed/profile` imports from e2e/integration_test.go
as "duplicate/unused", but they were in use: `tbprofile.NewProfiler`
(x3) and `profile.NewProfiler` (x1). The e2e package then failed to
typecheck, which golangci-lint reports as a hard error (its v2 config
ignores the v1-style `run.skip-dirs: [e2e]`, so e2e is still linted).

Restore a single aliased import and switch the lone `profile.` call site
to `tbprofile.` so all four uses are consistent — this keeps #245's
de-duplication intent while fixing the build.

Verified with golangci-lint v2.1.6 (the CI version): 0 issues; gofmt clean.

* fix(provider): preserve scalar `stop` string in inbound decode (#252)

Codex review on #253 caught a regression from retiring the legacy
fallback. OpenAI allows `stop` as a scalar string, but the strict
`OpenAIChatCompletionRequest` decoder only accepts `[String]`. The old
legacy lift converted a string via `StopSequences.asArray`; the new
normalizer only touched messages/tools, so `"stop":"</s>"` started
returning 400.

Wrap a lone `stop` string into a one-element array during cold-path
normalization. Adds tests for scalar stop, array stop (fast path), and
scalar stop composed with another cold-path repair.
jonathan308 added a commit that referenced this pull request Oct 1, 2026
mlx-swift-lm main now contains #206, #207 and #219 (landed through #246) and
#245. Pin it instead of the stacked SDK branch commit. The pinned tree is
identical to the SDK validated with this stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Oct 1, 2026
mlx-swift-lm main now contains #206, #207 and #219 (landed through #246) and
#245. Pin it instead of the stacked SDK branch commit. The pinned tree is
identical to the SDK validated with this stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Oct 1, 2026
mlx-swift-lm main now contains #206, #207 and #219 (landed through #246) and
#245. Pin it instead of the stacked SDK branch commit. The pinned tree is
identical to the SDK validated with this stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gajesh2007 pushed a commit that referenced this pull request Oct 1, 2026
… MTP (#1282)

* perf(mimo): default-on decode kernels and target-only adaptive serial MTP

Pin mlx-swift-lm to the stack that enables the exact MiMo short-forward
decode kernels by default and adds `CBv2MTPConfig.allowsAdaptiveSerialRounds`.

- Forward the three kernel rollbacks (`DARKBLOOM_MIMO_FUSED_DECODE_NORMS`,
  `DARKBLOOM_MIMO_DECODE_EXPERTS`, `DARKBLOOM_MIMO_DECODE_ROUTER_GEMV`,
  `0`/`false`/`no`/`off`) to the launchd provider job, so an installed
  provider can restore the stock path.
- Build every native MiMo MTP config through `nativeMiMoMTPConfig`, which
  keeps adaptive plans target-only under serial-target scoring. Each serial
  draft column costs one ordinary target forward, so those rounds could only
  slow decode (25-27 tok/s when the controller locked onto depth 3). MTP stays
  constructed and active with live assistant history; the rectangular opt-in
  keeps adaptive depth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(mimo): pin mlx-swift-lm main 1ee8675a

mlx-swift-lm main now contains #206, #207 and #219 (landed through #246) and
#245. Pin it instead of the stacked SDK branch commit. The pinned tree is
identical to the SDK validated with this stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Gajesh2007 pushed a commit that referenced this pull request Oct 1, 2026
…for reuse (#1299)

* fix(mimo): reuse SSD prefix-cache hits and report cached tokens only for reuse

Every native MiMo V2.6 SSD prefix-cache hit was discarded. The bridge stages
a checkpoint under a placeholder engine request ID and mints the real ID just
before submit; the SDK's native import check compared engine IDs, so each
staged checkpoint was refused (`unsupportedConsumer`). The request prefilled
its whole prompt again and the coordinator received a skipped lookup.

- Pin mlx-swift-lm to the receipt-bound native stage check.
- EngineV2RequestUsageSignal: client-facing cached tokens (standalone usage
  and the provider SSE splice) now count only an actual hit. A matched
  checkpoint whose adoption failed or was skipped used to report its matched
  tokens, which hid this bug locally. Coordinator usage already came from the
  resolved lookup and is unchanged.

Tests: the native MiMo complete-prefix gate gains a bridge-level repeat
(`testNativeCompletePrefixONReusesThePublishedBoundaryThroughTheBridge`): the
second submission of the same prompt must adopt the published boundary with
a resolved hit, saved prefill and byte-identical text. The existing gates
only checked that the first submission published. PrefixCacheReceiptTests
pins the cached-token report for a failed adoption.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(mimo): pin mlx-swift-lm main 1ee8675a

mlx-swift-lm main now contains #206, #207 and #219 (landed through #246) and
#245. Pin it instead of the stacked SDK branch commit. The pinned tree is
identical to the SDK validated with this stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Gajesh2007 pushed a commit that referenced this pull request Oct 1, 2026
* perf(mimo): default-on decode kernels and target-only adaptive serial MTP

Pin mlx-swift-lm to the stack that enables the exact MiMo short-forward
decode kernels by default and adds `CBv2MTPConfig.allowsAdaptiveSerialRounds`.

- Forward the three kernel rollbacks (`DARKBLOOM_MIMO_FUSED_DECODE_NORMS`,
  `DARKBLOOM_MIMO_DECODE_EXPERTS`, `DARKBLOOM_MIMO_DECODE_ROUTER_GEMV`,
  `0`/`false`/`no`/`off`) to the launchd provider job, so an installed
  provider can restore the stock path.
- Build every native MiMo MTP config through `nativeMiMoMTPConfig`, which
  keeps adaptive plans target-only under serial-target scoring. Each serial
  draft column costs one ordinary target forward, so those rounds could only
  slow decode (25-27 tok/s when the controller locked onto depth 3). MTP stays
  constructed and active with live assistant history; the rectangular opt-in
  keeps adaptive depth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(mimo): exact rectangular MTP verification by default

Pin mlx-swift-lm to the exact rectangular verification stack (row-exact
multi-row affine projection, fused norms inside the scalar-dense verifier,
scalar-dense default with a guard against drafting through the bulk trunk).

- `nativeMiMoVerificationMode` selects rectangular verification by default.
  A rollback of `DARKBLOOM_MIMO_RECTANGULAR_VERIFY` or of the SDK's
  scalar-dense switch selects serial-target scoring; the provider never
  selects the bulk rectangular trunk, whose reductions differ from serial
  decode.
- The native paged profile keeps serial-target MTP independently of the
  contiguous default.
- LaunchAgent forwards the three verification rollbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(mimo): pin mlx-swift-lm main 1ee8675a

mlx-swift-lm main now contains #206, #207 and #219 (landed through #246) and
#245. Pin it instead of the stacked SDK branch commit. The pinned tree is
identical to the SDK validated with this stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com>
Co-authored-by: Claude Opus 5.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.

2 participants