Feat/eval state injection @W-21514105@#356
Closed
Jaganpro wants to merge 2 commits intosalesforcecli:mainfrom
Closed
Feat/eval state injection @W-21514105@#356Jaganpro wants to merge 2 commits intosalesforcecli:mainfrom
Jaganpro wants to merge 2 commits intosalesforcecli:mainfrom
Conversation
…tVariables, preserve outputs - Whitelist `state`, `setupSessionContext`, and `context_variables` in evalNormalizer's VALID_AGENT_FIELDS for agent.create_session so the normalizer no longer strips fields needed for auth bypass and session context injection. - Translate YAML TestSpec `contextVariables` into `context_variables` on the agent.create_session step in yamlSpecTranslator, enabling YAML specs to inject context variables without raw JSON payloads. - Include `outputs[]` array in RunEvalResult's --json output so CI pipelines retain agent responses, topic routing, and planner state for debugging.
Contributor
|
FYI: adopted in #357 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@W-21514105@
Addresses 3 confirmed gaps in
sf agent test run-evaldiscovered through empirical testing against the Einstein Evaluation API:state+setupSessionContext+context_variablesinevalNormalizer.ts— the normalizer'sstripUnrecognizedFieldspass currently removes these fields fromagent.create_session, making it impossible to test post-auth business topics or inject session context without--no-normalizecontextVariablestocontext_variablesinyamlSpecTranslator.ts— theTestCasetype already supportscontextVariablesbuttranslateTestCase()silently drops themoutputs[]in--jsonresult inrun-eval.ts—buildResultSummary()only returns evaluations, discarding the fulloutputs[]array with agent responses, topic routing, and planner state needed for CI debuggingEmpirical Evidence
Testing with a Salesforce Agentforce agent that requires authentication before routing to business topics:
--no-normalize(state preserved)account_validation(auth gate)product_help(correct business topic)Changes
src/evalNormalizer.tsstate,setupSessionContext,context_variablestoVALID_AGENT_FIELDSwhitelistsrc/yamlSpecTranslator.tstestCase.contextVariables→context_variablesoncreate_sessionstepsrc/commands/agent/test/run-eval.tsoutputs[]toRunEvalResulttype andbuildResultSummary()test/evalNormalizer.test.tstest/yamlSpecTranslator.test.tsschemas/agent-test-run__eval.jsonoutputsfieldTest plan
yarn buildsucceedsyarn test:only— 214/214 passing (6 new tests)test:json-schemapasses with regenerated schemacontextVariables→ confirmcontext_variablesin payload--jsonoutput includesoutputs[]per test