Skip to content

[OPIK-5682] [FE] Wire agent config to sandbox run via mask_id#6082

Merged
miguelgrc merged 4 commits intomainfrom
miguelg/OPIK-5682-agent-sandbox-e2e-journey
Apr 7, 2026
Merged

[OPIK-5682] [FE] Wire agent config to sandbox run via mask_id#6082
miguelgrc merged 4 commits intomainfrom
miguelg/OPIK-5682-agent-sandbox-e2e-journey

Conversation

@miguelgrc
Copy link
Copy Markdown
Contributor

Details

Wire up agent configuration changes to the sandbox Run flow using the mask_id mechanism.

Previously, clicking Run in the Agent Sandbox ignored any configuration edits — the job was created without config context. Now, when the user edits configuration values and clicks Run, the system:

  1. Validates all config fields (scalar + prompt)
  2. Saves any dirty prompt versions to get commit IDs
  3. Creates a MASK (temporary config overlay) via PATCH /blueprints/ with type: "mask"
  4. Passes the mask_id to the job creation request

This keeps the version history clean — masks are internal-only and don't appear in the blueprint history. The existing "Save as new version" flow continues to create permanent BLUEPRINTs.

Key changes:

  • useAgentConfigurationSave — extracted shared validation/payload logic into validateAndBuildPayload(), added buildMaskPayload() and hasChanges()
  • AgentConfigurationEditView — converted to forwardRef with imperative handle exposing hasChanges + buildMaskPayload
  • AgentRunnerConnectedStatehandleRun checks for config changes, creates mask if needed, blocks run if validation fails

Data flow: Edit config → click Run → hasChanges()buildMaskPayload() (validates + returns payload) → parent calls mutation → gets mask_id → passes to job creation

Change checklist

  • User facing
  • Documentation update

Issues

  • OPIK-5682

Testing

  • npx tsc --noEmit — passes
  • npx eslint on all changed files — passes
  • Existing tests (4/4) — pass

Manual verification:

  1. Open Agent Sandbox, connect agent
  2. Run without config changes → no mask_id in job payload ✓
  3. Edit config, Run → PATCH creates mask, job includes mask_id
  4. Edit config with invalid values, Run → validation blocks, no requests ✓
  5. "Save as new version" → creates BLUEPRINT, appears in history ✓
  6. Config changes don't pollute version history (masks are invisible) ✓

Documentation

N/A

@miguelgrc miguelgrc requested a review from a team as a code owner April 6, 2026 12:32
@miguelgrc miguelgrc added the test-environment Deploy Opik adhoc environment label Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

🔄 Test environment deployment process has started

Phase 1: Deploying base version 1.10.59-4802 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch miguelg/OPIK-5682-agent-sandbox-e2e-journey
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

@CometActions
Copy link
Copy Markdown
Collaborator

🌙 Nightly cleanup: The test environment for this PR (pr-6082) has been cleaned up to free cluster resources. PVCs are preserved — re-deploy to restore the environment.

@CometActions CometActions removed the test-environment Deploy Opik adhoc environment label Apr 7, 2026
@miguelgrc miguelgrc added the test-environment Deploy Opik adhoc environment label Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🔄 Test environment deployment process has started

Phase 1: Deploying base version 1.10.59-4802 (from main branch) if environment doesn't exist
Phase 2: Building new images from PR branch miguelg/OPIK-5682-agent-sandbox-e2e-journey
Phase 3: Will deploy newly built version after build completes

You can monitor the progress here.

@CometActions
Copy link
Copy Markdown
Collaborator

Test environment is now available!

To configure additional Environment variables for your environment, run [Deploy Opik AdHoc Environment workflow] (https://github.com/comet-ml/comet-deployment/actions/workflows/deploy_opik_adhoc_env.yaml)

Access Information

The deployment has completed successfully and the version has been verified.

aadereiko
aadereiko previously approved these changes Apr 7, 2026
Copy link
Copy Markdown
Collaborator

@aadereiko aadereiko left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

When the user edits configuration in the sandbox and clicks Run,
a MASK is created with the changed values and its ID is passed to
the job request. "Save as new version" continues to create BLUEPRINTs.
The hook at AgentConfigurationPage/AgentConfigurationTab/ was an
unused copy — the shared version at pages-shared/ is the only one
imported by AgentConfigurationEditView.
Show a spinner in the Input tab instead of "No input fields" while
the agent is registering. Disable the Run button until agents are
available.
Ensures the Run button is disabled when connected but agent name is
not yet available, keeping isReady and handleRun guard in sync.
@miguelgrc miguelgrc force-pushed the miguelg/OPIK-5682-agent-sandbox-e2e-journey branch from 73335d6 to 37be29b Compare April 7, 2026 16:12
@miguelgrc miguelgrc merged commit dd612f8 into main Apr 7, 2026
14 checks passed
@miguelgrc miguelgrc deleted the miguelg/OPIK-5682-agent-sandbox-e2e-journey branch April 7, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend test-environment Deploy Opik adhoc environment typescript *.ts *.tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants