fix(project): refuse nested project creation and model embedded-asset error - #1875
Merged
Merged
Conversation
… error Post-review follow-ups from #1809: - EmbeddedAssetSource.read now throws a modeled EmbeddedAssetNotFoundError instead of a bare Error. - project create now walks up from cwd for an agentcore/agentcore.json marker and throws a modeled NestedProjectError (USER source) instead of scaffolding a project inside an existing one.
tejaskash
force-pushed
the
fix/1809-nested-project-followups
branch
from
July 30, 2026 18:36
557820c to
22afd02
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #1875 +/- ##
============================================
+ Coverage 95.85% 95.86% +0.01%
============================================
Files 198 198
Lines 9341 9368 +27
============================================
+ Hits 8954 8981 +27
Misses 387 387 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aidandaly24
approved these changes
Jul 30, 2026
aidandaly24
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me. I think it's a good choice to keep the Errors inside the files that they are used until we see more use cases for them across the package.
notgitika
approved these changes
Jul 30, 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.
Summary
Post-review follow-ups from #1809
EmbeddedAssetSource.readnow throwsEmbeddedAssetNotFoundError(extendsAgentCoreCLIError, internal source,assetPathin meta) instead of a bareError.FsProjectManager.createnow walks up from the working directory looking for theagentcore/agentcore.jsonproject marker and throws a modeledNestedProjectError(user source) if one is found, instead of scaffolding a project inside an existing one.The "child lifted to root" behavior seen with
bun run startis abun runartifact — bun chdirs to the package root before running the script, so the child was created next torootrather than inside it. A compiled/linked binary would have nested the child insideroot. Either way, nesting a project inside a project would confuse project resolution, socreatenow refuses it explicitly.Testing
NestedProjectError.EmbeddedAssetNotFoundError.tsc --noEmitand Prettier clean.project create --project-name childfrom inside a scaffoldedrootproject printsError: cannot create a project inside an existing AgentCore project (found .../root/agentcore/agentcore.json)and exits 1.