Skip to content

Fix chat monthly budget config parsing#104

Merged
rg4444 merged 1 commit into
mainfrom
codex/fix-undefined-method-mustfloat64-error
Feb 12, 2026
Merged

Fix chat monthly budget config parsing#104
rg4444 merged 1 commit into
mainfrom
codex/fix-undefined-method-mustfloat64-error

Conversation

@rg4444
Copy link
Copy Markdown
Contributor

@rg4444 rg4444 commented Feb 12, 2026

Motivation

  • The code previously called a non-existent ConfigKey.MustFloat64 method when loading chat.MAX_MONTHLY_BUDGET, which caused build failures; the intent is to parse the config value correctly and preserve the previous default.

Description

  • Import strconv and replace the MustFloat64 call with a safe parse using strconv.ParseFloat(sec.Key("MAX_MONTHLY_BUDGET").String(), 64) while keeping the default Chat.MaxMonthlyBudget = 100.0 when the value is absent or invalid.

Testing

  • Running go test ./modules/setting failed in this environment due to the process being run as root (the project detects and aborts), which is expected behavior and unrelated to the change.
  • Running GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT=true go test ./modules/setting -run TestNothing completed successfully.
  • make build completed successfully in the build output after the change.

Codex Task

@rg4444 rg4444 merged commit 113e9c2 into main Feb 12, 2026
13 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant