Skip to content

Enforced locked backend config for BrainForge personas#87

Merged
NeonDaniel merged 2 commits into
devfrom
fix/brainforge-backend-lock
Jun 19, 2026
Merged

Enforced locked backend config for BrainForge personas#87
NeonDaniel merged 2 commits into
devfrom
fix/brainforge-backend-lock

Conversation

@NeonCharlie-24

@NeonCharlie-24 NeonCharlie-24 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

BrainForge advisors advertise backend_locked: true but the flag was ignored during LLM routing, allowing locked advisors to run against user-selected backends (Gemini, vLLM).

This PR enforces backend_locked end-to-end:

  • Backend: resolve_llm_clients() preserves the locked persona's own client in both uniform and hybrid modes. switch_provider rejects explicit overrides for locked personas. /api/config derives the flag from the model instead of hardcoding it.
  • Frontend: Config draft excludes locked personas so they never appear in the save payload. Submit handler sends mode: "uniform" or "hybrid" based on which overrides exist ("uniform" mode was previously never sent by the frontend).

Issues

Closes #86

Other Notes

Manual E2E

  1. Add this line in chat.pyresolve_llm_clients(), after each persona_clients[pid] = ... assignment (uniform branch, line ~49; hybrid branch, line ~62):
logger.info("resolve_llm_clients: %s -> %s (locked=%s)", pid, type(persona_clients[pid]).__name__, persona.backend_locked)
  1. Rebuild the container and open backend logs
  2. Open Settings --> Model and switch the model configuration
  3. Start a new chat and review the logs to verfiy BrainForge personas set to BrainForge client

…orrectly send uniform/hybrid mode based on actual overrides.
@NeonCharlie-24 NeonCharlie-24 marked this pull request as ready for review June 11, 2026 20:35
@NeonDaniel NeonDaniel changed the title enforce backend_locked end-to-end for BrainForge personas to prevent … Enforced locked backend config for BrainForge personas Jun 19, 2026

@NeonDaniel NeonDaniel 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.

Changes look good; pulled locally to test and confirm edge case is resolved

@NeonDaniel NeonDaniel merged commit 24917c2 into dev Jun 19, 2026
3 checks passed
@NeonDaniel NeonDaniel deleted the fix/brainforge-backend-lock branch June 19, 2026 01:12
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.

[BUG] BrainForge backends not excluded from provider switch

2 participants