Skip to content

chore(DATAGO-123922): Add artifact tags for internal and user-uploaded files #951

Open
efunneko wants to merge 10 commits intomainfrom
ed/artifact-tags
Open

chore(DATAGO-123922): Add artifact tags for internal and user-uploaded files #951
efunneko wants to merge 10 commits intomainfrom
ed/artifact-tags

Conversation

@efunneko
Copy link
Collaborator

@efunneko efunneko commented Feb 2, 2026

What is the purpose of this change?

Add a tagging system to artifact metadata that allows labeling artifacts with arbitrary tags. The primary use case is reserving the __internal tag to mark artifacts that should be hidden from users by default (e.g., intermediate files from workflows or structured invocations), with a UI toggle to show them when needed.

How was this change implemented?

Backend changes:

  • Added tags field to ArtifactInfo type and data models (types.py, data_parts.py)
  • Modified save_artifact_with_metadata() to accept and store tags in metadata JSON
  • Modified get_artifact_info_list() to extract and return tags from metadata
  • Auto-tag user uploads with __user_uploaded via process_artifact_upload()
  • Auto-tag artifacts from structured invocations and workflows with __internal via callbacks, proxies, and workflow components
  • Added tag parsing from fenced block params in callbacks.py

Frontend changes:

  • Added tags field to ArtifactInfo interface
  • Added useArtifacts hook enhancements: showInternalArtifacts toggle with localStorage persistence, filtering logic, internalArtifactCount
  • Added "Show/Hide Internal Files" toggle in ArtifactMorePopover
  • Updated ArtifactPanel to show count of hidden internal files when toggle is off

Key Design Decisions

  • System tags use __ prefix (e.g., __internal, __user_uploaded) to distinguish from user tags
  • Tags stored in .metadata.json files alongside artifacts for backward compatibility
  • Internal artifacts hidden by default but accessible via toggle (not deleted)
  • Case-insensitive tag matching for robustness

How was this change tested?

  • Manual testing: Verified internal files are hidden by default, toggle shows/hides them, user uploads get __user_uploaded tag
  • Integration tests: Added TestArtifactTagging class in test_artifact_services.py with 5 tests covering tag storage, retrieval, and backward compatibility
  • Known limitations: Frontend filtering tests not included (would require E2E testing infrastructure)

Is there anything the reviewers should focus on/be aware of?

  • The __internal tag is auto-applied in multiple locations (callbacks, proxies, workflow components) - verify all paths are covered
  • Backward compatibility: Old artifacts without tags should display normally (tested in test_artifact_without_tags)
  • The toggle state is persisted in localStorage (sam_show_internal_artifacts)

@efunneko efunneko changed the title chore(DATAGO-123922): Add artifact tags for internal and user-uploaded files chore(DATAGO-123922): Add artifact tags for internal and user-uploaded files Feb 2, 2026
Reverts refactoring changes (isDeleted -> isDisabled rename and version
display) that are not related to the artifact tagging feature.
- Add fallback to artifacts array when allArtifacts is undefined
- Update Storybook story to include allArtifacts mock
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

WhiteSource Policy Violation Summary

✅︎ No Blocking Whitesource Policy Violations found in solaceai/solace-agent-mesh-ui-pr-951!

Add showInternalArtifacts, allArtifacts, toggleShowInternalArtifacts,
and internalArtifactCount to fix TypeScript build errors.
artifactsRefetch();
},
icon: <RefreshCcw />,
const menuActions: MenuAction[] = [];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added hidden concept within artifact file list:

Image

and

Image

@efunneko efunneko requested a review from amir-ghasemi February 3, 2026 12:50
log_identifier=f"{log_identifier}[ResolveChunk]",
)
# Extract tags from params (comma-separated string to list)
tags_str = params.get("tags", "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

the logic to parse tags from the parameters string is duplicated. Perhaps extract it to a helper function?

log_identifier,
params["schema_max_keys"],
)
# Extract tags from params (comma-separated string to list)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above.

ProxyTaskContext doesn't have get_flag method. Proxy artifacts from
external A2A agents shouldn't be tagged as internal anyway.
Address PR review comment - the tag parsing logic was duplicated.
Added _parse_tags_param() helper function for cleaner code.
Covers all edge cases: None, empty string, single tag, multiple tags,
whitespace trimming, empty tags filtering, and mixed inputs.
Feedback from PR review suggested "working" is more intuitive for users
than "internal" when describing behind-the-scenes intermediate files.

Changes:
- ARTIFACT_TAG_INTERNAL -> ARTIFACT_TAG_WORKING
- __internal -> __working (tag value)
- UI text: "internal files" -> "working files"
- Variable/function names updated throughout
@sonarqube-solacecloud
Copy link

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.

2 participants