---
slug: problemas-e-solucoes
title: Troubleshooting
summary: From symptom to solution. For each problem, what to check, the cause, the fix, how to confirm it worked, and when to ask for support, without reinstalling everything or working around the workflow.
locale: en
section: faq
applies_to:
  cli: ">=0.28.1"
  skill: ">=1.4.2"
executors: [claude-code, codex, gemini-antigravity]
os: [macos]
audience: [admin, member]
reason_codes: [result_unknown, api_version_incompatible, adapter_requirements_incompatible, runtime_capabilities_missing, cli_update_reinvoke_required, cli_release_download_failed, cli_release_checksum_mismatch, cli_release_swap_failed, skill_release_download_failed, skill_release_checksum_mismatch, skill_install_swap_failed, release_not_promoted, release_channel_not_observed, release_channel_selection_required, runtime_release_channel_unconfigured, release_channel_not_allowed, login_denied, no_bootstrap_candidates, bootstrap_claim_denied, bootstrap_exchange_denied, ambiguous_organization, ambiguous_installation, not_bootstrapped, local_context_missing, skill_not_installed, skill_install_no_agent_detected, skill_install_agent_unknown, skill_install_targets_unavailable, user_session_expired, user_session_invalid, reauth_required, device_session_expired, user_not_authenticated, user_access_token_missing, refresh_failed, credential_store_unavailable, credential_store_write_failed, human_credential_store_unavailable, human_credential_store_write_failed, human_credential_store_access_denied, human_credential_store_interaction_required, human_credential_store_read_only, organization_mismatch, installation_organization_mismatch, user_membership_missing, user_membership_inactive, installation_required, installation_not_found, installation_inactive, installation_revoked, installation_id_invalid, installation_token_missing, token_expired, token_revoked, token_required, token_scope_missing, organization_inactive, organization_suspended, organization_not_found, capability_disabled, module_disabled, entitlement_not_found, quota_exceeded, agreement_expired, agreement_past_due_grace, individual_trial_expired, no_published_profile_for_workflow, no_published_profile, workflow_profile_not_found, workflow_not_found, workflow_not_linked, workflow_membership_missing, workflow_membership_scope_not_allowed, workflow_membership_role_required_for_ambiguous_stage, workflow_membership_role_missing, provider_connection_not_found, provider_connection_not_configured, connection_absent, workflow_unlinked, mapping_empty, mapping_partial, canonical_stage_not_mapped, provider_mapping_incomplete, provider_state_not_mapped, board_not_required, provider_outside_cli_boundary, suite_control_unavailable, suite_control_unavailable_online_required, suite_control_unreachable, suite_control_invalid_response, installation_context_present_unverified, cache_expired, skipped_upstream_failure, provider_not_specified, workflow_policy_not_live, mapping_status_check_failed, server_lacks_resolved_workflow, policy_denied, workflow_action_host_capability_required, workflow_action_node_visit_required, workflow_action_node_visit_transition_not_allowed, workflow_action_raw_content_not_allowed, workflow_action_result_report_raw_content_not_allowed, workflow_action_scope_invalid, workflow_action_subject_required, workflow_action_subject_scope_mismatch, workflow_action_transition_key_required, workflow_action_work_item_context_required, human_scope_mismatch, installation_token_invalid, context_mismatch, initial_state_not_governed, initial_state_ambiguous, work_item_type_required, work_item_type_required_at_destination, remediation_type_label_invalid, work_item_label_unknown, provider_board_in_other_workspace, board_not_connected_fallback, provider_mismatch, session_provider_not_allowed, bootstrap_operation_pending, bootstrap_attempt_superseded]
intents:
  - I got an error, what do I do
  - the LLM doesn't recognize the skill
  - my session expired
  - malha setup doesn't finish
  - the LLM refused an action
  - no connection to MalhaOS
  - the installed CLI has no first-use
  - macOS asks for the Keychain password
  - the session changed during the command
  - the issue can't be created in the chosen state
  - the issue stopped without a type label
  - the request landed in the wrong organization
  - the setup got stuck pending
  - the organization doesn't accept my sign-in
reviewed_at: "2026-11-23"
---

# Troubleshooting

Check before you fix. Almost every problem shows up in the diagnosis with a reason code, and the code tells you who resolves it. Reinstalling everything or signing in again without a diagnosis rarely helps. Nothing is lost when you reinstall or update, but nothing gets solved that way either.

To start, run the first-use diagnosis, replacing `<provider>` with the key of your board:

```bash
malha doctor --first-use --provider <provider>
```

Look up the reason code in the list below or in the [reason code catalog](reason-codes). Each problem is one of these types:

- **Technical:** something failed on your computer or the network. You fix it or try again.
- **Policy:** the workflow or the organization doesn't allow it. Someone with permission decides. No one works around it.
- **Not confirmed:** the CLI couldn't confirm online. Confirm before concluding anything.
- **Board:** access to the board is granted by the company manager.

## P1 · The terminal can't find `malha`

### Symptom

The terminal says the `malha` command doesn't exist. There is no reason code, because the CLI never ran.

### Check

```bash
command -v malha
```

### Cause

The binary isn't in a folder on the `PATH`, or the terminal was opened before the installation.

### Fix

Open a new terminal. If it persists, redo step 3 of the [installation](instalacao): install the binary in a folder you own that is on the `PATH`.

### Confirm

```bash
malha version
```

### Ask for support when

The binary is on the `PATH`, but `malha version` exits with an error.

## P2 · The CLI says it's out of date or incompatible

### Symptom

`api_version_incompatible`, `adapter_requirements_incompatible`, `runtime_capabilities_missing`, or `cli_update_reinvoke_required`.

### Check

```bash
malha update check
```

### Cause

The installed version is older than MalhaOS expects. With `cli_update_reinvoke_required`, the CLI just updated itself and needs the command to be run again.

### Fix

Apply the update for your channel. With `cli_update_reinvoke_required`, just repeat the command you had run.

```bash
malha update apply
```

### Confirm

`malha update check` with no pending update, and `malha version` showing the new version.

### Ask for support when

The same code continues after updating to the latest version of your channel.

## P3 · The update fails on download or swap

### Symptom

`cli_release_download_failed`, `cli_release_checksum_mismatch`, `cli_release_swap_failed`, `skill_release_download_failed`, `skill_release_checksum_mismatch`, or `skill_install_swap_failed`.

### Check

Make sure your connection works and run `malha update check`.

### Cause

- **Download:** the connection dropped during the download.
- **Checksum:** the downloaded file doesn't match the published one. For security, the CLI refuses to install it.
- **Swap:** the CLI couldn't replace the old file, usually because of folder permissions.

### Fix

Run `malha update apply` again. Never install a binary or a skill from another source to work around the failure.

### Confirm

`malha update check` with no pending update.

### Ask for support when

The checksum fails twice in a row, or the swap fails even with write permission on the folder.

## P4 · The update is refused

### Symptom

`release_not_promoted`, `release_channel_not_observed`, `release_channel_selection_required`, `runtime_release_channel_unconfigured`, or `release_channel_not_allowed`.

### Check

`malha update check` shows your installation's channel and the code.

### Cause

Policy. The version hasn't been released on your installation's channel yet, or the channel isn't configured for your organization. With `release_channel_selection_required`, it can also mean you no longer have an active installation in this organization, for example after switching machines.

### Fix

Ask the org admin to check the installation's channel. Don't switch channels on your own. If the admin confirms the channel is released and `release_channel_selection_required` continues, open **Set up CLI** again and redo the [installation](instalacao) on this machine.

### Confirm

`malha update check` with `decision: allow`.

### Ask for support when

The admin confirms the channel is configured and the version is released, you have redone the installation, and the code continues.

## P5 · `malha setup` doesn't finish or the sign-in is refused

### Symptom

`login_denied`, `no_bootstrap_candidates`, `bootstrap_claim_denied`, `bootstrap_exchange_denied`, `ambiguous_organization`, `ambiguous_installation`, `not_bootstrapped`, or `local_context_missing`.

### Check

Read the `reason_code` at the end of the `malha setup` output.

### Cause

- **`login_denied`:** the browser sign-in wasn't approved.
- **`ambiguous_*`:** there is more than one organization or installation and none was chosen.
- **`not_bootstrapped`, `local_context_missing`:** this computer hasn't been linked yet.
- **`no_bootstrap_candidates`, `bootstrap_*_denied`:** your account has no installation available, or the installation refused the link.

### Fix

Run `malha setup` again, approve in the browser, and choose when it asks. In the last two cases, ask the admin to check the invitation and the installation.

### Confirm

In `malha doctor --first-use --provider <provider>`, the mission M1 items with `verified`.

### Ask for support when

The admin confirms the invitation and the installation, and the same code continues.

## P6 · The LLM doesn't recognize the skill

### Symptom

The LLM doesn't know what `malha-os-workflow` is. It may come with `skill_not_installed`, `skill_install_no_agent_detected`, `skill_install_agent_unknown`, or `skill_install_targets_unavailable`.

### Check

```bash
malha skill check
```

### Cause

- The skill isn't installed on that executor.
- The executor was opened before the installation.
- The CLI didn't recognize the executor.
- The CLI couldn't get the list of executors (`skill_install_targets_unavailable`).

### Fix

Follow the order in [Executors](executores): a new conversation, reopening the app, and, if it's still missing, installing the skill and choosing the executor with `--agent`, for example `malha skill install --agent codex`. Also check that the executor has been validated.

```bash
malha skill install
```

### Confirm

`malha skill check` shows the skill installed on the executor, and the LLM responds to the [first message](mensagem-inicial).

### Ask for support when

`malha skill check` shows the skill installed, the executor was reopened, and the LLM still doesn't recognize it.

## P7 · The session expired

### Symptom

`user_session_expired`, `user_session_invalid`, `reauth_required`, `device_session_expired`, `user_not_authenticated`, `user_access_token_missing`, or `refresh_failed`.

### Check

The first-use diagnosis shows the session item as `pending`.

### Cause

The CLI renews the session on its own. These codes only appear when automatic renewal wasn't possible.

### Fix

Only sign in when one of these codes appears. Don't sign in preemptively.

```bash
malha auth login
```

Approve in the browser.

### Confirm

The session item with `verified` in the diagnosis.

### Ask for support when

The code comes back right after an approved sign-in.

## P8 · The CLI can't store the credentials

### Symptom

`credential_store_unavailable`, `credential_store_write_failed`, `human_credential_store_unavailable` or `human_credential_store_write_failed`.

### Check

Check that your macOS session is unlocked.

### Cause

The system credential store (the Keychain, on macOS) is locked or didn't respond. When macOS denies `malha` access, the code is a different one: see P20.

### Fix

Unlock the session and run the command again. Don't delete or edit Keychain items by hand.

### Confirm

The command completes without the code, and the diagnosis shows the session with `verified`.

### Ask for support when

The store is unlocked and the code continues.

## P9 · Wrong organization or no membership

### Symptom

`organization_mismatch`, `installation_organization_mismatch`, `human_scope_mismatch`, `user_membership_missing`, or `user_membership_inactive`.

### Check

The first-use diagnosis shows the code and who resolves it.

### Cause

- **`*_mismatch`:** the CLI workspace in use is linked to another organization. Each workspace belongs to only one organization; the default is your home folder.
- **`user_membership_*`:** your account isn't part of the organization, or the access was deactivated.

### Fix

For the wrong organization, use that organization's workspace with `--workspace <folder>` (or `MALHA_WORKSPACE`). If it doesn't exist yet, create a folder and run `malha --workspace <folder> setup`. Redoing `malha setup` in the current workspace doesn't switch the organization: it answers `already_bootstrapped`. See [Several organizations and workspaces](varias-organizacoes). For missing or inactive membership, ask the admin for the invitation or reactivation.

### Confirm

`malha --workspace <folder> workspace current --online` shows the right organization, and the `workflow_context` item of mission M2 shows `verified`.

### Ask for support when

The admin confirms your membership and the code continues.

## P10 · The installation is refused

### Symptom

`installation_required`, `installation_not_found`, `installation_inactive`, `installation_revoked`, `installation_id_invalid`, `installation_token_missing`, `token_expired`, `token_revoked`, `token_required`, or `token_scope_missing`.

### Check

The diagnosis shows the `installation_health` item with the code.

### Cause

Policy. The installation linked to this computer no longer exists, was deactivated or revoked, or its credential expired.

### Fix

Ask the admin for an active installation. Then run `malha setup` again to link this computer to it. Don't copy credentials from another computer.

### Confirm

The `installation_health` item with `verified`.

### Ask for support when

The admin confirms an active installation, `malha setup` completes, and the code continues.

## P11 · The organization's access is suspended or at its limit

### Symptom

`organization_inactive`, `organization_suspended`, `organization_not_found`, `capability_disabled`, `module_disabled`, `entitlement_not_found`, `quota_exceeded`, `agreement_expired`, `agreement_past_due_grace`, or `individual_trial_expired`.

### Check

The diagnosis shows the license item (`capability:malhaos.workflow.resolve`) as `pending`.

### Cause

The organization's access to MalhaOS is suspended, disabled, or has reached its limit.

### Fix

Talk to the org admin. There is nothing to fix on your computer.

### Confirm

The license item with `verified`.

### Ask for support when

The admin confirms the access is in good standing and the code continues.

## P12 · There is no workflow, or you're outside it

### Symptom

`no_published_profile_for_workflow`, `no_published_profile`, `workflow_profile_not_found`, `workflow_not_found`, `workflow_not_linked`, `workflow_membership_missing`, `workflow_membership_scope_not_allowed`, `workflow_membership_role_required_for_ambiguous_stage`, or `workflow_membership_role_missing`.

### Check

The `workflow_context` item of mission M2 shows the code.

With `workflow_membership_role_required_for_ambiguous_stage`, compare the failing command with the issue: the state, the state id, and every label, including the `role:*` one. If the `issue` command of the same grant passed and the `claim` or the `consume` was denied, the difference is in what that command sent.

### Cause

Policy. The organization hasn't published a workflow yet, or you aren't part of it, or your role is missing.

With `workflow_membership_role_required_for_ambiguous_stage`, the most common cause is different: the stage has more than one possible role and the command didn't carry the issue's role label, so MalhaOS doesn't pick one on its own.

### Fix

With `workflow_membership_role_required_for_ambiguous_stage`, first resend the command with the issue's state, state id, and every label. This doesn't depend on the admin. If the code persists with the full context, go on to the request below.

Ask the admin to publish the workflow or to add you as a member, with the right role.

