Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Settings validation gaps: max indexed files becomes 1, openaiBaseUrl unchecked, MCP values untyped

Closed
#184 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
desktop

Research direction

Start with src/main/settings.ts at the cited validation, update, and persistence paths, then inspect src/renderer/src/views/dialogs.ts:506 for the empty-field conversion. Run the settings-related tests and check validation for each listed input plus the failed-write case. Done means invalid values are rejected or defaulted as specified and a failed write leaves in-memory secrets unchanged.

Written by the indexing model from the issue text.

Description

bug priority: low severity: low

Found in the 2026-10-07 code review; the first item is confirmed with a probe.

Problems

  • Max indexed files: an empty field in Settings sends Number('') = 0 (src/renderer/src/views/dialogs.ts:506), and sanitize (src/main/settings.ts:428) turns it into Math.max(1, 0) = 1 file. NaN passes the type check and stays NaN.
  • OpenAI base URL: openaiBaseUrl is never checked with baseUrlError, unlike anthropicBaseUrl (settings.ts:119-122,432).
  • MCP values: mcpServerError doesn't check that env and headers values are strings, so encryptMap can call encrypt(1).
  • Write ordering: update calls storeMcpSecrets (settings.ts:124), which changes this.mcpSecrets before persist. If the write fails, memory and disk disagree and no change is emitted.

Fix

  • if (!Number.isFinite(n) || n < 1) result.maxIndexedFiles = DEFAULT_SETTINGS.maxIndexedFiles;
  • Validate openaiBaseUrl the same way as anthropicBaseUrl.
  • Reject MCP env/headers values that aren't strings.
  • Compute the next MCP secrets and assign them only after writeStored succeeds, as migratePlainSecrets already does.
Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
8h 28m
Merged PRs (30d)
26

Getting set up

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 PierrunoYT/patch

All issues in PierrunoYT/patch

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.