Skip to content

Comments

fix: use reason as instruction fallback in resource processing#258

Merged
MaojiaSheng merged 2 commits intovolcengine:mainfrom
haosenwang1018:fix/use-reason-as-instruction-fallback
Feb 23, 2026
Merged

fix: use reason as instruction fallback in resource processing#258
MaojiaSheng merged 2 commits intovolcengine:mainfrom
haosenwang1018:fix/use-reason-as-instruction-fallback

Conversation

@haosenwang1018
Copy link
Contributor

Problem

The reason parameter in process_resource() is documented as improving search relevance, but it is never actually used — the variable is accepted and silently discarded.

Fix

Use reason as a fallback for instruction when instruction is empty. This way, reason influences L0/L1 generation via the media processor, fulfilling its documented purpose.

effective_instruction = instruction or reason

When both are provided, instruction takes precedence (more specific). When only reason is provided, it serves as the processing context.

Fixes #243

Windows may produce ISO 8601 timestamps with 7-digit fractional
seconds (e.g. .1470042), which Python's datetime.fromisoformat()
rejects with ValueError. Add a parse_iso_datetime() helper that
truncates excess digits before parsing.

Fixes volcengine#242

Signed-off-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
The reason parameter in process_resource() was accepted but never
used, despite being documented as improving search relevance.

Use reason as fallback for instruction when instruction is empty,
so it influences L0/L1 generation via the media processor.

Fixes volcengine#243

Signed-off-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@MaojiaSheng MaojiaSheng merged commit 35bc7a6 into volcengine:main Feb 23, 2026
4 of 6 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Feb 23, 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.

[Bug]: reason is not used in ResourceProcessor

3 participants