Fix hardcoded path in arxiv_to_md sub_agent.py#18
Open
ArtyT wants to merge 3 commits into
Open
Conversation
…t.py
Replace hardcoded '/Users/lmergen/.claude/skills/scripts' with dynamic
__file__-based resolution using pathlib so the sub-agent works on any
machine. Uses string concatenation instead of f-strings to avoid brace
collision with {result} template placeholder.
Closes solatis#16
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Review Summary by QodoFix hardcoded path and document path resolution architecture
WalkthroughsDescription• Replace hardcoded author path with dynamic __file__-based resolution
• Use string concatenation to inject SCRIPTS_DIR into template, avoiding f-string brace collision
with {result} placeholder
• Add comprehensive documentation explaining path resolution architecture and template system design
Diagramflowchart LR
A["Hardcoded Path<br/>/Users/lmergen/.claude/skills/scripts"] -->|Replace| B["Dynamic Resolution<br/>Path(__file__).resolve().parent.parent.parent"]
B -->|Inject via| C["String Concatenation<br/>SCRIPTS_DIR variable"]
C -->|Avoid| D["F-string Brace Collision<br/>with {result} placeholder"]
E["Documentation<br/>CLAUDE.md + README.md"] -->|Explain| B
E -->|Explain| D
File Changes1. skills/scripts/skills/arxiv_to_md/sub_agent.py
|
Code Review by Qodo
✅ 1.
|
Addresses PR review: manual single-quote wrapping of SCRIPTS_DIR could produce invalid Python if the path contains backslashes or quotes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accept main's version of sub_agent.py which already includes the MODULE_PATH fix from this PR in its refactored form. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gcharang
added a commit
to playactai/claude-config
that referenced
this pull request
Apr 16, 2026
PR solatis#21 (incoherence.py): add --thoughts CLI arg with context propagation via <context> block and next-cmd placeholder, replace substring "COMPLETE" check with exact WORKFLOW COMPLETE. sentinel, and add SUB-AGENT TASK COMPLETE branch so terminal sub-agent steps (7/11/19) return to parent instead of chaining forward. PR solatis#18 (arxiv_to_md): replace hardcoded /Users/lmergen path in sub_agent.py with SCRIPTS_DIR computed from __file__, injected via repr() to survive backslashes and embedded quotes (Qodo review). Add package-level CLAUDE.md and README.md documenting the path resolution approach and the f-string vs {result} brace-collision trap. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/Users/lmergen/.claude/skills/scriptspath with dynamic__file__-based resolution usingpathlib{result}template placeholder on line 103CLAUDE.mdandREADME.mddocumenting path resolution architecture and template system designTest plan
python3 -c 'import skills.arxiv_to_md.sub_agent'grep -r '/Users/lmergen' skills/scripts/skills/arxiv_to_md/SCRIPTS_DIRresolves to correctskills/scripts/directoryarxiv-to-mdskill to convert a paperCloses #16
🤖 Generated with Claude Code