Skip to content

Change auto_archive_duration type to string#14653

Open
andersmmg wants to merge 1 commit intoNousResearch:mainfrom
andersmmg:patch-1
Open

Change auto_archive_duration type to string#14653
andersmmg wants to merge 1 commit intoNousResearch:mainfrom
andersmmg:patch-1

Conversation

@andersmmg
Copy link
Copy Markdown

Fixes #13653

What does this PR do?

Fixes a bug where cron jobs fail with Google AI API validation errors when using the discord_server tool. The issue is that the auto_archive_duration parameter had an integer enum [60, 1440, 4320, 10080], but Google AI API requires string enums. This caused cron jobs (which include the discord_server tool in their tool list) to fail with errors like:

  • function_declarations[11].parameters.required[0]: property is not defined
  • parameters.properties[11].value.enum[0]: cannot be empty / TYPE_STRING, 60

Related Issue

Fixes #13653

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • tools/discord_tool.py: Changed auto_archive_duration schema enum from integers [60, 1440, 4320, 10080] to strings ["60", "1440", "4320", "10080"]
  • tools/discord_tool.py: Updated handler to convert string input back to integer with int(args.get("auto_archive_duration", 1440))

How to Test

  1. Reproduce the original issue: Create a cron job and run it - it should fail with the error shown in [Bug]: Cron jobs fail every time #13653
  2. After the fix: Run the same cron job - it should succeed
  3. Verify the schema: Check that auto_archive_duration in _STATIC_SCHEMA now has string enum values
  4. It's likely related to using the gemma-4 model, or just Gemini models in general, so test with those

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • [N/A] I've updated tool descriptions/schemas if I changed tool behavior — or N/A

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/cron Cron scheduler and job management platform/discord Discord bot adapter provider/gemini Google Gemini (AI Studio, Cloud Code) labels Apr 23, 2026
@alt-glitch
Copy link
Copy Markdown
Collaborator

Likely duplicate of #13486 — same root cause (discord tool integer enum breaks Gemini). Also related to #14104 which takes a different approach (sanitize_gemini_schema coercion).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P1 High — major feature broken, no workaround platform/discord Discord bot adapter provider/gemini Google Gemini (AI Studio, Cloud Code) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cron jobs fail every time

2 participants