Skip to content

Feat: optionally add uploaded file metadata to session_state when media is not sent to model#7316

Open
harsh21234i wants to merge 1 commit intoagno-agi:mainfrom
harsh21234i:final-clean-feature
Open

Feat: optionally add uploaded file metadata to session_state when media is not sent to model#7316
harsh21234i wants to merge 1 commit intoagno-agi:mainfrom
harsh21234i:final-clean-feature

Conversation

@harsh21234i
Copy link
Copy Markdown
Contributor

Fixes #7306 Adds an opt-in feature to include uploaded file metadata (file_id and filename) in session_state when send_media_to_model=False.

Currently, when media is not sent to the model, the agent has no awareness that files were provided during a run, even though they may still be available for tool usage. This change makes file metadata accessible through session_state without requiring additional user input or custom hooks.

Changes
Introduced optional flag add_file_ids_to_session_state
When enabled and send_media_to_model=False, file metadata is extracted and stored in run_context.session_state
Supports multiple files
Appends to existing session state instead of overwriting

@harsh21234i harsh21234i requested a review from a team as a code owner April 3, 2026 08:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

PR Triage

Missing tests: This PR modifies source code but does not include any test changes. Please add or update tests to cover your changes.

@harsh21234i harsh21234i changed the title Feature: optionally add uploaded file metadata to session_state when media is not sent to model Feat: optionally add uploaded file metadata to session_state when media is not sent to model Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add files /filename/file_id to session_state

1 participant