Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
This change is part of the following stack: Change managed by git-spice. |
|
r? @tdraier |
There was a problem hiding this comment.
cc-verify: violations found!
- agent-verbs: Lifecycle writes bypass write permission
- index-foreign-keys: Template foreign key lacks index
- no-unsafe-type-assertions: Incomplete attributes cast as complete
- models-behind-resources: Head-field writes bypass Resource
Findings and notifications outside the PR diff:
Source: front/lib/api/assistant/configuration/agent.ts:96
models-behind-resources in front/CONTRACTS requires runtime model access through Resources. This change extends the pre-existing direct AgentModel.create call with head-field initialization, leaving the new persistence logic owned by the business layer; move pending-agent persistence behind an AgentResource operation.
b5a58b9 to
6a80f07
Compare
|
🟡 1 security issue detected below the blocking threshold. Reviewed everything up to d21ec7f. The following issues were found:
Evidence: After
Security OverviewDetected Code Changes
|
f46fa38 to
a8dabb3
Compare
|
b02fc6f to
500fffb
Compare
agentsagents
|
r? @tdraier |
There was a problem hiding this comment.
cc-verify: violations found!
- unreadable-agent-is-light: Light resources retain private fields
- agent-publish-capability: Draft identities store visible scope
- models-behind-resources: Direct model access (existing finding)
| @@ -559,7 +563,6 @@ export async function destroyAgentConfigurationRow( | |||
|
|
|||
| const remainingConfiguration = await AgentConfigurationModel.findOne({ | |||
There was a problem hiding this comment.
This extends a pre-existing models-behind-resources violation (front/CONTRACTS): removing the projection makes this business-layer query load the full configuration for the new head-field mirroring, keeping that persistence access outside Resources. Move the replacement-configuration lookup and repointing behind AgentResource.
| updatedAt: new Date(content.updatedAt), | ||
| // The cached row is the current version, so its version is the agent's `currentVersion`. | ||
| currentVersion: content.version, | ||
| ...NO_HEAD_FIELDS, |
There was a problem hiding this comment.
why no field here ? they must be restored (and should be in the toSnapshot)
There was a problem hiding this comment.
it's not needed atm they are read from content
| createdAt: new Date(), | ||
| updatedAt: new Date(), | ||
| currentVersion: configuration.version, | ||
| ...NO_HEAD_FIELDS, |
There was a problem hiding this comment.
not even a scope: global ?
| ); | ||
| } | ||
|
|
||
| private async updateAgent( |
There was a problem hiding this comment.
maybe make it more clear we're updating the agent head fields ?
37a6edd to
aff28e0
Compare
…configuration Adds `status`, `scope`, `reinforcement`, `lastReinforcementAnalysisAt`, `templateId` and `requestedSpaceIds` to `agents`, nullable for now. They mirror the same columns of the configuration row the agent points at: - `AgentResource.createIdentity` writes them with the identity, and `setCurrentConfiguration` copies them whenever the pointer moves (create, upgrade, pending activation, rollback re-point). - The in-place writers on a current configuration row (archive, restore, bulk scope change, requested-spaces propagation) also write the agent, in the same transaction, through `AgentResource.updateSettingsForCurrentConfigurations`. An index on (workspaceId, status, scope) prepares listings that filter agents before joining their configuration. Reads still come from `agent_configurations`; the backfill and NOT NULL step follow.
aff28e0 to
d21ec7f
Compare
Description
Refs https://github.com/dust-tt/tasks/issues/10447
Adds
status,scope,reinforcement,lastReinforcementAnalysisAt,templateIdtoagents,nullable for now. They mirror the same columns of the configuration row the agent points at:
Tests
added tests + tested manually that agent changes propagates to agents table.
Risk
Low, nothing reads agents fields for now.
Deploy Plan
migrate then deploy