Repository navigation
🧾 feat: Add Skill Upload Reservation Helpers - #17041
Conversation
a640648 to
31e603c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Upload intents discard canonical storage keys, and capability validation can accept non-callable cleanup implementations.
2 open findings
What changed in this PR
Adds reusable Skill upload-intent and blob-reservation helpers for the durable lifecycle stack.
Changes:
- Adds storage reservation and provider-pinned writing helpers.
- Adds upload-intent transitions with recovery and compensation behavior.
- Adds focused lifecycle tests.
| File | Description |
|---|---|
packages/api/src/skills/reservation.ts |
Implements storage resolution, reservation, and writing. |
packages/api/src/skills/reservation.spec.ts |
Tests supported providers and configuration changes. |
packages/api/src/skills/intent.ts |
Implements durable upload-intent orchestration. |
packages/api/src/skills/intent.spec.ts |
Tests ordering, recovery, and cleanup paths. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
31e603c to
716c62e
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 716c62e91c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28a256a88b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 998a7b4bbd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93cca1d02e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10e0900f39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export * from './intent'; | ||
| export * from './reservation'; |
There was a problem hiding this comment.
Wire reservation helpers into Skill upload paths
A repo-wide search finds these helpers only in their definitions and tests; the production paths still call saveBuffer directly before upsertSkillFile in packages/api/src/skills/save.ts:85-114 and packages/api/src/skills/upload.ts:105-131, while api/server/services/Endpoints/agents/skillDeps.js:71-87 continues wiring the old resolver. Consequently, a process exit between the blob write and metadata upsert still creates an unjournaled orphan, so exporting the helpers does not deliver the reservation behavior. Wire the TS helpers and lifecycle dependencies into both upload paths through the CJS adapter.
AGENTS.md reference: AGENTS.md:L78-L82
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is a real integration requirement. This PR introduces the reservation/intent helpers, but does not claim to wire the production upload paths by itself. The dependent stack PR that converts direct upload/edit, import, and sync to pass one frozen reservation through the writer is #17043. The six PRs are being landed as one stack with no deployment between merges, so the orphan window is not considered closed until that integration PR lands. Leaving this thread open as an explicit stack release gate.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
fea5593 to
9b5b161
Compare
9b5b161 to
1601c88
Compare

Summary
Add reusable upload-intent and blob-reservation helpers. This is an inert API-layer slice of the durable Skill lifecycle stack: existing upload callers are not switched in this PR. Depends on #17040 and replaces part of #17007.
How it works
A writer reserves the future object location and records an upload intent before writing bytes. The helper advances the intent only after the file row is committed and retains ambiguous outcomes for recovery rather than guessing that an in-flight writer has stopped.
Type of change
Testing
Tested environments/configuration: Mocked storage strategies and the local API workspace.
Automated tests: API TypeScript typecheck; 12 focused intent/reservation tests. The existing Skill HTTP routes remain unchanged in this slice.
Screenshots / recordings
No user-facing change.
Risk / compatibility
These helpers have no live callers until the final integration PR. The following cleanup-engine and integration PRs complete the upload and deletion lifecycle.
Checklist