Repository navigation
fix: Error occurred while exporting application skills - #7727
Merged
Merged
Conversation
shaohuzhang1
commented
Nov 6, 2026
| SKILL_SCRIPT_PATH = os.path.join(PROJECT_DIR, "apps", "application", "template", "skill", "skill_script") | ||
|
|
||
|
|
||
| class InvalidSkillBaseUrl(AppApiException): |
Contributor
Author
There was a problem hiding this comment.
The diff is syntactically valid, but it is a behavioral change, not an optimization: it removes the .py extension from SKILL_SCRIPT_PATH.
Potential issues
-
File-not-found regression
- If the file on disk is still
skill_script.py, the new constant points to a non-existent path. - Any
open(),subprocess, import, or path-existence check using this constant will fail.
- If the file on disk is still
-
Execution behavior depends on how it is used
- If executed as:
an extensionless file can work, but only if the actual file exists and contains valid Python.
subprocess.run([sys.executable, SKILL_SCRIPT_PATH])
- If executed directly:
the file must exist, have a shebang, and be executable. This is less portable, especially on Windows.
subprocess.run([SKILL_SCRIPT_PATH])
- If executed as:
-
Import/package issues
- Normal Python import machinery expects
.pyfiles/modules. - Extensionsless files can be missed by packaging, Docker copy rules,
.gitignore, or deployment scripts.
- Normal Python import machinery expects
-
Consistency
- If the file was renamed from
skill_script.pytoskill_script, all references, docs, tests, packaging rules, and deployment scripts must be updated. - If the file was not renamed, this diff is likely a bug.
- If the file was renamed from
Recommendations
- Keep
skill_script.pyunless there is a clear reason to use an extensionless executable. - If extensionless is intentional, document it and ensure the actual file is renamed and included in packaging.
- Use
pathliband validate the path early:
from pathlib import Path
SKILL_SCRIPT_PATH = (
Path(PROJECT_DIR)
/ "apps"
/ "application"
/ "template"
/ "skill"
/ "skill_script.py"
)
if not SKILL_SCRIPT_PATH.is_file():
raise RuntimeError(f"Skill script not found: {SKILL_SCRIPT_PATH}")- For portable execution, prefer:
subprocess.run([sys.executable, str(SKILL_SCRIPT_PATH)], check=True)Conclusion: The only visible irregularity is the removed .py extension. It is only safe if the file was intentionally renamed to an extensionless executable and all callers/deployment steps support that. Otherwise, revert this change.
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.
fix: Error occurred while exporting application skills