Skip to content

Fix ML Intern mode for every initial-send path - #2578

Open
dvd233 wants to merge 2 commits into
huggingface:mainfrom
dvd233:contrib/issue-2573-ml-intern-initial-send
Open

Fix ML Intern mode for every initial-send path#2578
dvd233 wants to merge 2 commits into
huggingface:mainfrom
dvd233:contrib/issue-2573-ml-intern-initial-send

Conversation

@dvd233

@dvd233 dvd233 commented Sep 10, 2026

Copy link
Copy Markdown

What changed

  • Read mlAssistant.enabled at conversation creation for the home, model, prompt-example, and fix/resume send paths.
  • Lock the client mode only after the server returns the persisted conversation seed, and use that seed as the source of truth for the sidebar and navigation state.
  • Add a server-side fail-closed boundary so ordinary conversations cannot create Hugging Face jobs or sandboxes without the ML Intern budget and billing context; reads, stops, and non-Hub MCP servers remain available.
  • Add regression coverage for the client send paths, persisted create seed, MCP compute boundary, and scheduled-job edge cases.

Why

A prompt-example send bypassed the one path that latched ML Intern locally, so the new conversation was persisted as an ordinary chat. That left Hub compute available without the mode's budget, pre-flight, and billing protections.

Closes #2573

Validation

  • ML_ASSISTANT_MODE=true: server 1400 tests, SSR 4 tests, client 248 tests passed (serial workers).
  • Focused regression suite: 108 tests passed.
  • npm run check: 0 Svelte diagnostics.
  • Production builds passed with both ML_ASSISTANT_MODE=true and false.
  • Changed files pass Prettier and ESLint; git diff --check passes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T20:42:39.177230Z 19423a0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19423a0a2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/server/textGeneration/mcp/runMcpFlow.ts
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.

ML Intern: a fresh chat started from a prompt example is created without the mode

1 participant