### Confirm

The `workflow_context` item with `verified`.

### Ask for support when

The admin confirms the workflow is published and your membership, and the code continues.

## P13 · The board isn't connected or mapped

### Symptom

`provider_connection_not_found`, `provider_connection_not_configured`, `connection_absent`, `workflow_unlinked`, `mapping_empty`, `mapping_partial`, `canonical_stage_not_mapped`, `provider_mapping_incomplete`, `provider_state_not_mapped`, `mapping_status_check_failed`, or `server_lacks_resolved_workflow`.

### Check

The M2 and M3 mission items in the first-use diagnosis.

### Cause

Policy. The workflow has no connection to the board, the connection isn't linked to the workflow, or some stages are missing board statuses. With `provider_state_not_mapped`, the issue's current status doesn't match any stage.

With `mapping_status_check_failed`, the mapping lookup failed: run the diagnosis again and, if it persists, talk to the admin. With `server_lacks_resolved_workflow`, the organization's MalhaOS doesn't report the workflow: ask the admin to confirm the connection and the mapping, or run again with `--workflow-id` and `--profile-id`.

`board_not_required` isn't a problem: on the Individual plan, the workflow doesn't use a board.

### Fix

Ask the admin to connect and map the board, following [Board and mapping](board-e-mapeamento). The LLM can write the request with the code and the missing stages. Don't change the issue's status on the board to “fit” a stage.

### Confirm

The M2 and M3 items with `verified`, or with `not_applicable` on the Individual plan.

### Ask for support when

The admin confirms the connection and mapping are complete, and the code continues.

## P14 · You can't create or update issues on the board

### Symptom

The LLM gets a permission error from the board. In the diagnosis, mission M3b appears with `provider_outside_cli_boundary`.

### Check

Ask the LLM to read an issue from the team or project and tell you which error it got from the board.

### Cause

Board. Your board account doesn't have create or update access on that team or project. The CLI can't see the board, so this item never shows up as `verified` in the diagnosis.

### Fix

Ask the company manager for read, create, and update access on the team or project. The LLM can write the request.

### Confirm

The LLM can create your onboarding issue (mission M4).

### Ask for support when

The manager confirms the access and the LLM keeps getting a permission error. In that case, also check the board tools in the executor's session.

## P15 · No connection, or the result couldn't be confirmed

### Symptom

`suite_control_unavailable`, `suite_control_unavailable_online_required`, `suite_control_unreachable`, `suite_control_invalid_response`, `installation_context_present_unverified`, `cache_expired`, `skipped_upstream_failure`, `provider_not_specified`, or `workflow_policy_not_live`.

### Check

```bash
malha doctor
```

Look at the `control_plane_reachable` check.

### Cause

- **`suite_control_*`:** no network, or MalhaOS didn't respond.
- **`installation_context_present_unverified`, `cache_expired`:** the CLI kept the local state but couldn't confirm it online.
- **`skipped_upstream_failure`:** the item wasn't checked because an earlier item failed.
- **`provider_not_specified`:** the diagnosis ran without `--provider`. Run it again with the board's provider, for example `malha doctor --first-use --provider linear`.
- **`workflow_policy_not_live`:** the workflow came from local state, without online confirmation.

### Fix

Restore the connection and run the diagnosis again. Don't conclude that something is ready from an unconfirmed result. With `skipped_upstream_failure`, first resolve the item that failed.

### Confirm

`control_plane_reachable` with no failure, and the previously skipped items now with a status of their own.

### Ask for support when

The network works, other sites open, and the `suite_control_*` code appears on two attempts in a row.

## P16 · The LLM refused an action

### Symptom

The LLM says it can't comment, change a status, create an issue, or open a pull request, with `policy_denied` or a `workflow_action_*` code.

### Check

Ask the LLM: “what stage, role, and approval does this action require?”

### Cause

Policy. Your organization's workflow doesn't allow this action at this stage, with this role, or without an approval. The `workflow_action_*` codes say which condition was missing.

### Fix

Meet what the stage requires, give or request the approval, or ask the admin to review the workflow. Don't change statuses or `role:*` labels on the board to unlock the action.

### Confirm

The LLM looks up the workflow again and the action is now allowed.

### Ask for support when

The admin confirms the workflow should allow the action at this stage and it's still refused. Send the exact reason code.

## P17 · I lost the conversation or the context

### Symptom

The executor closed, the conversation got too long, or you switched computers. There is no reason code.

### Check

Make sure the issue exists on the board and what its identifier is.

### Cause

MalhaOS doesn't store the conversation context. What counts is in the issue, the comments, and the artifacts.

### Fix

Open a new conversation and ask: “pick up ABC-123 where we left off.”

### Confirm

The LLM tells you the issue's current stage and the next step.

### Ask for support when

It usually isn't necessary. If the LLM can't read the issue, see P14.

## P18 · The installed CLI has no first-use

### Symptom

