fix: default srcDir to project root instead of non-existent src/ subdirectory#530
Merged
jesseturner21 merged 1 commit intomainfrom Mar 11, 2026
Merged
fix: default srcDir to project root instead of non-existent src/ subdirectory#530jesseturner21 merged 1 commit intomainfrom
jesseturner21 merged 1 commit intomainfrom
Conversation
…irectory The package command failed with "Required project file not found: .../src" because resolveProjectPaths defaulted srcDir to 'src' relative to the agent code directory. Agent templates place source files directly in the agent directory (e.g. app/MyAgent/main.py), not in a src/ subdirectory. Fixes #311 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Coverage Report
|
tejaskash
approved these changes
Mar 10, 2026
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.
Description
The
agentcore packagecommand fails withError: Required project file not found: .../app/MyAgent/srcbecauseresolveProjectPathsandresolveProjectPathsSyncinhelpers.tsdefaultsrcDirto'src'relative to the agent's code directory. However, all agent templates (Strands, LangChain, CrewAI, GoogleADK, OpenAIAgents) place source files directly in the agent directory (e.g.app/MyAgent/main.py), not in asrc/subdirectory.The fix changes the default from
'src'to'.'so thatsrcDircorrectly resolves to the agent code directory itself. ThesrcDiroption inPackageOptionsstill allows callers to override this if needed.Related Issue
Closes #311
Documentation PR
N/A — no documentation changes needed.
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsEnd-to-end manual testing:
agentcore create --name TestAgent --defaults→agentcore package→ produces valid zip withmain.py,model/,mcp_client/at the rootagentcore createwith--framework LangChain_LangGraph→agentcore package→ produces valid zipagentcore add agent→agentcore package→ both agents packaged successfullyagentcore package --agent <name>→ works for individual agent targetingagentcore validate→ passes on all test projectsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.