Skip to content

Apply workspace temperature to agents and omit the parameter when unset - #6285

Merged
timothycarambat merged 14 commits into
masterfrom
fix/omit-temperature-when-unset
Oct 1, 2026
Merged

timothycarambat merged 14 commits into
masterfrom
fix/omit-temperature-when-unset

Conversation

@shatfield4

@shatfield4 shatfield4 commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Pull Request Type

  • ✨ feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #6091

Description

  • omit the temperature parameter from provider requests entirely when the workspace has no value set, letting the provider use its own default (temperature input is now optional and clearable)
  • validate the value once at connector construction and carry it as a provider instance property instead of passing it through every chat handler
  • apply the workspace temperature to agent sessions using the same model-specific guards already in place for the chat provider entrypoints (OpenAI o*/gpt-5, Anthropic/Bedrock no-temperature models, Azure reasoning deployments) - the agent providers just reuse them
  • remove remaining hardcoded temperatures (agent document summarization, untooled Cohere/Generic OpenAI agent calls) so no request sends a temperature the user did not set
  • fix the OpenAI-compatible developer API passing NaN when a request omits temperature - it now defers to the workspace setting

Visuals (if applicable)

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • I have tested my code functionality
  • Docker build succeeds locally

@shatfield4 shatfield4 self-assigned this Sep 4, 2026
@shatfield4
shatfield4 marked this pull request as ready for review September 4, 2026 22:06

@timothycarambat timothycarambat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Router workspaces lose the OpenAI-compatible API temperature override.

resolveProviderConnector only honors the new temperature arg on the non-router branch; the router branch builds the delegate from workspace.openAiTemp and ignores it.

Since openaiCompatible.js no longer passes temperature into getChatCompletion, a router workspace hit via /v1/openai/chat/completions with temperature: 0 will now go out with the workspace value. Easiest fix is probably to pass temperature into AnythingLLMModelRouter (or into its getLLMProvider call) so both branches behave the same. I think that will work, but needs to be tested.


Please remove the "close live agent sessions on workspace save" change.

It's a good change feature, but it fires from every Workspace.update caller (settings save, developer API, community hub import, Telegram model picker), and it aborts an in-flight agent run and closes the invocation. Lets just uncheck it for now from at least this PR.

Then make an issue for autosave on edit of workspace fields and lets handle that UX convenience and revisit the abort handler on save later. When you leave the page it should abort the session anyway so that shouldnt change anything and you cannot change the config "on the fly" anyway.


Smaller asks:

  • Add a unit test for resolveTemperature (null, "", "0", negative, non-numeric, and one guarded model per class)
  • Rebase to master

@timothycarambat timothycarambat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Referring to the comment from OR

Anytime we are potentially pushing a key:value and value is undefined, we should spread it via a class util so that we are not ever sending key: undefined values as undefined over REST is not good practice (RFC 8259). null is valid, undefined is not. Serialization of payload bodies also makes this a bad idea in general while spreading {} just omits it before/during serialization

We are passing potentially undefined here for this.temperature and it should have a shared utils that we can reasonable spread this on

…t request bodies

- Mistral and Cerebras chat no longer force temperature 0 when unset
- Generic OpenAI and Cohere untooled agent calls omit temperature when unset
- Test that agent sessions, tooled/Responses helpers, chat connectors and
  the model router send the workspace temperature and omit it when unset
…sable

The OpenAI-compatible endpoint passed Number(undefined) = NaN when a request
had no temperature, which skipped the ?? fallback and dropped the workspace
setting. Invalid overrides now defer to the workspace temperature.
@timothycarambat timothycarambat added the PR:Ready-to-merge PR has been reviewed by core team and is ready to merge label Sep 25, 2026
@timothycarambat
timothycarambat removed their request for review September 25, 2026 23:00
@timothycarambat
timothycarambat merged commit 4bff9da into master Oct 1, 2026
7 checks passed
@timothycarambat
timothycarambat deleted the fix/omit-temperature-when-unset branch October 1, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR:Ready-to-merge PR has been reviewed by core team and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Workspace LLM Temperature is not applied to agent sessions, and no agent-level temperature setting exists

2 participants