The `malha doctor --first-use` command doesn't exist, or this Wiki describes steps your CLI doesn't have. There is no reason code.

### Check

```bash
malha version
malha update check
```

Compare the version with the minimum CLI version listed at the top of this page.

### Cause

The CLI was downloaded from a channel that doesn't have first-use yet. The **Set up CLI** page starts from your organization's default channel, which may be older than the channel with the minimum version.

### Fix

Open **Set up CLI** again. If the page shows the **Release channel** selector, choose the channel that has the minimum version, download, check the checksum, and redo step 3 of the [installation](instalacao). Without the selector, your organization follows a single channel: ask your org admin to check its channels.

### Confirm

```bash
malha doctor --first-use --provider <provider>
```

The diagnosis runs and shows the first-use steps.

### Ask for support when

The channel with the minimum version doesn't appear on the page, or none of your organization's channels has that version.

## P19 · A claim returned `result_unknown`

### Symptom

The CLI could not confirm the authorization step before the effect.

### Check

Do not repeat the claim, clear the journal, or choose a different key to bypass uncertainty. Preserve pending files.

```bash
malha workflow action-grant history
malha workflow action-grant history --help
```

### Cause

This does not prove a server failure or confirm that a commit or another action happened. The cause remains unknown without observed diagnostics.

### Resolve

Find the original attempt with `method` equal to `claim_workflow_action_authorization`. If help lists `--claim-attempt-key`, query:

```bash
malha workflow action-grant history --claim-attempt-key <attempt_key>
```

For an explicit original key, add `--original-idempotency-key <original-key>`. The server must also advertise `claim-observation.v1`; without support the CLI keeps the fence. No fallback repeats the mutation.

### Confirm

`claim_observed` reports only the proven claim outcome: `accepted`, `denied`, or `expired_unclaimed`. `legacy_audit_key` identifies historical audit evidence without a stored fingerprint. `execution_authorized` and `replay_allowed` remain `false`; the original journal may remain `unknown`.

The LLM checks the effect separately in Git or the provider. An expired or revoked authorization cannot execute. Only after sufficient proof about the original attempt and confirmation that the effect never started, resolve the current workflow and obtain a new valid authorization. A still-live authorization must first be closed correctly through the existing contract. An applied or still-uncertain effect needs its specific recovery.

New failures may report `failure_stage`, `source_reason_code`, and `http_status`. Do not assign that cause to an old incident without evidence.

### Ask for support when

Protocol, proof, or intact context is missing, the session differs, or the effect remains uncertain without supported recovery. Share safe IDs and reason codes only; never secrets, nonces, or credential files.

## P20 · macOS asks for the Keychain password or denies `malha` access

### Symptom

macOS asks for the Keychain password when you use `malha`, or a command ends with `human_credential_store_access_denied`, `human_credential_store_interaction_required` or `human_credential_store_read_only`.

### Check

Check the CLI version:

```bash
malha version
```

Also check how the command ran: in a terminal of your macOS session, or through an executor, a scheduler or SSH, without an interactive session.

### Cause

The Keychain authorizes each item for the program that wrote it. Up to version `0.36.11`, `malha` itself wrote the items, and every update was a new program to macOS: the request came back with every update. From `0.36.12`, `malha` reaches the Keychain through Apple's `security` tool. On the first run after updating, macOS asks once for each item already stored; after that, updates no longer ask.

`human_credential_store_access_denied` means the request was denied or canceled. `human_credential_store_interaction_required` means macOS needed to ask and the command ran without an interactive session, with nowhere to show the request.

`human_credential_store_read_only` means the Keychain only allowed reading and the command needed to write. This happens in an executor's sandbox, such as Codex on macOS: it lets the Keychain be read and refuses writing.

### Fix

Run the command once in a terminal of your macOS session and answer "Allow" or "Always Allow" to each Keychain request. On the first run of `0.36.12` or newer, a few requests may appear in a row, one per item. On an older version, update with `malha update apply`. Don't delete or edit Keychain items by hand, and don't allow all applications to access the item.

With `human_credential_store_read_only`, run the same command once outside the sandbox (in Codex, approve running it outside) and try again. Do not copy credentials into files to work around the sandbox. The Codex configuration is in [Executors](executores).

### Confirm

The command below returns `allow`, with no request, also when it runs through the executor:

```bash
malha license check --capability malhaos.workflow.resolve
```

### Ask for support when

The code continues after you allow access, or macOS asks for the password on every run on `0.36.12` or newer.

## P21 · The installation credential of this workspace was refused

### Symptom

A command ends with `installation_token_invalid`.

### Check

Check which workspace the command ran in and which organization it belongs to:

```bash
malha workspace current --online
```

If the failed command used `--workspace <folder>` or `MALHA_WORKSPACE`, check with the same workspace.

### Cause

MalhaOS refused the installation credential stored in this workspace. It expired, was revoked, or belongs to another workspace or to an installation that no longer exists. See [Several organizations and workspaces](varias-organizacoes).

### Fix

Run the setup in the same workspace where the command failed. It notices the credential was refused and links the installation again, with the browser sign-in:

```bash
malha setup
```

In a workspace that isn't the default one, use `malha --workspace <folder> setup`. Don't run the setup in another workspace to work around it: the problem stays where it is.

### Confirm

In the same workspace, the command below returns `allow`:

```bash
malha license check --capability malhaos.workflow.resolve
```

### Ask for support when

The setup finishes and the code comes back in the same workspace, or the setup can't link the installation again.

## P22 · The workspace session changed during the command

### Symptom

A command ends with `context_mismatch`.

If the code came from `malha setup` and repeats on every new attempt, see case P27.

### Check

See whether another `malha` command, a sign-in, or a setup was running at the same time, in the same workspace, in another window or through the LLM. Also check which workspace the command ran in:

```bash
malha workspace current --online
```

### Cause

The workspace session or credentials changed between the start and the end of the command, for example because a sign-in finished in the middle of it. It also happens when a local record belongs to another account. The CLI stops instead of going on with a session that isn't the one it started with.

### Fix

Wait for the other command or sign-in to finish. Then run the setup in the same workspace: it checks the session and keeps the local data. Only then repeat the command.

```bash
malha setup
```

In a workspace that isn't the default one, use `malha --workspace <folder> setup`. Don't delete the `.malha` folder or switch workspaces to work around it: the local record is what lets an action's result be checked. If the code came from a workflow action, ask the LLM to check the issue's state before repeating it.

### Confirm

`malha workspace current --online` shows the session as verified, and the command that failed ends without the code.

### Ask for support when

The code continues after the setup, with no other command or sign-in running.

## P23 · The issue can't be created in the chosen state

### Symptom

The LLM can't create a new issue and gets `initial_state_not_governed` or `initial_state_ambiguous`. Or the creation goes through with the warning `initial_state_id_missing`.

### Check

Ask the LLM for the `detail` of the refusal:

- `initial_state_field` says which field of the request is wrong, for example `batch[0].initial_state_id`.
- `governed_initial_states` lists the states accepted on that board, with id, name, and stage.

### Cause

Policy. A new issue can only be created in a state the workflow governs on the board where it will live.

- **`initial_state_not_governed`:** the requested state isn't in the board's mapping, or it's mapped to a stage the workflow doesn't have. An issue created in it couldn't follow the workflow.
- **`initial_state_ambiguous`:** the request sent only the name, and more than one state on the board has that name.
- **`initial_state_id_missing` (warning):** the request sent only the name, and MalhaOS found the state by it. It works, but stops working if the state is renamed.

### Fix

The LLM picks the state from the `governed_initial_states` list and sends its `initial_state_id`, together with the board where the issue will be created. If no state on the list fits the plan, the LLM asks you instead of changing the state on its own. If the state should be accepted, ask the admin to map it on the board ([Board and mapping](board-e-mapeamento)).

The board and the `initial_state_id` in the request are available from CLI 0.43.0 and skill 1.20.0. With earlier versions, update first ([Updates and channels](atualizacao-e-canais)).

### Confirm

The LLM asks again and the creation goes through, without the warning `initial_state_id_missing`.

### Ask for support when

The state appears in `governed_initial_states`, the LLM sends its id, and the refusal continues. Send the reason code and the `initial_state_field`.

## P24 · The issue stopped without a type label

### Symptom

The LLM checks the workflow for an issue in an execution stage and gets `work_item_type_required`. Only reading and commenting are left. In the earlier stages, the same issue went through without a warning.

When the stage allows editing the issue, the refusal carries, in `remediation_actions`, an offer to add the type label. If the LLM's request to add the type comes back `remediation_type_label_invalid`, see "When the fix is refused", below.

### Check

Ask the LLM for the issue's labels and the stage it is in:

- How many `type:*` labels the issue has. With none, you get this code. With two or more, the code is `work_item_label_conflict`. With one MalhaOS doesn't know, for example `type:task`, it is `work_item_label_unknown`.
- Whether the stage is an execution stage: ready for development, implementation, QA validation, or release review.
- Whether the refusal carries the `type_label_remediation_available` offer in `remediation_actions`.

### Cause

Policy. In execution stages, when the LLM is allowed to act (any level above read-only), the issue needs exactly one `type:*` label. The rule doesn't apply in earlier stages, which is why the issue gets that far without a warning.

The type says what kind of work it is, and some stages change because of it: `type:adr` brings in the architecture review, `type:incident` asks for a risk review, and `type:documentation` asks for the documentation handoff.

The values accepted today are `type:feature`, `type:bug`, `type:refactor`, `type:research`, `type:adr`, `type:ops`, `type:incident`, and `type:documentation`. There is no `type:task` and no `type:epic`. The LLM reads the current list from the workflow itself, or with `malha workflow label-taxonomy`, without needing an issue (CLI 0.44.0 or newer).

The type comes from the `type:*` label or, when the board has a type mapping, from the issue's native type in the provider, for example the Jira issue type. Without a mapping, only the label counts.

### Fix

Pick the type that describes the work. Don't use a type just to get unblocked: it changes the next stages and the reports.

- **Governed path:** the offer in `remediation_actions` adds the `type:*` label with authorization and a record, like the other workflow fixes. It is always the first path. The LLM:
  1. Picks the value. It reads the board conventions first ([Board conventions](convencoes-do-board)): if they say which type this kind of issue takes, it uses that one. If they don't, or if more than one value fits, it asks you and shows every accepted value. It doesn't pick from the title.
  2. Requests the authorization with exactly one value, adds only that label to the issue, without removing any other, and confirms the change.
  3. Checks the workflow again.

  The offer accepts a single value because the issue needs exactly one type: with two, the refusal becomes `work_item_label_conflict`. It never removes labels either. The LLM uses the offer from skill 1.21.0 on. With an older skill, it only reports the refusal: update the skill ([Updates and channels](atualizacao-e-canais)) or use plan B in "How to unblock today", below.
- **Native type mapped per board:** from CLI 0.45.1 and skill 1.21.0 on, the LLM reads the issue's native type in the provider and sends it to MalhaOS with `--work-item-type-id` (the type's id) and `--work-item-type` (its name), when checking the workflow and on the authorizations. When the admin maps, per board, a native type to a `type:*` or to a container (epic and the like), the mapped type counts as the classification. If the issue also has a `type:*` label, the label wins, and the LLM reports the mismatch (`work_item_type_source_conflict`) without changing the label or the mapping. Containers are exempt from `type:*`, but the role rule (`role:*`) still applies. There is no portal screen or CLI command to save the mapping yet: contact support to set it up.
- **To keep it from happening again:** add the `type:*` label when you create the issue. The board conventions can ask the LLM to do it ([Board conventions](convencoes-do-board)).

#### How to unblock today

Plan B, until skill 1.21.0 reaches the stable channel. Use it only when the LLM can't use the governed-path offer, because the skill is older than 1.21.0 or the CLI is older than 0.45. With the current skill and CLI, the governed path comes first.

1. A person adds the accepted `type:*` label directly in the provider, on the stuck issue.
2. The LLM checks the workflow again, with the updated labels.

This path is outside any grant: the change doesn't go through MalhaOS authorization and leaves an audit gap. Record on the issue who added the label and why. The LLM doesn't make this edit on its own; it asks you. This page is documentation and doesn't authorize any action.

This section leaves the page when skill 1.21.0 reaches the stable channel.

#### When the fix is refused

The request to add the type comes back `remediation_type_label_invalid` when it doesn't follow the offer. No authorization is created. The `remediation_type_label_invalid_field` field of the `detail` says what to fix:

- `add_labels`: the request didn't carry exactly one accepted value. `accepted_any_of` lists the accepted values.
- `remove_labels`: the request tried to remove labels. The offer only adds.
- `work_item_labels`: the issue already has a `type:*` label. The LLM checks the workflow again; if there is still a refusal, it is a different code.

The LLM fixes the named field and makes a new request.

#### When the workflow checks the type earlier

The admin can turn on, per workflow, the early type check. With it on, an issue without a type is refused before it reaches the stage that needs a type:

- **On a transition:** the request to move the issue returns `work_item_type_required_at_destination`, and the issue stays where it is. The `detail` names the destination stage (`destination_node_key`) and the accepted values (`accepted_any_of`). The current stage offers, in `remediation_actions`, to add the `type:*` label. The LLM takes that offer and requests the transition again.
- **On a create:** the request to create issues returns `work_item_type_required` when an item has no type. The `detail` names the item (`batch_index`) and lists the accepted values. The LLM adds the label to that item and requests again.

An item the board maps as a container (epic and the like) is not refused.

### Confirm

The LLM checks the workflow again and the issue no longer gets `work_item_type_required`. If another refusal shows up, for example `work_item_role_required` on an issue without a role, it is a separate step.

### Ask for support when

- The issue has exactly one `type:*` label from the accepted list, the stage is the same, and the refusal continues.
- The skill is 1.21.0 or newer and the `work_item_type_required` refusal doesn't carry the offer in an execution stage.

Send the reason code, the stage, and the issue's labels.

## P25 · The request landed in the wrong organization

### Symptom

A request about an issue comes back with one of these signals:

- the refusal `provider_board_in_other_workspace`: the current organization doesn't recognize the issue's board, and another workspace on this computer has already seen it (CLI 0.43.3 or later);
- `matched_scope: malhaos_default`, with "using built-in Malha OS default" in the explanation: the issue fell to the MalhaOS default workflow, not to a workflow of the organization;
- the warning `board_not_connected_fallback`: the issue's board has no connection in this organization;
- the refusal `work_item_label_unknown`: the issue has a label that this organization's workflow doesn't know;
- the refusal `provider_mismatch` on a grant (`action-grant issue` or `subject`): the issue's provider isn't the one this organization's workflow serves.

### Check

List the workspaces on this computer and check the current one with MalhaOS:

```bash
malha workspace list
```

```bash
malha workspace current --online
```

From CLI 0.43.3 on, every `resolve` and grant answer carries `active_workspace`, with the organization the command ran in, and `malha doctor` shows the `other_workspaces` check. See [Several organizations and workspaces](varias-organizacoes).

### Cause

The command ran in one organization's workspace, and the issue's board belongs to another. With no connection for that board, the current organization's MalhaOS uses the default workflow, or refuses the issue because of its labels.

The same signal shows up in the right organization when the board isn't connected to the workflow yet. The workspace is what tells the two apart.

### Fix

Run the same command again with the `--workspace` of the organization that owns the board, or with `MALHA_WORKSPACE` in the terminal session:

```bash
malha --workspace ~/malha-<org> workspace current --online
```

With `provider_board_in_other_workspace`, the refusal carries the likely organization and the command with its `--workspace` in `detail.candidates`. It is only a hint: check the organization before running it. In the conversation, tell the LLM which workspace the issue belongs to. It doesn't switch workspaces on its own.

If the workspace is right:

- with `malhaos_default` or `board_not_connected_fallback`, the board isn't connected to the workflow: see P13;
- with `work_item_label_unknown`, the label doesn't exist in this organization's workflow: check the [board conventions](convencoes-do-board) with the admin;
- with `provider_mismatch`, this organization's workflow doesn't serve the issue's provider: ask the admin for a workflow for that provider (P12).

### Confirm

In the right workspace, `malha workspace current --online` shows the organization that owns the board, and the issue's `resolve` comes back without `malhaos_default` and without the warning.

### Ask for support when

The workspace is right, the admin confirms the board is connected to the workflow, and the issue still falls to the default or is refused with one of these codes. Send the reason code, the active organization, and the board. Don't send the workspace folder.

## P26 · The organization doesn't accept the sign-in you used

### Symptom

One of these signs:

- in the browser, confirming the device code is refused, and the page shows the sign-in methods the organization accepts;
- a CLI command, such as `malha auth login`, ends with `session_provider_not_allowed` and says which sign-ins to use.

### Check

See which account and method you used to sign in to Malha OS in the browser (for example, Google or GitHub). The device page and the CLI message say which methods the organization accepts.

### Cause

The organization accepts only some sign-in methods, and the browser session signed in with another one. Signing in again with the same method doesn't help: the browser session is what approves the device or the CLI sign-in.

### Fix

- On the device page, use the button to sign in with an accepted method. After you sign in, the page goes back to the same code, and you confirm it.
- For a CLI command, sign out of Malha OS in the browser, sign in with an accepted method, and run the command again:

```bash
malha auth login
```

If you need to use another sign-in method, ask your organization's admin. Only the admin changes the accepted methods.

### Confirm

The device confirmation finishes and `malha setup` completes, or the command that failed ends without the code.

### Ask for support when

You signed in with a method the page lists as accepted and the same code continues. Send the CLI version, the time, and the reason code. Don't send the device code, a secret, or a credential.

## P27 · The setup got stuck pending and doesn't finish

### Symptom

`malha setup` or `malha auth login` ends with `bootstrap_operation_pending`, or `malha setup` ends with `context_mismatch` or `bootstrap_attempt_superseded`. Running the setup again gives the same code.

### Check

See the CLI version:

```bash
malha version
```

### Cause

A setup in progress is tied to the sign-in attempt it started in. If that attempt changes along the way, for example because of a `malha auth logout` or another sign-in, the old setup can no longer finish. Before CLI 0.43.2, the CLI didn't get out of this on its own.

### Fix

With CLI 0.43.2 or newer, run the setup again, in the same workspace. The CLI keeps the earlier operation in a history and asks for a new authorization, with the same installation. Confirm the new code in the browser.

```bash
malha setup
```

With a CLI older than 0.43.2, install the CLI again from the portal's **Set up CLI** page, which brings the current version, and then run the setup. `malha update` doesn't help here: it needs a completed setup.

- Don't delete or move files in the `.malha` folder. The CLI takes care of the old operation.
- Don't run `malha auth logout` in the middle of a setup.

### Confirm

`malha setup` completes, and `malha doctor` shows the installation linked.

### Ask for support when

The code continues with CLI 0.43.2 or newer, after running the setup again. Send the CLI version, the time, and the reason code. Don't send the device code, a secret, a credential, or a folder path.

## Status

- **Available:** first-use diagnosis and reason codes for every problem on this page.
- **Available:** the LLM looks up this page through the CLI, by code (`malha wiki search --reason-code`), from CLI 0.29.0 and skill 1.6.0 on.
- **Coming soon:** guidance for when the Wiki is down.
- **Limitation:** the CLI doesn't access the board. Board access problems are checked by the LLM, in its own session.
