Skip to content

assistant: ensure variables are included in context and tool calls #8643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025

Conversation

sharon-wang
Copy link
Member

@sharon-wang sharon-wang commented Jul 23, 2025

Summary

Release Notes

Bug Fixes

QA Notes

@:assistant

See #8641 and #8642 -- thanks for the repro steps!

if the access keys are not specified, are empty, or only contain empty arrays, do the all vars list
Copy link

github-actions bot commented Jul 23, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:assistant

readme  valid tags

@sharon-wang sharon-wang changed the title assistant: ensure access keys are non-empty array for inspect call assistant: ensure variables are included in context and tool calls Jul 23, 2025
@@ -329,7 +329,7 @@
{
"name": "inspectVariables",
"displayName": "Inspect Variables",
"modelDescription": "List the children of an array of variables in a session. For example, the columns in a dataframe, items in a column or array, or elements of a list. If `accessKeys` is empty, lists all root-level variables in the session.\n\nIf the user references a variable by name, first determine the `access_key` from the user context or a previous inspect variables result.\n\nDo not call when:\n - the variables do not appear in the user context\n - there is no session (the session identifier is empty or not defined)",
"modelDescription": "List the children of an array of variables in a session. For example, the columns in a dataframe, items in a column or array, or elements of a list. If `accessKeys` is empty, lists all root-level variables in the session.\n\nIf the user references a variable by name, first determine the `access_key` from the user context or a previous inspect variables result.",
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +391 to +398
let sessionContent = sessionSummary;
if (value.variables) {
// Include the session variables in the session content.
const variablesSummary = JSON.stringify(value.variables, null, 2);
sessionContent += '\n' + xml.node('variables', variablesSummary);
}
sessionPrompts.push(xml.node('session', sessionContent));
log.debug(`[context] adding session context for session ${value.activeSession.identifier}: ${sessionContent.length} characters`);
Copy link
Member Author

Choose a reason for hiding this comment

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

ensure we are pushing variables info into the session context

Comment on lines +1592 to +1593
const accessKeysProvided = !!accessKeys && accessKeys.length > 0 && accessKeys.some(key => key.length !== 0);
if (accessKeysProvided) {
Copy link
Member Author

Choose a reason for hiding this comment

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

ensure there is at least one access key for inspection, otherwise list all variables

@sharon-wang sharon-wang requested a review from jmcphers July 23, 2025 20:46
@sharon-wang sharon-wang marked this pull request as ready for review July 23, 2025 20:46
Copy link
Collaborator

@jmcphers jmcphers left a comment

Choose a reason for hiding this comment

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

image

works great!

@sharon-wang sharon-wang merged commit b0c97d9 into main Jul 24, 2025
12 checks passed
@sharon-wang sharon-wang deleted the assistant/fix-session-variables-allVars branch July 24, 2025 13:16
@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants