Skip to content

fix(console): route Agent source uploads and isolate Profile files - #7351

Open
x1n95c wants to merge 3 commits into
agentscope-ai:mainfrom
x1n95c:fix/profile-source-filter
Open

fix(console): route Agent source uploads and isolate Profile files#7351
x1n95c wants to merge 3 commits into
agentscope-ai:mainfrom
x1n95c:fix/profile-source-filter

Conversation

@x1n95c

@x1n95c x1n95c commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes the Files workspace source navigation and upload routing for Agent configuration directories and project directories.

Previously, selecting Profile, Daily, or Knowledge Base and uploading a file could place it at the workspace root, and the Profile source could display configuration subdirectories such as memory/ and digest/. Switching project directories could also leave the source panes showing stale Agent-directory content.

This change makes each source map to its intended directory, keeps Agent configuration sources separate from project sources, and makes the UI communicate which files the Agent can normally read.

What changes

  • Profile source: in the Agent configuration directory, Profile now lists only files directly under the configuration root. Subdirectories are excluded; memory/ and digest/ are shown only in Daily and Knowledge Base respectively. Enabled system-prompt files retain their ordering and toggles.
  • Daily and Knowledge Base sources: Agent scope reads from the configured memory/ and digest/ directories. Project scope reads from project-local source directories and creates the selected directory on first upload.
  • Upload routing: uploads from non-Workspace sources are sent to the selected source directory. Agent-source uploads are rooted at the Agent workspace even when a project root is selected. The upload API now supports an explicit create_directory option.
  • Project root presentation: project roots hide the reserved Agent source folders from the Workspace root view, while Agent source tabs remain available only for the Agent configuration directory.
  • File display: Agent source directories can show files of any format. Non-Markdown files are rendered in a disabled/greyed visual style with an explanation that the Agent normally reads Markdown (.md) files.
  • Memory tree and file actions: Daily and Knowledge Base entries use the standard directory tree, preserve memory-graph actions where applicable, and open files through the workspace file API.
  • Localization: the new source notices and related labels are included in zh, en, id, ja, pt-BR, ru, and vi.

Related Issue: Relates to #7322

Security Considerations:

  • Upload paths continue to be resolved by the existing workspace/project-root authorization logic.
  • Source-specific upload paths are selected by the active source and root; the frontend cannot make an Agent source write into an arbitrary directory.
  • Creating a project source directory occurs only as part of an upload request and does not broaden file read permissions.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Core / Backend (app, agents, config, providers, utils, local_models)
  • Console (frontend web UI)
  • Channels (DingTalk, Lark, QQ, Discord, iMessage, etc.)
  • Skills
  • CLI
  • Documentation (website)
  • Tests
  • CI/CD
  • Scripts / Deploy

Checklist

  • I ran pre-commit run --all-files locally and every hook passes.
  • If pre-commit auto-fixed files, I committed those changes and reran checks
  • I ran focused tests locally and they pass
  • Documentation updated (if needed)
  • Ready for review

For Channel Changes (DingTalk, Lark, QQ, Console, etc.)

The Console changes are limited to the Files workspace UI and its workspace API client; no channel implementation is touched.

  • I ran ./scripts/check-channels.sh (or ./scripts/check-channels.sh --changed) and it passes
  • Contract test exists in tests/contract/channels/test_<channel>_contract.py (REQUIRED)
  • Contract test implements create_instance() with proper channel initialization
  • All 19 contract verification points pass (see tests/contract/channels/__init__.py)
  • Optional: Unit tests in tests/unit/channels/test_<channel>.py for complex internal logic

Testing

Focused automated checks

Frontend interaction tests:
  5 passed

Backend workspace file router tests:
  14 passed

TypeScript build check:
  npx tsc -b --noEmit     passed

ESLint:
  npx eslint src/features/files-workspace/FilesNavigator.tsx     passed

Formatting and whitespace:
  prettier on changed interaction test     passed
  git diff --check                         passed

The full frontend and backend test suites, and pre-commit run --all-files, were not run for this change.

Evidence

Profile source isolation

The Profile loader now filters the Agent workspace root listing to entry.kind === "file". A configuration entry such as memory/ is therefore not rendered in Profile, while files under memory/ and digest/ are loaded by their dedicated source tabs.

Upload routing

For Agent scope, Daily uploads use root=workspace and path=memory; Knowledge Base uploads use root=workspace and path=digest; Profile uploads use the configuration root. For project scope, the corresponding source directory is created on first upload and receives the file.

Regression test output

RUN  v4.1.10

Test Files  1 passed (1)
Tests       5 passed (5)
14 passed in 2.85s

The frontend test runner reports a jsdom getComputedStyle pseudo-element warning from the test environment; it does not affect the passing assertions.

@github-actions

Copy link
Copy Markdown

Welcome to QwenPaw! 🐾

Hi @x1n95c, this is your 29th Pull Request.

🙌 Join Developer Community

Thanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page:
https://qwenpaw.agentscope.io/docs/community

We truly appreciate your enthusiasm—and look forward to your future contributions! 😊

We'll review your PR soon.

@x1n95c
x1n95c requested a deployment to ai-review-approved August 28, 2026 06:20 — with GitHub Actions Waiting
@x1n95c
x1n95c requested a deployment to maintainer-approved August 28, 2026 06:20 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant