Skip to content

feat: add current input filename policy - #36

Merged
Activer007 merged 1 commit into
mainfrom
feat/m2-context-phase2-filename-policy
May 13, 2026
Merged

feat: add current input filename policy#36
Activer007 merged 1 commit into
mainfrom
feat/m2-context-phase2-filename-policy

Conversation

@Activer007

Copy link
Copy Markdown
Owner

Summary

  • add current_input_file.filename_policy with default neutral_random
  • expose filename_policy through admin settings and config examples
  • document the policy in API and prompt compatibility docs

Tests

  • go test ./internal/config ./internal/httpapi/admin/...

Phase 2 PR1.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e615244423

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +124 to +128
if strings.TrimSpace(currentInputFile.FilenamePolicy) != "" {
switch NormalizeCurrentInputFileFilenamePolicy(currentInputFile.FilenamePolicy) {
case "legacy", "neutral", "neutral_random":
default:
return fmt.Errorf("current_input_file.filename_policy must be one of legacy, neutral, neutral_random")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate filename policy even when numeric fields are set

ValidateCurrentInputFileConfig now adds filename_policy checks, but those checks are skipped whenever min_chars or inline_max_tokens is non-zero because the function returns early from the earlier branches. As a result, updates like {"current_input_file":{"min_chars":1,"filename_policy":"bad"}} pass validation and persist an unsupported policy, which breaks the documented enum contract for settings reads/writes. Please accumulate validation errors (or run all field checks before returning) so filename_policy is always validated when present.

Useful? React with 👍 / 👎.

@Activer007
Activer007 merged commit 5f7b9ab into main May 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant