Skip to content

get_content cannot load files referenced by agent-home-relative paths #446

Description

@andrii-novikov

QuickApps version

latest

What is the problem this feature will solve?

Agent-home-relative paths (e.g. reports/img.png) are the convention the internal_file_* tools speak — their outputs echo workspace files in exactly this form (to_display_path strips the files/{appdata}/{home} prefix). But internal_attachments_get_content rejects such references as unsupported: classify_url knows only DIAL files/... paths, external http(s) URLs, and UNSUPPORTED.

So when the model tries to load a file its own file tools just created or listed, it gets rejected and has to guess the absolute files/... form — which the file tools never display and the model cannot derive (it does not know the appdata/home prefix).

What is the feature you are proposing to solve the problem?

Make the reference round-trip work:

  • add UrlScheme.DIAL_APPDIR_RELATIVE to common/url_classification.py, with a canonical detection predicate (is_appdir_relative) defining the grammar: file form (file.md, dir1/file.md, extension optional) or dir form with trailing slash (some_dir/); no .././empty/trailing-dot segments; DIAL UI forbidden characters (:;,={}%&\" and control chars) rejected; DIAL UI length limits (255 UTF-8 bytes per segment, 1024 total)
  • internal_attachments_get_content resolves such references under the agent home via HomePathResolver and delivers the resolved files/... url on the attachment, while the payload echoes the reference as passed
  • promote HomePathResolver from a dial_files_tooling private to a public shared/home_path package so consumers outside the file family can inject it without violating DI conventions
  • MCP dial_url parameters keep rejecting the scheme explicitly (resolution there is a follow-up, Support agent-home-relative file references in MCP dial_url parameters #445)

What alternatives have you considered?

  • Teach the file tools to display absolute files/... urls so the model can pass them to get_content: leaks the appdata/home prefix into every tool result, bloats context, and breaks the clean relative convention the file tools were designed around.
  • Prompt-level instruction telling the model to expand references itself: impossible — the model never sees the files/{appdata}/{home} prefix.

Metadata

Metadata

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions