Skip to content

fix(file-surfer): preserve base path in components - #8100

Open
YZJF,YCDG,DJLY,ZZZB (YZJF) wants to merge 1 commit into
microsoft:mainfrom
YZJF:fix-file-surfer-serialization-base-path
Open

fix(file-surfer): preserve base path in components#8100
YZJF,YCDG,DJLY,ZZZB (YZJF) wants to merge 1 commit into
microsoft:mainfrom
YZJF:fix-file-surfer-serialization-base-path

Conversation

@YZJF

Copy link
Copy Markdown

Why are these changes needed?

FileSurfer accepts an explicit base_path, but its component configuration did not store that value. Reconstructing a serialized component therefore created a browser rooted at the process default instead of its originally configured directory. This loses the caller's intended filesystem scope in persisted teams and Studio configurations.

This change persists the browser's resolved base path in FileSurferConfig and restores it when loading the component. Configurations written before this field existed continue to use the legacy constructor behavior.

Related issue number

None.

Checks

  • No documentation change is needed: the existing public base_path documentation remains accurate.
  • Added regression coverage for an explicit base path and legacy configuration loading.
  • uv run --directory python --no-sync pytest packages/autogen-ext/tests/test_filesurfer_agent.py -vv
  • uv run --directory python --no-sync ruff check packages/autogen-ext/src/autogen_ext/agents/file_surfer/_file_surfer.py packages/autogen-ext/tests/test_filesurfer_agent.py
  • uv run --directory python --no-sync ruff format --check packages/autogen-ext/src/autogen_ext/agents/file_surfer/_file_surfer.py packages/autogen-ext/tests/test_filesurfer_agent.py
  • uv run --directory python --no-sync pyright packages/autogen-ext/src/autogen_ext/agents/file_surfer/_file_surfer.py packages/autogen-ext/tests/test_filesurfer_agent.py

AI assistance

AI assistance was used to investigate, draft, and test this change. The regression was reproduced before the implementation: serializing a FileSurfer with an explicit temporary directory reloaded it with the process working directory instead.

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.

1 participant