Skip to content

fix(console): use correct add_resource target field#1637

Merged
zhoujh01 merged 1 commit intomainfrom
fix/console-add-resource-to-field
Apr 22, 2026
Merged

fix(console): use correct add_resource target field#1637
zhoujh01 merged 1 commit intomainfrom
fix/console-add-resource-to-field

Conversation

@qin-ctx
Copy link
Copy Markdown
Collaborator

@qin-ctx qin-ctx commented Apr 22, 2026

Description

Fix the console add-resource payload so uploaded files use the server's expected to field instead of the rejected legacy target field.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Update the console add-resource payload builder to send to instead of target
  • Keep the existing upload flow unchanged so temp upload still resolves to temp_file_id
  • Add a static asset regression test to prevent the payload field from drifting again

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Targeted local validation:

  • python -m pytest -o addopts='' tests/misc/test_console_static_assets.py -q
  • python -m pytest -o addopts='' tests/server/test_api_resources.py -q

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

This fixes the console-side 422 failure when uploading resources through the web UI.

Send the console add-resource payload with `to` so uploads match the
server request schema and stop failing with 422 validation errors.
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@zhoujh01 zhoujh01 merged commit b7b9c08 into main Apr 22, 2026
6 checks passed
@zhoujh01 zhoujh01 deleted the fix/console-add-resource-to-field branch April 22, 2026 09:37
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants