Skip to content

Improvement: say in the reader's language why the chat refused to propose a project or agent change #5378

Open

Description

@yannickmonney

Summary

When the chat's propose_project_settings or read_project_settings refuses a request (a name the project already uses, a project the person cannot change, a model nobody may use), the reply shows a failed step whose line says only Couldn't run as asked (German So nicht ausführbar, French Impossible à exécuter tel quel). The reason is in the step's expanded detail, as the English sentence the tool wrote for the model. A German or French reader only learns why if the model repeats it in its reply. #5363 left this open (epic #5371).

What the code does today (train a32fb1586, not yet on main)

  • The settings tools answer every refusal with refused(message, closest?), which returns { status: 'invalid_args', message } with no reason code (services/platform/backend/domains/chat/proposals.ts:109-115). Its 29 call sites write English sentences addressed to the model, for example `${project.name} already has an agent called ${name}.` (:776, :884) or 'The person cannot create projects: an Editor or an Admin can.' (:563).
  • The line under a failed step's title comes from stepOutcomeLabel. It uses a reason the result names (only sandbox causes have keys, FAILURE_REASON_KEYS), else the status (invalid_args → thinking.outcome.invalidArgs) (services/platform/app/features/chat/utils/activity-label.ts:194-241). Its doc comment states the split: "The model's own message stays in the step's detail; this is the person's line."
  • The expanded detail shows the result's message first, then the rest of the result as JSON (services/platform/app/features/chat/components/thought-timeline.tsx:323-362).
  • A refusal at Apply is already localized. The card maps the service's error code to one of ten reasons (PROPOSAL_FAILURES, services/platform/lib/chat/settings-tools.ts:231-251; proposalFailureOf, proposals.ts:1217-1237) and shows the catalog's sentence (services/platform/app/features/chat/components/settings-proposal-cards.tsx:126, :324).

What was observed

In the browser pass of 2026-11-05 (German and French UI, scripted mock model), a proposal for an agent name the project already had produced a failed step whose detail read "CA Verify already has an agent called Proofreader." in English, in both languages. Every other string of the flow was translated.

Not examined: what real models write in their reply after such a refusal. The scripted model does not explain.

Constraints

  • The sentence is also what the model reads to retry or to ask the person, so it must stay explicit for the model, and so must the closest name lists.
  • New sentences land in en, de and fr (and de-CH where it differs).
  • The step detail is the call's raw input and output for every tool. These two tools should not read differently from the rest without a reason.

Options (no preference)

  1. Give each refusal a reason code, reusing PROPOSAL_FAILURES where one fits (nameTaken, keyTaken, forbidden, archived, model, skills, limit) plus new ones (for example out of scope, ambiguous name, unknown name). stepOutcomeLabel then shows a localized line for them, as it does for sandbox causes.
  2. Show a refused proposal as a card too ("Not proposed", with the localized reason), so it reads like a refusal at Apply.
  3. Write the tool's sentence in the conversation's language. The model reads it either way.
  4. Keep it as it is: the detail is the raw tool answer by design, and the model's reply explains in the reader's language.

Questions

  • Is a step's detail meant for the person, or only a trace of what the model saw?
  • Should other tools' invalid_args refusals follow what is chosen here?

Related

Activity

  1. added
    priority: low
    needs discussion
    improvement
    service: platform
    on Nov 5, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Option 1: reason codes. Every settings-tool refusal the person can act on carries a machine-readable reason next to the unchanged English message (and closest). The line under a failed step (stepOutcomeLabel) shows that reason in the reader's language, the same way it already does for sandbox and web-read causes.

    The rule

    • refused(message, { reason?, closest? }) in proposals.ts.
    • The reasons, all snake_case and each added to FAILURE_REASON_KEYS: out_of_scope, ambiguous_name, unknown_name, forbidden, managed_agent, name_taken, key_taken, archived, model_unavailable, skill_unavailable, skills_limit, agent_limit, no_change.
    • When the tool catches a ProjectError, its code maps through proposalFailureOf(). A refusal then reads the same whether it happens when the chat proposes or when the person clicks Apply.
    • Malformed calls are the model's own mistakes and carry no reason, so they keep reading "Couldn't run as asked".
    • These tools' expanded detail does not change: it keeps the raw English answer. That answer names the agents and projects involved and the closest matches, which the short step line does not.

    Questions

    • Is a step's detail meant for the person, or only a trace? Mainly a trace of the raw tool input and output. The person's explanation is the step line. web_fetch is the one existing exception: its drill-down shows the localized cause instead of its English message, because that message only restates the cause. The settings tools' messages carry more than that, so they stay raw.
    • Should other tools' invalid_args refusals follow? Yes, as a convention written into the chat spec, not as a sweep now. A tool whose refusal a person can act on names a reason from the shared vocabulary, with strings in every locale. Malformed-argument refusals name none.

    Rationale
    The step line is already the person's channel, and it is already localized through reason keys (#5360). This extends one existing mechanism instead of adding a second one. The model keeps its explicit English sentence and the closest lists it needs to retry.

    • A "Not proposed" card would add UI for something that was never a proposal.
    • Localizing the tool's sentence would make what the model reads depend on the language.
    • Keeping it as it is leaves the observed English-only reason in place.

    Implementation units

    1. feat(platform): name a reason for each settings-tool refusal and show it in the reader's language (main, M)
      • Scope:
        • reasons at every refusal site
        • the ProjectError mapping
        • FAILURE_REASON_KEYS entries
        • en/de/fr strings, and de-CH where it differs
        • one sentence and an example in CHAT-R44
        • a manual box and an automation row
      • Acceptance:
        • unit tests for every reason, including malformed calls that carry none
        • a guard test that ties SETTINGS_REFUSAL_REASONS to the keys and locales
        • manually, in a German UI, a taken agent name shows a German step line with the raw detail unchanged
    2. docs(platform): state the step-detail and refusal-reason convention for all chat tools (main, S, after 1)
      • Scope: a new rule under the next free CHAT-R id. It says the detail is the raw trace, and that a drill-down may show the localized cause only when the message carries nothing more, as for web_fetch. It also says person-actionable refusals name a reason. Pointer comments go in the code.
      • Acceptance: the rule and its examples exist, and bun run check is green.
  3. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyimprovementpriority: lowservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions