Skip to content

webui : fix circular dependency between chat.service.ts and models.svelte.ts#22625

Merged
allozaur merged 1 commit into
ggml-org:masterfrom
Juste-Leo2:dev
May 4, 2026
Merged

webui : fix circular dependency between chat.service.ts and models.svelte.ts#22625
allozaur merged 1 commit into
ggml-org:masterfrom
Juste-Leo2:dev

Conversation

@Juste-Leo2
Copy link
Copy Markdown
Contributor

Overview

This PR fixes a circular dependency between the chat.service.ts and models.svelte.ts files by using direct imports for models.service and props.service.

Additional Information

Similar to PR #22557, I used Sentrux to investigate the dependency loop issues.

The Circular Dependency Path:

  1. Starting point in models.svelte.ts:
    import { ModelsService, PropsService } from '$lib/services';
  2. The routing through the index, which imports ./chat.service:
    export { ChatService } from './chat.service';
  3. The loop back within chat.service.ts, which imports from models.svelte.ts:
    import { modelsStore } from '$lib/stores/models.svelte';

Context for models.service and props.service usage:
These imports are utilized in specific locations, such as:

  • At line 367:
    const props = await PropsService.fetchForModel(modelId);
  • From lines 113 to 115:
    if (serverStore.isRouterMode) return null;
    const props = serverStore.props;

Validation:
I performed a manual check to ensure everything resolves correctly:

PS I:\github-repo\llama.cpp\tools\server\webui> npm run check

> llama-server-webui@1.0.0 check
> svelte-kit sync && svelte-check --tsconfig ./tsconfig.json

Loading svelte-check in workspace: i:\github-repo\llama.cpp\tools\server\webui
Getting Svelte diagnostics...

svelte-check found 0 errors and 0 warnings

Requirements

@allozaur allozaur requested a review from ServeurpersoCom May 4, 2026 11:20
@allozaur allozaur merged commit 36a694c into ggml-org:master May 4, 2026
6 checks passed
@Juste-Leo2 Juste-Leo2 deleted the dev branch May 4, 2026 14:10
samuraieng pushed a commit to samuraieng/llama.cpp that referenced this pull request May 6, 2026
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
cetarthoriphros pushed a commit to cetarthoriphros/llama.cpp that referenced this pull request May 9, 2026
meh pushed a commit to meh/llama.cpp that referenced this pull request May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants