Skip to content

feat(metadata-instance-editor): support for cascade extraction#4613

Open
alexkirillovtech wants to merge 7 commits into
masterfrom
MDX-2041-cascade-extract-support-metadata-instance
Open

feat(metadata-instance-editor): support for cascade extraction#4613
alexkirillovtech wants to merge 7 commits into
masterfrom
MDX-2041-cascade-extract-support-metadata-instance

Conversation

@alexkirillovtech
Copy link
Copy Markdown

@alexkirillovtech alexkirillovtech commented Jun 8, 2026

JIRA ticket link

https://jira.inside-box.net/browse/MDX-2041

Description

Product scope

When a metadata instance on a folder is managed by a Box AI extract agent (i.e. its cascadePolicy.cascadePolicyType === ai_extract), the values for that instance are populated and kept in sync by the agent. Editing those values inline in the metadata sidebar would put the form's local state out of sync with what the agent will produce on the next cascade run, so this PR removes the inline-edit affordance for those instances and points users to the right place to make changes — the agent itself.

Resulting UX for an extract-managed instance:

  • Collapsed / view mode — the fields are rendered read-only (no remove icons, no inputs), with a short informational notice at the top: "Metadata cascade policy is enabled for this instance".
  • Edit mode — instead of the form, we render a Blueprint ActionableInlineNotice (lock icon) titled "Managed by a Box AI extract agent" with body copy explaining that the instance can't be edited here, plus a primary "Manage agent" button. Clicking it invokes a new onManageExtractAgent(agentId) callback, where the numeric agent id is extracted from the cascade policy's agent configuration value (e.g. extract_agent_1463732771314637327713). The host app (EUA) wires this up to navigate to the agent management surface.

For all non-extract-managed instances the existing behavior is preserved exactly — same form, same cascade-policy controls, same save/remove footer, same confirm-remove dialog.

Selected approach

Instance.js had grown into a ~700-line class component that owned both the editor state machine and the entire view tree (collapsible chrome, cascade policy, form, footer, confirm dialog). Rather than add a third rendering branch into that file, this PR splits the presentational layer into three focused components and keeps Instance as the stateful orchestrator:

New file Responsibility
InstanceCard.js Collapsible card chrome only — icon, title, error mark, header action slot. No knowledge of editing or agents.
EditableInstanceBody.js The existing editable form: CascadePolicy + TemplatedInstance/CustomInstance + Footer + confirm-remove dialog. Pure presentational — every handler and flag is passed in as a prop.
ExtractManagedInstanceBody.js New body used when cascadePolicyType === ai_extract. Renders the read-only view when collapsed and the ActionableInlineNotice + "Manage agent" button when editing.

Instance.js now:

  • keeps all the state (isEditing, isCascadingEnabled, cascadePolicyConfiguration, etc.) and all the change handlers (onSave, onFieldChange, onCascadeToggle, onAIAgentSelect, …) — unchanged behavior;
  • decides which body to render via a single check (isExtractManaged = cascadePolicy?.cascadePolicyType === CASCADE_POLICY_TYPE_AI_EXTRACT);
  • delegates the chrome to InstanceCard and the body to one of the two new components.

The new onManageExtractAgent callback is added as an optional prop and threaded MetadataInstanceEditor → Instances → Instance → ExtractManagedInstanceBody. When it's not provided (or no agentId is on the cascade policy), the "Manage agent" button is simply not rendered, so existing consumers are unaffected.

Why this split rather than inlining the new branch in Instance:

  • Instance no longer mixes "what to show when" with "how to lay out a card / form / notice"; each new file is small, props-only, and unit-testable in isolation (see the new test files).
  • The notice-vs-form choice for extract-managed instances lives in one place (ExtractManagedInstanceBody), which makes future tweaks to that UX — copy, additional CTAs, telemetry tags — a single-file change.
  • The new components are pure (no connect, no lifecycle), so they avoid the snapshot churn that touching Instance itself causes; the bulk of the snapshot diff in this PR comes from Instance.test.js re-rendering through the new component tree rather than from semantic changes.

What's included

Source

  • Instance.js — refactor: extract chrome + body, add isExtractManaged branch, accept new onManageExtractAgent prop.
  • InstanceCard.js — new presentational card.
  • EditableInstanceBody.js — new presentational editable body.
  • ExtractManagedInstanceBody.js + .scss — new presentational managed body.
  • Instances.js, MetadataInstanceEditor.js — forward the new optional onManageExtractAgent prop.
  • messages.js — 4 new i18n strings (extractManagedTitle, extractManagedDescription, extractManagedManageAgent, extractManagedNoticeIconAriaLabel).
  • i18n/en-US.properties — generated.

Tests

  • New: EditableInstanceBody.test.js, ExtractManagedInstanceBody.test.js, InstanceCard.test.js, plus a shared __fixtures__/metadataInstances.js.
  • Updated: Instance.test.js, Instances.test.js, MetadataInstanceEditor.test.js to cover the new prop pass-through and the extract-managed branching (view + edit).
  • Updated: Instance.test.js.snap — large diff, but purely structural (rendering goes through InstanceCard / EditableInstanceBody wrappers now).

All 650 tests pass; coverage on the touched module is 100% statements / ~85% branches for the new files.

How to test

  • Setup: you need box-ui-elements and enduserapp (take this brunch https://git.dev.box.net/Box/EndUserApp/pull/16762)
  • Run box-ui-elements with yarn start:npm and enduserapp with yarn start:local:linked / or yarn start:linked, whatever you prefer more
  • You need a test account with Extract enabled (contact @akirylau if you need help in setup), metadata template created in Admin Console and one test folder
  • Go to Automate -> Extract -> Create custom agent -> Select template -> Click select source folder -> select a test folder
  • Now go to files -> However over test folder and the end of row click "..." button -> metadata
  • In metadata instance modal confirm that template instance exist
  • Expand it and click pencil icon
  • Confirm that there are no more fields or cascade setup, but the new banner exists and navigate to custom agent works
  • Also confirm that navigation is protected with unsaved changes banner, by adding new template to folder or editing existing instance of non agent template and click navigate -> modal should appear protecting for unsaved changes

Screenshots

image

Semantic release type

PR title: feat(metadata-instance-editor): support cascade extraction (MDX-2041)

  • feat — New feature (extract-agent-managed metadata instances)

Summary by CodeRabbit

  • New Features

    • Add AI extract agent management UI with a "Manage agent" action and informational managed-by notice
    • Add editable instance body with cascade, extraction, and field edit controls
  • Refactor

    • Move instance UI to a card-based layout and split editable vs extract-managed bodies for clearer composition
  • Tests

    • Add extensive tests and fixtures covering editable, extract-managed, and agent-management flows

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 8, 2026

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 38ecafe6-5793-469a-9b05-4ee86c94af25

📥 Commits

Reviewing files that changed from the base of the PR and between 2e4108e and 4dcac64.

📒 Files selected for processing (1)
  • src/features/metadata-instance-editor/metadataUtil.js
 ________________________________________________________________________________________________
< Your code and I have a love-hate relationship. I love finding bugs, you hate that I find them. >
 ------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

Walkthrough

This PR refactors the metadata instance editor to separate extract-managed and standard-editable rendering paths. It introduces CustomExtractAgentInstanceBody for AI extract–managed instances, EditableInstanceBody for standard editing, and InstanceCard as a collapsible container. The Instance component routes between these two bodies based on cascade policy type, and threads an onManageExtractAgent callback through the component tree to enable agent management.

Changes

Metadata instance editor — extract-managed and delegated bodies

Layer / File(s) Summary
Custom extract agent utilities
src/features/metadata-instance-editor/constants.js, src/features/metadata-instance-editor/metadataUtil.js, src/features/metadata-instance-editor/__tests__/metadataUtil.test.js
Added CUSTOM_EXTRACT_AGENT_CONFIGURATION_PREFIX constant, getCustomExtractAgentId() to parse numeric agent id from configuration string, and isCustomExtractAgentPolicy() to detect ai_extract policies with custom agent configuration. Includes parameterized tests covering null/undefined/malformed inputs and policy shape variations.
CustomExtractAgentInstanceBody component
src/features/metadata-instance-editor/CustomExtractAgentInstanceBody.js, src/features/metadata-instance-editor/CustomExtractAgentInstanceBody.scss, src/features/metadata-instance-editor/messages.js, src/features/metadata-instance-editor/__tests__/CustomExtractAgentInstanceBody.test.js
Presentational component rendering read-only instances managed by custom Box AI extract agents. In edit mode, shows locked ActionableInlineNotice with optional "Manage agent" button (conditionally rendered if agent id resolves and callback is provided); in collapsed mode, renders non-editable CustomInstance or TemplatedInstance with cascade policy notice. Includes SCSS padding rule, i18n notice strings (title, description, button label, aria-label), and comprehensive unit tests for both rendering modes and action button visibility.
EditableInstanceBody component
src/features/metadata-instance-editor/EditableInstanceBody.js, src/features/metadata-instance-editor/__tests__/EditableInstanceBody.test.js
Delegated editable form body accepting 27 props for cascade/extraction state, edit flags, errors, and callbacks. Renders remove-confirmation dialog when appropriate, optional CascadePolicy control, CustomInstance or TemplatedInstance based on template type, and Footer gated by isEditing. Unit tests verify conditional rendering, footer interactions, disabled-state propagation, and submit behavior based on isDirty flag.
InstanceCard container
src/features/metadata-instance-editor/InstanceCard.js, src/features/metadata-instance-editor/__tests__/InstanceCard.test.js
Collapsible card wrapper computing icon type (cascade vs default) from applicability and policy id, determining template type, showing error indicator, calculating animation duration from field count, and forwarding children/header actions. Unit tests assert icon selection logic, error-state indicator presence, title rendering (user template vs properties), and content forwarding.
Instance routing logic
src/features/metadata-instance-editor/Instance.js, src/features/metadata-instance-editor/__tests__/Instance.test.js
Refactored render() to use InstanceCard container and conditionally route to CustomExtractAgentInstanceBody (when policy is ai_extract with custom agent, receiving agentConfiguration and onManageExtractAgent callback) or EditableInstanceBody (standard editable path). Removes prior Collapsible/Form/CascadePolicy/Instance subtree. Adds onManageExtractAgent prop and isCustomExtractAgentPolicy import. Updated tests verify managed-notice rendering, absence of editable fields when managed, Manage action callback invocation with numeric agent id, and conditional button visibility.
Prop threading and integration
src/features/metadata-instance-editor/MetadataInstanceEditor.js, src/features/metadata-instance-editor/Instances.js, src/features/metadata-instance-editor/__tests__/__fixtures__/metadataInstances.js, src/features/metadata-instance-editor/__tests__/Instances.test.js, src/features/metadata-instance-editor/__tests__/MetadataInstanceEditor.test.js
Threads onManageExtractAgent callback through MetadataInstanceEditorInstancesInstance component tree. Adds comprehensive test fixtures (makeField, makeTemplate, makeAiExtractCascadePolicy, makeInstance, makeEditor, makeAiExtractEditor, etc.) and updates integration tests to use fixtures and validate extract-managed routing, managed-notice presence, Manage button visibility, callback invocation with numeric agent id, and agent-selector initialization flow.

Sequence Diagram(s)

sequenceDiagram
  participant Parent as Parent Component
  participant MetadataInstanceEditor
  participant Instances
  participant Instance
  participant InstanceCard
  participant CustomExtractAgentInstanceBody
  participant EditableInstanceBody

  Parent->>MetadataInstanceEditor: onManageExtractAgent callback
  MetadataInstanceEditor->>Instances: pass onManageExtractAgent
  Instances->>Instance: pass onManageExtractAgent
  
  Instance->>Instance: detect cascadePolicy type
  alt ai_extract with custom agent
    Instance->>InstanceCard: render card
    InstanceCard->>CustomExtractAgentInstanceBody: render managed body
    CustomExtractAgentInstanceBody->>CustomExtractAgentInstanceBody: edit mode?
    alt isEditing and can manage
      CustomExtractAgentInstanceBody->>Parent: onManageExtractAgent(numericAgentId)
    else collapsed
      CustomExtractAgentInstanceBody->>CustomExtractAgentInstanceBody: show read-only fields
    end
  else standard or enhanced policy
    Instance->>InstanceCard: render card
    InstanceCard->>EditableInstanceBody: render editable body
    EditableInstanceBody->>EditableInstanceBody: render form controls
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • box/box-ui-elements#4197: Concurrent changes to metadata-instance-editor AI agent selection and cascade-policy wiring for enhanced vs custom extract-agent flows.
  • box/box-ui-elements#4175: Related cascade-policy editing and isExistingCascadePolicy flag propagation through Instance and CascadePolicy components.
  • box/box-ui-elements#4102: Concurrent metadata editor ai_extract routing and AI folder extraction state/props for disabling templated fields.

Suggested labels

ready-to-merge

Suggested reviewers

  • tjuanitas
  • jmcbgaston
  • jfox-box

Poem

🐰 Metadata cards now split their souls,
Managed agents lock read-only roles,
EditableBody takes the standard dance,
While Manage buttons get their chance,
Fixtures built to test each way—
Extract-managed extraction day! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(metadata-instance-editor): support for cascade extraction' accurately describes the main change: adding support for metadata instances managed by Box AI extract agents.
Description check ✅ Passed The PR description is comprehensive and well-structured, including JIRA link, detailed product scope, implementation approach, included files/tests, testing instructions, and semantic release type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch MDX-2041-cascade-extract-support-metadata-instance

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.4.16)
src/features/metadata-instance-editor/metadataUtil.js

File contains syntax errors that prevent linting: Line 2: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 5: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 5: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 27: optional parameters are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 27: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 27: expected , but instead found ?; Line 27: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 52: optional parameters are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 52: Type annotations are a TypeScript only feature. Con

... [truncated 352 characters] ...

only feature. Convert your file to a TypeScript file or remove the syntax.; Line 78: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 79: optional parameters are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 79: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 80: optional parameters are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 80: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 81: return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alexkirillovtech alexkirillovtech marked this pull request as ready for review June 8, 2026 11:38
@alexkirillovtech alexkirillovtech requested review from a team as code owners June 8, 2026 11:38
@alexkirillovtech alexkirillovtech changed the title feat(metadata-instance-editor) support cascade extraction via custom agent (MDX-2041) feat(metadata-instance-editor) support cascade extraction via custom agent Jun 8, 2026
@alexkirillovtech alexkirillovtech changed the title feat(metadata-instance-editor) support cascade extraction via custom agent feat(metadata-instance-editor): support for cascade extraction Jun 8, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/features/metadata-instance-editor/ExtractManagedInstanceBody.js`:
- Line 27: The button still renders and calls the manage callback when
getNumericAgentId(agentId) returns an empty string; update the render and
click-path to guard on the parsed numeric id (use getNumericAgentId) instead of
the raw agentId: only render the "Manage agent" button when parsedId is
non-empty and ensure the onClick handler passes parsedId (or early-returns if
parsedId is falsy) so the callback is never invoked with ''. Locate uses of
getNumericAgentId and the Manage button/callback in ExtractManagedInstanceBody
(and the click handler around the "Manage agent" action) and replace checks to
gate on the parsed numeric id.
- Around line 44-45: Replace the hardcoded iconAriaLabel="lockicon" in the
ExtractManagedInstanceBody component with the localized message you already
added: call formatMessage(messages.extractManagedNoticeIconAriaLabel) (i.e., set
iconAriaLabel={formatMessage(messages.extractManagedNoticeIconAriaLabel)}), so
the aria label uses the localizable extractManagedNoticeIconAriaLabel string
instead of the literal "lockicon".
- Line 6: Add a Flow suppression comment above the Lock import in
ExtractManagedInstanceBody.js: place "// $FlowFixMe - blueprint-web-assets icons
not typed for Flow" immediately above the existing "import { Lock } from
'`@box/blueprint-web-assets/icons/Line`';" to match the pattern used in
Classification.js; replace the hardcoded iconAriaLabel="lockicon" with a
localized string pulled from react-intl/messages (import the message and use
intl.formatMessage or the <FormattedMessage> equivalent) so the aria label is
localized; and when rendering PrimaryAction, wrap the call to
onManageExtractAgent(...) with a guard that verifies getNumericAgentId(agentId)
returns a non-empty/truthy value before invoking it (use
getNumericAgentId(agentId) in the condition to prevent calling
onManageExtractAgent with an empty id).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d7970ad-21f6-43f9-8c83-d2e39c56b2d0

📥 Commits

Reviewing files that changed from the base of the PR and between 916a2db and 8baf71b.

⛔ Files ignored due to path filters (2)
  • i18n/en-US.properties is excluded by !i18n/**
  • src/features/metadata-instance-editor/__tests__/__snapshots__/Instance.test.js.snap is excluded by !**/*.snap
📒 Files selected for processing (15)
  • src/features/metadata-instance-editor/EditableInstanceBody.js
  • src/features/metadata-instance-editor/ExtractManagedInstanceBody.js
  • src/features/metadata-instance-editor/ExtractManagedInstanceBody.scss
  • src/features/metadata-instance-editor/Instance.js
  • src/features/metadata-instance-editor/InstanceCard.js
  • src/features/metadata-instance-editor/Instances.js
  • src/features/metadata-instance-editor/MetadataInstanceEditor.js
  • src/features/metadata-instance-editor/__tests__/EditableInstanceBody.test.js
  • src/features/metadata-instance-editor/__tests__/ExtractManagedInstanceBody.test.js
  • src/features/metadata-instance-editor/__tests__/Instance.test.js
  • src/features/metadata-instance-editor/__tests__/InstanceCard.test.js
  • src/features/metadata-instance-editor/__tests__/Instances.test.js
  • src/features/metadata-instance-editor/__tests__/MetadataInstanceEditor.test.js
  • src/features/metadata-instance-editor/__tests__/__fixtures__/metadataInstances.js
  • src/features/metadata-instance-editor/messages.js

Comment thread src/features/metadata-instance-editor/ExtractManagedInstanceBody.js Outdated
Comment thread src/features/metadata-instance-editor/ExtractManagedInstanceBody.js Outdated
Comment thread src/features/metadata-instance-editor/ExtractManagedInstanceBody.js Outdated
*/
const ExtractManagedInstanceBody = ({ agentId, data, isEditing, onManageExtractAgent, template }: Props) => {
const { formatMessage } = useIntl();
const isProperties = template.templateKey === TEMPLATE_CUSTOM_PROPERTIES;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const isProperties = template.templateKey === TEMPLATE_CUSTOM_PROPERTIES;
const isCustomProperties = template.templateKey === TEMPLATE_CUSTOM_PROPERTIES;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it may seem like a new code, but it's actually an old code, that is consistent across multiple files and the value of constant is actually properties. I know it's not ideal, but I would like to keep extra changes at minimum
const TEMPLATE_CUSTOM_PROPERTIES: 'properties' = 'properties';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

.metadata-instance-editor-extract-managed {
padding: 8px;

.metadata-instance-editor-extract-managed-actions {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does this CSS selector stand for? Is this overwriting a style from the Blueprint?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

text={formatMessage(messages.extractManagedDescription)}
title={formatMessage(messages.extractManagedTitle)}
>
<>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: redundant fragment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

* Extracts the numeric agent id from a prefixed configuration value.
* e.g. "extract_agent_14637327713" -> "14637327713"
*/
const getNumericAgentId = (agentId?: string): string => (agentId ? agentId.replace(/\D/g, '') : '');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey, I noticed that the agent value doesn't always follow the extract_agent_ format. In the same module, there is a second type of agent - enhanced - defined as enhanced_extract_agent (https://github.com/box/box-ui-elements/blob/master/src/features/metadata-instance-editor/constants.js#L5).

Furthermore, Instance.js actually saves this value as agent https://github.com/box/box-ui-elements/blob/master/src/features/metadata-instance-editor/Instance.js#L364.

Note that enhanced_extract_agent does not contain any digits.
So, for an instance managed by an enhanced agent:

getNumericAgentId('enhanced_extract_agent')
// 'enhanced_extract_agent'.replace(/\D/g, '')  →  ''  (empty string)

User impact: the instance with the enhanced agent displays the note "Managed by a Box AI extract agent", but provides no way to navigate to agent management - resulting in a dead end.

Is this really how it's supposed to work?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you for a great Marcin! You actually surfaced a major problem in the way how we identified a custom extract agent managed instance.

My initial understanding what that type const CASCADE_POLICY_TYPE_AI_EXTRACT = 'ai_extract'; is enough to tell that it's create by extract custom agent. What was a big mistake!

Turned out if I enable Box AI on a regular cascade policy via metadata folder it will become ai_extract type. The same as when it's created by extract custom agent it's also ai_extract. So to say that it's for sure custom extract agent we need to make sure that we check for a suffix const CUSTOM_EXTRACT_AGENT_CONFIGURATION_PREFIX = 'extract_agent_';

Unfortunately it's the only way how differentiate them. I brought my concern to a platform team https://box.slack.com/archives/C03ET4QCU7P/p1780928270883609. However, it seems that this prefix is stable enough of now (check thread I attached there)

So to address this problem I made two type of changes:

  1. Re-work of differentiator logic - feat(metadata-instance-editor): fix custom extract agent logic (MDX-2…
  2. Re-work of naming system to make sure we do not mess with "extract" (cascade policy with AI) and "custom extract agent" (automate) feat(metadata-instance-editor): work on clarity of custom agent separ…

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants