[Bug]: /rename always fails when no managed account is signed in: title review fails closed on gateway 401

Closed
#266 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend, cli, testing

Research direction

Start with packages/local-runtime-v2/src/service/session-system/sessions/lifecycle/record-service.ts and trace the title-policy wiring in packages/local-runtime-v2/src/application/session/runtime-session-composition.ts. Read the 401 handling in packages/local-runtime/src/content-safety/api.ts and the related agent-field path in packages/local-runtime-v2/src/application/agent/agent-application.ts. Run the focused Vitest suites and verify that signed-out /rename persists locally without weakening explicit gateway rejection handling.

Written by the indexing model from the issue text.

Description

bug needs-triage tui
Product or interface

CLI - interactive TUI

Version

0.5.0 (also verified on current main, commit 73a2581)

Platform

Windows

OS version and architecture

Windows 11 x64 (build 26200)

Issue area

Other

Desktop log upload ID (optional)

No response

Steps to reproduce

Environment: BYO OpenAI-compatible provider configured in config.yaml, no managed account signed in, default permission mode.

  1. Start the TUI with no managed account signed in.
  2. Run /rename <new name>.
  3. The rename fails with "Content validation failed" for any title, including
    plain ASCII like "test".

The failure is independent of the title content and reproduces on every attempt
while signed out.

Expected and actual behavior

Expected: /rename persists the new session title locally.

Actual: the command fails with "Content validation failed" and the draft is preserved.

Root cause: SessionRecordService.mutateSession routes every title write through titlePolicy.blocks and throws content-policy-rejected when it returns true (packages/local-runtime-v2/src/service/session-system/sessions/lifecycle/record-service.ts).
The production wiring always calls the managed gateway with scene 205 (ConfigField):

titlePolicy.blocks = (title) => input.safety.blocks(title, SAFETY_SCENE.ConfigField)

(packages/local-runtime-v2/src/application/session/runtime-session-composition.ts)

With no managed login there is no bearer token, the gateway answers 401, and the V1 checker maps 401/403 to auth_error (packages/local-runtime/src/content-safety/api.ts).
reviewBlocks blocks every verdict except api_error, so a signed-out user always gets a block for a purely local mutation.

Two details that make this look unintended:

  1. Turn input and output review already skips unmanaged providers. contentReviewRequired is set only when preparation.llm.managedProvider === true, and the TUI also requires region cn (packages/local-runtime-v2/src/services.ts). BYO users chat with no review calls at all, but the session title still gets an unconditional call.
  2. contentReview.enabled is parsed in packages/config/src/config.ts (parseContentReviewConfig) but nothing reads it, so there is no config escape hatch.

The same scene 205 gate also covers agent config fields via reviewAgentConfigFields in packages/local-runtime-v2/src/application/agent/agent-application.ts, so agent renames and persona edits fail the same way while signed out.

Possible directions: block only on an explicit gateway rejection (errorKind === "rejected"), matching how api_error already degrades, or skip the
review call entirely when no managed account is signed in, mirroring the managedProvider gating for turns.

Prepared fix

The fix is on a branch in my fork: https://github.com/ForeverInLaw/minimax-code/tree/fix/session-rename-without-gateway-verdict (commit ae84277). It blocks only on an explicit gateway rejection. Offline, auth and 5xx errors pass, and blank titles never call the gateway. Both reviewBlocks docstrings now note the exception, and the predicate is unit-tested.

Ran locally: typecheck, build, the focused vitest suites (151 tests pass), smoke, and /rename on the patched build while signed out, which now persists the title. Not run: the full pnpm verify list, platforms other than Windows, and a real gateway rejection (unit-tested only). I can rework it if you prefer the auth-gated variant instead.

Redacted error summary
TUI:

        × Error
        Couldn't send this message: Content validation failed. Retry. Your draft is preserved.

    Runtime log, one entry per attempt, reviewId truncated:

        WARN: [] [content-safety] review failed
    {"reviewId":"<uuid>","endpointHost":"agent.minimax.cn","apiVersion":"v1","scene":205,"durationMs":257,"failureKind":"auth","statusCode":401}
Screenshots
Image
Before submitting
  • I have searched existing issues.
  • I have included my version and removed sensitive information.
Dominant language
TypeScript
Stars
1.3k
Forks
141
Avg merge
2h 34m
Merged PRs (30d)
73

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MiniMax-AI/minimax-code

All issues in MiniMax-AI/minimax-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.