Skip to content

[bug]: /quota command ignores percentDisplayMode config #118

@XDayonline

Description

@XDayonline

Thanks for filing a bug. Please include enough detail to reproduce the issue.
Review CONTRIBUTING.md before submitting.

Pre-flight checks

  • I searched existing issues and did not find a duplicate.
  • I verified this on the current production released OpenCode version, or I explain why not below.

OpenCode version tested

1.2.24

opencode-quota version tested

3.8.7

Bug summary

The /quota slash command hardcodes % left regardless of the percentDisplayMode config setting. The sidebar and compact status correctly use formatDisplayedPercentLabel() which respects percentDisplayMode, but /quota does not.

Steps to reproduce

  1. Set "percentDisplayMode": "used" in opencode.json under experimental.quotaToast
  2. Run /quota — shows XX% left
  3. Observe sidebar shows XX% used

Expected behavior

/quota should respect percentDisplayMode and show XX% used when configured as such, matching sidebar behavior.

Actual behavior

/quota always shows XX% left ignoring the config.

Relevant logs/output

The root cause is in src/lib/quota-command-format.ts:75:

lines.push(`  ${labelCol} ${bar(pct, barWidth)}  ${pct}% left${suffix}`);

Should use formatDisplayedPercentLabel(row.percentRemaining, params.percentDisplayMode) instead, and pass percentDisplayMode from runtime.config through handleQuotaSlashCommand.

A PR with the fix is ready: #117

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions