Skip to content

Route agent-generated files into /workspace/Output#42

Open
AminMahpour wants to merge 2 commits into
masterfrom
DEV/agent-output-folder
Open

Route agent-generated files into /workspace/Output#42
AminMahpour wants to merge 2 commits into
masterfrom
DEV/agent-output-folder

Conversation

@AminMahpour

Copy link
Copy Markdown
Owner

Summary

  • Add an Output/ workspace target for agent-generated files and document it in README.md and chainlit.md.
  • Redirect generated file writes and write-oriented tool arguments into /workspace/Output/ while preserving normal access to existing repo files.
  • Update the OpenAI-compatible model config in deepagent.toml to point at the LM Studio endpoint used in this branch.
  • Improve Chainlit runtime error reporting so nested connection causes are surfaced.

Testing

  • Added and updated unit tests for Output redirection, workspace path mapping, OpenAI-compatible model construction, and exception summaries.
  • Focused pytest coverage passed locally.

@AminMahpour AminMahpour marked this pull request as ready for review May 25, 2026 18:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50ffbc9026

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread deepagent_runtime.py
Comment on lines +735 to +736
if output_redirect_enabled and normalized_key in GENERATED_FILE_OUTPUT_ARG_KEYS:
mapped[key] = _map_generated_output_tool_path_value(value, root)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow write tools to edit existing workspace files

This branch unconditionally redirects every write_file/create_directory path key into Output, so a normal edit like repo_write_file on /workspace/README.md is rewritten to <project>/Output/README.md and the real target file is never modified. That breaks code-change workflows and contradicts the stated contract that existing project files can still be edited in place.

Useful? React with 👍 / 👎.

Comment thread deepagent_runtime.py
Comment on lines +657 to +660
relative = PurePosixPath(normalized)
if relative.parts and relative.parts[0] == output_name:
return str((project_root / Path(*relative.parts)).resolve())
return str((project_root / AGENT_OUTPUT_DIRECTORY / Path(*relative.parts)).resolve())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep redirected relative paths inside Output

The relative-path redirect uses .resolve() without a containment check, so inputs containing .. can escape Output (for example ../README.md resolves to the repo root). This creates a path traversal that defeats the Output isolation goal and allows unintended overwrites outside the generated-files directory.

Useful? React with 👍 / 👎.

Comment thread deepagent.toml

[model]
provider = "openai_compatible"
base_url = "http://10.0.1.152:1234/v1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore reachable default model endpoint

The committed default config points base_url at http://10.0.1.152:1234/v1, which is a machine-specific LAN address and will be unreachable for most users. With this as the active [model] block, a fresh run fails to connect until users manually patch config, whereas the prior loopback default worked out of the box for local servers.

Useful? React with 👍 / 👎.

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