GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add AgentforceScorer function feature by eyudashkin-cpu · Pull Request #165 · forcedotcom/datacloud-customcode-python-sdk

Conversation

@eyudashkin-cpu

@eyudashkin-cpu eyudashkin-cpu commented Nov 4, 2026

Copy link
Copy Markdown

Draft. Do not merge or release yet. The deploy part only works once the Data Cloud platform accepts the AgentforceScorer invoke option and its feature gate is open. Until then, a deploy would be rejected. The types, template and local run work today. This PR is open now so the request/response contract can be reviewed early.

Summary

Adds AgentforceScorer, a new function feature for scoring a single Agentforce session. The scorer receives the session tracing detail view and returns open-ended scorer outputs.

datacustomcode init my_scorer --code-type function --use-in-feature AgentforceScorer
datacustomcode run my_scorer/payload/entrypoint.py --test-with my_scorer/payload/tests/test.json

Changes

  • Types: new function/feature_types/agentforce_scorer.py with AgentforceScorerV1Request / AgentforceScorerV1Response, following the chunking.py conventions (V1 names, Field(description=...), extra="ignore").
    • Request: python_scorer_input: AgentforceScorerV1SessionTracingDetailView, made up of sessionState, actors, metrics and runs. Each run has messages and an agentLoop.steps.
    • Response: outputs: List[AgentforceScorerV1Output], where each output has label, value and is_passed.
    • Field names stay in the wire format (camelCase). The free-text fields (message, step input/output/attributes) are capped at 100,000 characters.
  • Template: new templates/function/agentforce_scorer/ with a typed entrypoint.py, config.json and requirements.txt. test.json is generated from the request model.
  • constants.py: registers the template folder and maps both type names to AgentforceScorer for deploy-time inference. Also adds FUNCTION_INVOKE_OPTIONS_FEATURES and FUNCTION_USE_IN_FEATURE_DEFAULT.
  • init: unknown function features are now rejected. Before, a typo silently produced the chunking template.
  • deploy: AgentforceScorer is sent as invokeOptions: ["AgentforceScorer"], which routes to the v67.0 endpoint. The legacy functionInvokeOptions field only accepts UnstructuredChunking. SearchIndexChunking behaves as before.

Testing

  • New tests/test_agentforce_scorer.py (8 tests) covers:
    • parsing, defaults and serialization of the types
    • init scaffolding, test.json generation and feature inference
    • rejection of unknown features
    • running the template entrypoint
    • both deploy routes: invokeOptions for the scorer, functionInvokeOptions for chunking
  • Full suite on Python 3.11: 707 passed.
  • black and isort are clean on the changed files.
  • Manual check: init → run --test-with returns {"outputs": [{"label": "user_turns", "value": "1", "is_passed": true}]}.
  • Not tested: a real deploy against an org, which is blocked as described in the note above.

W-24740772

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@salesforce-cla salesforce-cla Bot added the cla:missing label Nov 4, 2026
@salesforce-cla

salesforce-cla Bot commented Nov 4, 2026

Copy link
Copy Markdown

Thanks for the contribution! It looks like @eyudashkin-cpu is an internal user so signing the CLA is not required. However, we need to confirm this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eyudashkin-cpu
eyudashkin-cpu force-pushed the feat/agentforce-scorer-w-24740772 branch from d34872b to 9751bdb Compare November 4, 2026 10:44
@eyudashkin-cpu

eyudashkin-cpu commented Nov 4, 2026

Copy link
Copy Markdown
Author

@salesforce-cla recheck

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eyudashkin-cpu @claude
Add AgentforceScorer function feature
eddbf8a
Add AgentforceScorerV1Request/AgentforceScorerV1Response Pydantic types for
scoring an Agentforce session (session tracing detail view in, open-ended
scorer outputs out), and an agentforce_scorer function template, so
`datacustomcode init --code-type function --use-in-feature AgentforceScorer`
scaffolds a typed scorer entrypoint with a generated test.json.

init now rejects unknown function features instead of silently falling back
to the chunking template. deploy infers AgentforceScorer from the entrypoint
types and sends it via invokeOptions (v67.0), since the legacy
functionInvokeOptions field only accepts UnstructuredChunking.

W-24740772

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@eyudashkin-cpu
eyudashkin-cpu force-pushed the feat/agentforce-scorer-w-24740772 branch from 9751bdb to eddbf8a Compare November 4, 2026 10:47
@salesforce-cla salesforce-cla Bot added cla:signed and removed cla:missing labels Nov 4, 2026
@eyudashkin-cpu @claude
Rename AgentforceScorerV1Output.is_passed to isPassed
e921a21
Matches the camelCase wire format used by the other scorer fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla:signed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@eyudashkin-cpu
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.