Skip to content

fix(feishu): resolve generated files from agent workdir - #839

Open
lexingtonhibiki wants to merge 2 commits into
lsdefine:mainfrom
lexingtonhibiki:fix/feishu-generated-file-paths
Open

lexingtonhibiki wants to merge 2 commits into
lsdefine:mainfrom
lexingtonhibiki:fix/feishu-generated-file-paths

Conversation

@lexingtonhibiki

Copy link
Copy Markdown

Related to #628: this addresses the relative-path case, not every possible cause of the reported missing-file error. Relative [FILE:...] markers are checked against the Feishu process directory even when the agent generated the file under handler.cwd. Resolve them against the current agent workdir first, preserving absolute paths and the existing process-relative fallback.

  • Add 13 offline regressions for nested/Unicode paths, image uploads, same-name collisions, legacy/absolute paths, missing files/directories, and direct, queue and hook completion.
  • Follow the repository's AST contract-test pattern: load the actual production helpers/completion/hook and fake only I/O and task execution.

Validation (Linux x86_64, Python 3.12.14, Node 24.19):

  • python -m pytest frontends/tests/test_fsapp_files.py -q: 13 passed.
  • python -m pytest frontends/tests -q --ignore=frontends/tests/test_release_qualification.py: 252 passed, 1 failed. The failure is test_cost_tracker_ledger.py::test_concurrent_appends_remain_exact_across_compactions (7 != 8), also reproduced independently on unchanged upstream e4e610d. No test was changed or suppressed.
  • python -m pytest frontends/tests/test_release_qualification.py -q: 35 passed (script/unit contracts, not real-machine release acceptance).
  • node frontends/desktop/scripts/verify-compiled-dist.mjs: passed (tracked compiled assets verified, not rebuilt).

AI-assisted implementation and validation. No live Feishu/Lark SDK startup, real upload or model API test; other Python versions, Windows/macOS and Rust/Tauri checks were not run. The fork's final tree was compared byte-for-byte with the locally tested tree before opening this PR.

Resolve relative generated-file markers against the current handler.cwd before the legacy process-relative fallback; preserve absolute paths.

Related to lsdefine#628. AI-assisted implementation; regression coverage follows in the next commit.
Add 13 offline regressions for real fsapp helpers and completion paths, using the repository's AST contract-test pattern and a fake uploader.

Cover workdir-relative, absolute and legacy paths, same-name collisions, missing files/directories, and direct, queue and hook completion. No live Lark/account/model calls. AI-assisted implementation and validation.
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