Skip to content

Feat/copy task files to job dir#1449

Merged
aliasaria merged 7 commits intomainfrom
feat/copy-task-files-to-job-dir
Mar 6, 2026
Merged

Feat/copy task files to job dir#1449
aliasaria merged 7 commits intomainfrom
feat/copy-task-files-to-job-dir

Conversation

@aliasaria
Copy link
Copy Markdown
Member

Copy the task.yaml and task files to the job dir so when a Job is complete, you can see what files it ran with

When a task has a task_id, copy all files from the task directory
(task.yaml and any attached files) into the workspace job directory
before launch so they are visible in the UI file browser and available
to the running command. index.json is excluded to avoid overwriting
the job system's own metadata.
@sentry
Copy link
Copy Markdown

sentry bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 20.68966% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
api/transformerlab/routers/compute_provider.py 20.68% 23 Missing ⚠️

📢 Thoughts on this report? Let us know!

@paragon-review
Copy link
Copy Markdown

paragon-review bot commented Mar 4, 2026

Paragon Summary

This pull request review identified 3 issues across 2 categories in 2 files. The review analyzed code changes, potential bugs, security vulnerabilities, performance issues, and code quality concerns using automated analysis tools.

This PR adds functionality to copy task configuration files (task.yaml and related task files) to the job directory upon job completion, enabling users to inspect what configuration a job ran with after it finishes.

Key changes:

  • Copies task.yaml and task files to job directory upon job completion
  • Provides visibility into what configuration files each job ran with
  • Modified api/transformerlab/routers/compute_provider.py to implement file copy logic
  • Updated AGENTS.md documentation to reflect new behavior

Confidence score: 3/5

  • This PR has moderate risk due to 1 high-priority issue that should be addressed
  • Score reflects significant bugs, performance issues, or architectural concerns
  • Review high-priority findings carefully before merging

2 files reviewed, 3 comments

Severity breakdown: High: 1, Medium: 2


Tip: @paragon-run <instructions> to chat with our agent or push fixes!

Dashboard

Comment thread api/transformerlab/routers/compute_provider.py
Comment thread api/transformerlab/routers/compute_provider.py
# index.json is excluded because the job system uses its own index.json
# for metadata and overwriting it with the task's index.json would break
# job status tracking.
if request.task_id:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Task files copy to workspace dir, not LOCAL provider's working dir

Task files copy to workspace dir, not LOCAL provider's working dir. Running command won't find them. Copy to the provider's actual job_dir.

View Details

Location: api/transformerlab/routers/compute_provider.py (lines 1677)

Analysis

Task files copy to workspace dir, not LOCAL provider's working dir

What fails For LOCAL providers, the command's working directory is set to get_local_provider_job_dir (line 1669), but task files are copied to get_job_dir (line 1681). These are different paths.
Result Task files are in /jobs// but the LOCAL command executes in ~/.transformerlab/local_provider_runs/orgs///. Files are not 'available to the running command' as the comment states.
Expected Task files should be copied to the directory the command actually runs in, or the comment should clarify this is only for post-run inspection in the workspace.
Impact For LOCAL provider jobs, the stated goal of making task files 'available to the running command on any provider' is not met. The command cannot access the copied files from its working directory.
How to reproduce
1. Launch a job on a LOCAL provider with a task_id
2. Observe that provider_config_dict['workspace_dir'] points to ~/.transformerlab/local_provider_runs/orgs/<org>/<id>/
3. Observe that task files are copied to <workspace>/jobs/<id>/
4. The running command cannot find the task files in its working directory
AI Fix Prompt
Fix this issue: Task files copy to workspace dir, not LOCAL provider's working dir. Running command won't `find` them. Copy to the provider's actual job_dir.

Location: api/transformerlab/routers/compute_provider.py (lines 1677)
Problem: For LOCAL providers, the command's working directory is set to get_local_provider_job_dir (line 1669), but task files are copied to get_job_dir (line 1681). These are different paths.
Current behavior: Task files are in <workspace>/jobs/<id>/ but the LOCAL command executes in ~/.transformerlab/local_provider_runs/orgs/<org>/<id>/. Files are not 'available to the running command' as the comment states.
Expected: Task files should be copied to the directory the command actually runs in, or the comment should clarify this is only for post-run inspection in the workspace.
Steps to reproduce: 1. Launch a job on a LOCAL provider with a task_id
2. Observe that provider_config_dict['workspace_dir'] points to ~/.transformerlab/local_provider_runs/orgs/<org>/<id>/
3. Observe that task files are copied to <workspace>/jobs/<id>/
4. The running command cannot find the task files in its working directory

Provide a code fix.


Tip: Reply with @paragon-run to automatically fix this issue

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is not our goal so wont fix

@aliasaria aliasaria merged commit 949ae17 into main Mar 6, 2026
7 checks passed
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.

2 participants