Repository navigation
fix(server): t3_project_create names the link that refuses it and rejects a model default it would drop #30471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b71d31f
1f6ba5e
2270d2a
cf85adc
0e82b7c
accc17b
e3af323
4b2c0ee
00ebeaa
caea18f
d5cb85c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -513,6 +513,12 @@ export const layer = McpToolAccess.toLayer(ProjectToolkit, { | |
| ...(created.commitError === undefined ? {} : { commitError: created.commitError }), | ||
| }; | ||
| } | ||
| if (input.defaultModelSelection !== undefined && input.defaultModelSelection !== null) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the default-model validation into This guard enforces a project rule only for MCP. As per coding guidelines, “A server capability is a method on a service in its domain folder” and a transport handler calls the service and maps its errors. As per path instructions, construct errors where failures occur and translate them at transport boundaries.
|
||
| return yield* new OrchestratorMcpFailure({ | ||
| code: "invalid_request", | ||
| message: | ||
| "Creating a project does not set its default model; set defaultModelSelection afterwards with t3_project_update.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }); | ||
| const commandId = yield* newCommandId(); | ||
| return yield* projects | ||
| .create({ ...input, workspaceRoot, commandId, projectId: ProjectId.make(commandId) }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -593,7 +593,11 @@ it.effect("brings a repository to a linked environment, only through full access | |||||||||||||
| environmentId: box.environmentId, | ||||||||||||||
| ...args, | ||||||||||||||
| }); | ||||||||||||||
| expect(failureOf(refused), name).toMatchObject({ code: "capability_denied" }); | ||||||||||||||
| const failure = failureOf(refused); | ||||||||||||||
| expect(failure, name).toMatchObject({ code: "capability_denied" }); | ||||||||||||||
| // The agent's thread is full access; what holds it is the link's access. | ||||||||||||||
| expect(failure.message, name).toContain("linked environment"); | ||||||||||||||
| expect(failure.message, name).not.toContain("calling thread"); | ||||||||||||||
|
Comment on lines
+596
to
+600
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These assertions test refusal copy, which the testing rules exclude. Could you remove them and retain the existing capability check?
Suggested change
Posted via Macroscope — Test Signal |
||||||||||||||
| } | ||||||||||||||
| expect((yield* Ref.get(seen)).clones).toHaveLength(1); | ||||||||||||||
| expect((yield* Ref.get(seen)).projects).toHaveLength(1); | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
rg -n -C 6 'thread\.runtime-mode\.set|runtimeModeCeiling|linkOrigin' \ apps/server/src/orchestration-v2/Orchestrator.ts \ apps/server/src/mcp/threadAccess.ts \ apps/server/src/mcp/linkOrigin.tsRepository: pingdotgg/t3code
Length of output: 26875
Script executed:
Repository: pingdotgg/t3code
Length of output: 42072
Script executed:
Repository: pingdotgg/t3code
Length of output: 43138
Reject fenced origins independently of thread limits.
A fenced linked thread can retain its
linkOriginwhen its runtime mode changes. The current helper then uses only the thread modes forassertFullAccess. A fenced thread withfull-accessanddefaultinteraction mode can therefore pass the check used byt3_project_createandt3_project_clone.Reject a fenced origin before checking the thread limits. Preserve the existing full-access check for callers without a fenced origin.