Repository navigation
feat(store): handle-based streaming I/O for file store - #600
Conversation
…write/close)
The store system previously had two problems: it buffered entire files
in memory for every read/write, and domain operations (save_project,
get_template, save_log, etc.) were implemented as monolithic methods
on the Store class with bespoke path construction and JSON
serialization baked in.
This change replaces that with a generic filesystem-style interface
(open, read, write, close, delete, stat, mkdir, list_dir) on
FileStore, with domain methods (save_project, get_template, save_log,
etc.) becoming thin convenience wrappers on the client SDKs that
call the generic file operations with well-known paths. The server
no longer needs to know about project/template/log semantics — it
just serves files.
The handle-based open/read/write/close pattern also enables streaming
large files without holding everything in memory, and lets each
backend use its native chunked upload API.
The open/write/close pattern is the lowest common denominator across
all three backends:
- S3: create_multipart_upload → upload_part (5 MB buffer) → complete
- Azure: stage_block (4 MB buffer) → commit_block_list
- Filesystem: open('wb') → write() → close()
Each handle is tagged with the owning connection_id so that when a
connection terminates, all its handles are force-closed (committing
whatever data has been written, not discarding it).
Changes by layer:
IStore (store.py):
- Added open_write, write_chunk, close_write, abort_write,
open_read, read_chunk, close_read with default in-memory
implementations so custom backends continue to work.
Backends (filesystem.py, s3.py, azure.py):
- FilesystemStore: holds aiofiles file descriptors across calls.
- S3Store: multipart upload with 5 MB buffer threshold; falls back
to single put_object for files under 5 MB.
- AzureBlobStore: staged blocks with 4 MB threshold; falls back to
upload_blob for small files.
- abort_write on all backends commits rather than discards.
FileStore (file_store.py — new file):
- FileHandle dataclass and FileHandleMode enum (inline, no separate
module — nothing outside FileStore imports them).
- Handle registry with per-path write locks (one writer at a time).
- close_all_handles(connection_id) for disconnect cleanup.
- read()/write() convenience methods now use handles internally.
- Fixed stat() to check directory before file (prevents filesystem
directories from being reported as files).
DAP command handler (cmd_task.py):
- fs_open, fs_read (handle-based), fs_write (handle-based), fs_close
replace the old path-based fs_read/fs_write subcommands.
- Removed domain-specific subcommands (save_project, get_template,
etc.) — these are now client-side convenience wrappers.
Disconnect cleanup (task_server.py):
- _dapbase_on_disconnected now calls close_all_handles for the
disconnecting connection.
Client SDKs (store.py, client.ts):
- fs_open/fs_read/fs_write/fs_close (Python) and
fsOpen/fsRead/fsWrite/fsClose (TypeScript) — identical shapes.
- Convenience wrappers (fs_read_string, fs_write_json, etc.) now
perform open/read|write/close internally.
- Domain methods (save_project, get_project, save_template, etc.)
are thin wrappers that serialize to JSON and write to well-known
paths using the generic file operations.
- Both SDKs use plain string handle IDs, no wrapper classes.
Tests:
- Fixed stale tests in test_store.py and test_file_store.py that
called methods removed from Store and FileStore.
- Added TestHandleIO to test_file_store.py (server-side).
- Added TestFileStoreOperations to Python client integration tests.
- Added File Store Operations to TypeScript client integration tests.
📝 WalkthroughWalkthroughAdds a per-account FileStore with handle-based streaming I/O, extends IStore/Store with binary/streaming APIs, implements provider-specific streaming for filesystem/S3/Azure, threads blocking provider calls off the event loop, and threads client_id through task lifecycle and CLI/client store APIs. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant FileStore as FileStore<br/>(server)
participant Backend as Backend<br/>(S3/Azure/FS)
Note over Client,Backend: Write flow (streaming)
Client->>FileStore: open_write(path, connection_id)
activate FileStore
FileStore->>Backend: open_write(scoped_path)
Backend-->>FileStore: context
FileStore-->>Client: handle_id
deactivate FileStore
Client->>FileStore: write_chunk(handle_id, data)
activate FileStore
FileStore->>Backend: write_chunk(filename, context, data)
Backend-->>FileStore: bytes_written
FileStore-->>Client: bytes_written
deactivate FileStore
Client->>FileStore: close_write(handle_id)
activate FileStore
FileStore->>Backend: close_write(filename, context)
Backend-->>FileStore: commit/ok
FileStore-->>Client: closed
deactivate FileStore
Note over Client,Backend: Read flow (ranged)
Client->>FileStore: open_read(path, connection_id)
activate FileStore
FileStore->>Backend: open_read(scoped_path)
Backend-->>FileStore: context + size
FileStore-->>Client: {handle_id, size}
deactivate FileStore
Client->>FileStore: read_chunk(handle_id, offset, length)
activate FileStore
FileStore->>Backend: read_chunk(filename, context, offset, length)
Backend-->>FileStore: bytes (or b'' at EOF)
FileStore-->>Client: bytes
deactivate FileStore
Client->>FileStore: close_read(handle_id)
activate FileStore
FileStore->>Backend: close_read(filename, context)
FileStore-->>Client: closed
deactivate FileStore
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 20
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/client-python/src/rocketride/cli/main.py (1)
558-562:⚠️ Potential issue | 🟡 MinorUpdate the missing-subcommand error text.
The validation message still points users to removed
save_*/get_*commands instead of the new filesystem-style subcommands.📝 Suggested fix
- print('Error: Store subcommand is required (save_project, get_project, delete_project, get_all_projects, save_template, get_template, delete_template, get_all_templates, save_log, get_log, list_logs)') + print('Error: Store subcommand is required (dir, type, write, rm, mkdir, stat)')🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/client-python/src/rocketride/cli/main.py` around lines 558 - 562, Update the error message in the CLI branch that checks store subcommands (inside the block where self.args.command == 'store') to reflect the new filesystem-style subcommands instead of the old save_*/get_* commands; locate the check that uses hasattr(self.args, 'store_subcommand') and replace the printed text to list the current valid store subcommands (e.g., the filesystem-style names used elsewhere in this module/CLI parsing logic) so users see the correct options when the subcommand is missing.packages/ai/tests/ai/account/test_store.py (1)
853-1018: 🛠️ Refactor suggestion | 🟠 MajorAdd backend-specific chunking coverage.
These new tests are filesystem-only, but the PR's riskiest code lives in the S3 multipart and Azure staged-block implementations. The PR checklist still calls out
>5 MBS3 and>4 MBAzure verification as remaining, so please add provider-level tests that cross those thresholds and assert the multipart/staged APIs are actually used.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/tests/ai/account/test_store.py` around lines 853 - 1018, Add provider-specific tests that exercise chunking thresholds: for S3 create a Store via Store.create(...) configured for the S3 backend and use get_file_store(...) to write a payload >5 MB (via open_write/write_chunk/close_write or write with a large bytes object) and assert the S3 multipart upload path was taken (mock or spy the multipart uploader/method). Do the same for Azure with a payload >4 MB and assert the Azure staged block API was used (mock/spy the block staging/upload commit functions). Use the same symbols found in the diff (Store.create, Store.get_file_store, FileStore.open_write, FileStore.write_chunk, FileStore.close_write, FileStore.write, FileStore.read) to locate where to add these tests and ensure they verify the multipart/staged APIs were invoked rather than only asserting final content.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ai/src/ai/account/file_store.py`:
- Around line 71-79: The constructor FileStore.__init__ currently accepts any
client_id and later uses it in _full_path, allowing path-segment injection;
change __init__ (and any other place constructing FileStore or setting
_client_id) to validate that client_id is a single path segment: non-empty and
contains no path separators ("/" or "\"), no "." or ".." segments, and no
percent-encoding that would decode to separators; if validation fails raise
ValueError. Update the validation logic where _client_id is assigned (and mirror
it at the other occurrence noted around the code region referenced) so
_full_path can safely interpolate _client_id into "users/<client_id>/files/".
- Around line 141-163: Reject negative offsets and enforce the API's max chunk
size on the server: in open_read, validate that the incoming offset argument is
>= 0 (raise/return an error for negatives) before calling self._store.open_read
and store the validated offset on the FileHandle; additionally, in any
read/read_chunk method that uses a client-provided length (e.g., the follow-up
block around lines 165-178), clamp the requested length to the advertised
MAX_CHUNK_SIZE constant and never pass unchecked negative lengths to the backend
(reference symbols: open_read, FileHandle, FileHandleMode.READ,
self._store.open_read, self._handles and the read/read_chunk function that
consumes length). Ensure error paths return a clear failure rather than allowing
backend read(-1) to be invoked.
- Around line 254-265: The delete method (delete) currently calls
_store.delete_file directly and ignores in-memory handle state (_handles) and
active write locks (_write_locks), allowing deletes while a write is in
progress; update delete to consult those structures for the resolved full path
(use _full_path(path)) and reject the operation (raise StorageError) if there
are any open handles or an active write lock for that path, otherwise proceed to
call _store.delete_file(full_path); ensure the check is atomic with respect to
any locking/coordination used elsewhere (the same mechanism used by
close_write/handle management) so deletes cannot race with ongoing writes.
- Around line 98-110: The open_write flow is racy because you only add full_path
to self._write_locks after awaiting self._store.open_write; change open_write so
you acquire the write lock (add full_path to self._write_locks) immediately
after the pre-check and before awaiting self._store.open_write, then call await
self._store.open_write(full_path); if the backend open fails, remove full_path
from self._write_locks in the exception path to avoid leaking the lock; keep
creating the FileHandle (FileHandle, FileHandleMode.WRITE) and storing it in
self._handles only after the backend call succeeds.
In `@packages/ai/src/ai/account/store_providers/azure.py`:
- Around line 335-338: write_chunk() and close_write() currently remove bytes
from context['buffer'] before remote operations succeed, risking data loss on
transient Azure failures; change write_chunk() so it only deletes the bytes from
context['buffer'] after _stage_block(context, chunk) returns successfully (i.e.,
perform the del context['buffer'][:size] after _stage_block completes), and in
close_write() preserve the remaining buffer until upload_blob() /
commit_block_list() finish. Add retry logic around upload_blob() and
commit_block_list() inside the same method (with a small backoff and limited
attempts) so transient errors are retried before the exception is allowed to
propagate; keep references to the functions _stage_block(), write_chunk(),
close_write(), upload_blob(), and commit_block_list() when making these changes.
- Around line 317-421: The async methods open_read, read_chunk, write_chunk,
close_write and helper _stage_block are calling the synchronous Azure SDK and
blocking the event loop; replace those sync calls with the async Azure Blob
client from azure.storage.blob.aio (use BlobServiceClient from
azure.storage.blob.aio and its async methods like get_blob_client,
download_blob.readall, stage_block and commit_block_list) in _get_client() usage
inside open_read, read_chunk, close_write, _stage_block and write_chunk, or if
switching to the aio client is not possible quickly, offload each blocking call
using asyncio.to_thread(...) around the sync blob_client methods so network I/O
runs off the event loop; ensure the returned types are awaited/handled correctly
in open_read/read_chunk/close_write and that _stage_block becomes async or is
wrapped with to_thread when invoked from write_chunk/close_write.
In `@packages/ai/src/ai/account/store_providers/filesystem.py`:
- Around line 129-131: The filesystem backend replaced the optimistic-lock
version token with st_mtime which weakens conflict detection; change the version
token to be content-derived (e.g., a hash of the file bytes) wherever the code
currently returns or checks str(mtime) (the snippet in read/open that returns
(content, str(mtime))), ensure write/update functions verify expected_version
against that content-derived token before overwriting, and apply the same token
semantics and expected_version check in delete_file() so deletes follow the same
optimistic-locking contract as S3/Azure; update all places in this module that
currently use mtime (including the regions referenced around lines 168-183 and
222-230) to compute and compare the content hash token instead.
In `@packages/ai/src/ai/account/store_providers/s3.py`:
- Around line 318-335: open_write currently always calls
create_multipart_upload; change it to only initialize and return the in-memory
buffer and part state (key, parts list, part_number=1, buffer=bytearray())
without calling create_multipart_upload or setting upload_id; then update
write_chunk to lazily call create_multipart_upload on first time the buffer
length reaches the multipart threshold (5 * 1024 * 1024) and store upload_id in
the context; ensure close_write checks context: if no upload_id then upload via
put_object using the accumulated buffer, otherwise finish the multipart flow
(upload last part and complete or abort as currently implemented). Target
functions: open_write, write_chunk, close_write and the usage of
create_multipart_upload/upload_id in the multipart logic.
In `@packages/ai/src/ai/account/store.py`:
- Around line 494-497: The fallback except block sets storage_path to
Path(tempfile.gettempdir()) / '.rocketlib' / 'dtc', which diverges from the
primary branch that uses '.rocketlib/store'; update the fallback to use the same
storage root by setting storage_path to Path(tempfile.gettempdir()) /
'.rocketlib' / 'store' so both the normal branch and the exception branch write
to the same location (adjust the assignment in the except block where
storage_path is set).
In `@packages/ai/src/ai/modules/task/commands/cmd_task.py`:
- Around line 394-399: Clamp and validate the client-supplied chunk size before
calling fs.read_chunk: in cmd_task.py where handle = args.get('handle') and
length = args.get('length', 4_194_304) (used in fs.read_chunk(handle, length)),
reject non-positive values (return an error response) and cap length to the 4
MiB maximum (4_194_304) so you never pass a larger size into fs.read_chunk;
update the response construction to use the clamped length/value when computing
'size' and returning 'data'.
In `@packages/ai/src/ai/modules/task/task_server.py`:
- Around line 423-429: The disconnect path is creating cached FileStore
instances by unconditionally calling
self.store.get_file_store(conn._account_info.clientid); change this to a
non-creating lookup or guard using connection state so we only call
close_all_handles when a FileStore was actually used. Specifically, for the
block around conn._account_info and self.store.get_file_store(...), replace the
unconditional get with either a non-creating accessor on self.store (e.g., a
lookup method or checking an internal map) or add a flag on the connection
(e.g., conn._file_store_used) that is set when handles are opened, then call
close_all_handles(connection_id) only if the lookup returns an existing
FileStore or the flag is true; keep the existing try/except and debug_message
for errors.
- Around line 83-86: The module currently defaults client_id to the empty string
(same for apikey/token), which lets subprocesses silently join the shared
empty-ID namespace; change the API to require a non-empty client_id instead of
defaulting to '' by removing the empty-string default (or using Optional and
explicit None) and adding a validation/assertion that raises a clear exception
(ValueError) when client_id is missing before creating/propagating the task;
update the code paths that set/construct the task (references: apikey,
client_id, token and the task creation/propagation logic in task_server.py) to
enforce and propagate only validated non-empty client_id values.
In `@packages/ai/tests/ai/account/test_file_store.py`:
- Around line 4-10: Update the module docstring at the top of
packages/ai/tests/ai/account/test_file_store.py to reflect the current test
surface: remove references to project/template/log convenience methods and
instead state that the tests cover generic file operations (read, write, delete,
list_dir, mkdir, stat), path validation and traversal prevention, directory
listing with file/dir type detection, handle-based I/O (open/close/read/write
handles), and user isolation between different client_ids so the docstring
matches the actual tests in this module.
In `@packages/ai/tests/ai/account/test_store.py`:
- Around line 986-1001: Add an assertion to verify that close_all_handles
releases the per-path write lock: after calling
fs.close_all_handles(connection_id=42) and validating the data, attempt to open
a new write handle with fs.open_write('disconnect.bin', connection_id=43) and
assert it succeeds (and optionally close it). Update the test method
test_close_all_handles_on_disconnect to perform this follow-up open_write call
so the write lock cleared by close_all_handles is exercised; reference
fs.open_write and fs.close_all_handles to locate the change.
In `@packages/client-python/src/rocketride/cli/commands/store.py`:
- Around line 104-107: The branch that handles file_path reads the whole file
and calls client.fs_write(path, data) but fs_write expects a file handle, not a
path; fix by opening the remote file via client.fs_open(path, mode) to get a
handle, then write the local file in chunks using client.fs_write(handle, chunk)
(and finally client.fs_close(handle)); this avoids buffering the entire file in
memory—see client.fs_open, client.fs_write, and client.fs_close and the
implementation in packages/client-python/src/rocketride/mixins/store.py:90-104
for reference.
In `@packages/client-python/src/rocketride/cli/main.py`:
- Around line 490-495: The CLI's `--file` branch in
packages/client-python/src/rocketride/cli/commands/store.py incorrectly calls
client.fs_write(path, data) (treating path as handle); update that branch to
open the remote handle with client.fs_open(path, 'w'), stream the local file in
chunks calling client.fs_write(handle, chunk) until EOF, then close with
client.fs_close(handle), or alternatively add a convenience wrapper in
packages/client-python/src/rocketride/mixins/store.py (e.g.,
fs_write_path(handle_path, data_bytes)) and call that from the CLI; ensure you
use the mixin's fs_open, fs_write, and fs_close symbols so the handle vs path
semantics match.
In `@packages/client-python/src/rocketride/mixins/store.py`:
- Around line 221-242: The code is interpolating domain identifiers directly
into filesystem paths (e.g., save_project, get_project, delete_project, plus the
handlers at lines referenced for template_id/source and
list_logs/get_all_projects), which allows IDs with path separators to escape
into nested directories; add a helper function (e.g., sanitize_identifier or
encode_path_segment) that either rejects identifiers containing path
separators/backslashes or encodes them into a path-safe token (percent-encoding,
base64-url, or similar), then use that helper everywhere identifiers are used to
build fs paths (fs_write_json/fs_read_json/fs_delete and in listing functions
like get_all_projects and list_logs) to ensure IDs are treated as single path
segments and remain discoverable and non-colliding.
In `@packages/client-typescript/src/cli/rocketride.ts`:
- Around line 1038-1041: The current branch uses fs.readFileSync(options.file)
which loads the entire file into memory; instead open a write handle with the
client's handle-based API (e.g., call the client's fsOpen/fsCreateWriteHandle
equivalent), create a fs.createReadStream(options.file) (or use an async
iterator) and stream the file in fixed-size chunks (e.g., 64KB) calling
client.fsWrite(handle, chunk) for each chunk, then close the handle with
client.fsClose(handle) when complete; replace the synchronous readFileSync path
(referencing options.file and client.fsWrite in the diff) with this streaming
loop to avoid buffering the whole file.
In `@packages/client-typescript/src/client/client.ts`:
- Around line 1436-1452: The code currently concatenates raw domain IDs into
file paths (see saveProject, getProject, deleteProject and similarly
getAllProjects, getAllTemplates, listLogs) which allows IDs with '/' or '\' to
create nested paths and disappear from list APIs; add a small helper (e.g.,
validateIdOrThrow) that checks/sanitizes projectId, templateId, source and any
log projectId to disallow path separators or illegal chars (or return a safe
encoded form), call this helper before using fsWriteJson/fsReadJson/fsDelete/fs*
path construction in saveProject/getProject/deleteProject and the corresponding
template/log methods, and throw a clear error when validation fails so callers
cannot pass IDs that would break listing semantics.
---
Outside diff comments:
In `@packages/ai/tests/ai/account/test_store.py`:
- Around line 853-1018: Add provider-specific tests that exercise chunking
thresholds: for S3 create a Store via Store.create(...) configured for the S3
backend and use get_file_store(...) to write a payload >5 MB (via
open_write/write_chunk/close_write or write with a large bytes object) and
assert the S3 multipart upload path was taken (mock or spy the multipart
uploader/method). Do the same for Azure with a payload >4 MB and assert the
Azure staged block API was used (mock/spy the block staging/upload commit
functions). Use the same symbols found in the diff (Store.create,
Store.get_file_store, FileStore.open_write, FileStore.write_chunk,
FileStore.close_write, FileStore.write, FileStore.read) to locate where to add
these tests and ensure they verify the multipart/staged APIs were invoked rather
than only asserting final content.
In `@packages/client-python/src/rocketride/cli/main.py`:
- Around line 558-562: Update the error message in the CLI branch that checks
store subcommands (inside the block where self.args.command == 'store') to
reflect the new filesystem-style subcommands instead of the old save_*/get_*
commands; locate the check that uses hasattr(self.args, 'store_subcommand') and
replace the printed text to list the current valid store subcommands (e.g., the
filesystem-style names used elsewhere in this module/CLI parsing logic) so users
see the correct options when the subcommand is missing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2e2e8e26-e2d8-44b6-9e4c-bbb063a00038
📒 Files selected for processing (20)
.gitignorepackages/ai/src/ai/account/file_store.pypackages/ai/src/ai/account/store.pypackages/ai/src/ai/account/store_providers/azure.pypackages/ai/src/ai/account/store_providers/filesystem.pypackages/ai/src/ai/account/store_providers/s3.pypackages/ai/src/ai/modules/task/commands/cmd_debug.pypackages/ai/src/ai/modules/task/commands/cmd_task.pypackages/ai/src/ai/modules/task/task_engine.pypackages/ai/src/ai/modules/task/task_server.pypackages/ai/tests/ai/account/test_file_store.pypackages/ai/tests/ai/account/test_store.pypackages/client-python/src/rocketride/cli/commands/store.pypackages/client-python/src/rocketride/cli/main.pypackages/client-python/src/rocketride/client.pypackages/client-python/src/rocketride/mixins/store.pypackages/client-python/tests/RocketRideClient_test.pypackages/client-typescript/src/cli/rocketride.tspackages/client-typescript/src/client/client.tspackages/client-typescript/tests/RocketRideClient.test.ts
… CLI fixes The handle-based I/O added in f079c99 shipped with several gaps that this commit addresses across the full stack (server, Python SDK, TS SDK, both CLIs, and tests). Security — path and ID validation --- Paths and domain IDs (projectId, templateId, source) were interpolated into storage keys without checking individual segments. A malicious client_id like "../../other" or a projectId containing "*" could escape account isolation or cause backend errors. Validation now happens at three layers: - Server (FileStore._validate_path): rejects *, ?, <, >, |, ", null, and control characters per segment. __init__ rejects client_ids with path separators or ".." values. - Python SDK (StoreMixin._validate_store_path / _validate_id): same rules applied before every DAP request that takes a path or domain ID. - TS SDK (RocketRideClient.validateStorePath / validateId): same rules. API change — move offset from open to read --- Passing the byte offset at open time forced the server to track cursor state internally, and gave the client no way to seek after opening. Offset is now a parameter of read_chunk / fs_read / fsRead, letting the client control position on every call. Convenience wrappers (fs_read_string, fsReadString) track offset client-side in a loop. File metadata — get_file_info, size in list_dir/stat --- list_dir and stat previously returned only modification time for files, and list_dir fetched it via a separate get_modified_time call. Added IStore.get_file_info() returning {size, modified} in a single backend call: - Filesystem: one stat() call - S3: one head_object call - Azure: one get_blob_properties call list_dir and stat now return both size (bytes) and modified (epoch timestamp) for file entries. CLI dir output reformatted to match Windows DIR style (date, time, <DIR> or size, name, summary counts). Concurrency fixes in FileStore --- - open_write: write lock was acquired after awaiting the backend, leaving a race window at the suspension point. Lock now acquired before await, released on failure. - delete: rejects deletion while the path has an active write handle. - read_chunk: negative offset rejected, length capped at MAX_CHUNK_SIZE. - cmd_task handler: clamps client-supplied offset and length. Broken CLI write commands --- Both Python and TS CLIs called fs_write(path, data) — but after the handle-based refactor, fs_write takes (handle, data). Fixed to use fs_open/fs_write/fs_close with chunked streaming (64 KB in Python, createReadStream in TS). Cloud provider fixes --- - Azure write_chunk: buffer bytes were deleted before _stage_block completed, losing data on transient failures. Deletion now happens after staging succeeds. close_write clears buffer after commit. - S3 open_write: unconditionally called create_multipart_upload even for small files, then aborted it in close_write. Multipart creation is now deferred until the buffer first reaches 5 MB; small files use simple put_object. Minor fixes --- - store.py: fallback temp path used 'dtc' instead of 'store', diverging from the primary branch. - task_server.py: disconnect path created a FileStore instance even when the connection never used the store. Now checks the cache first. - main.py: error message listed old command names (save_project, etc.) instead of current ones (dir, type, write, rm, mkdir, stat). - Integration tests: Python and TS test path schemes aligned to .test-store/{lang}-{name}-{random} to prevent collision when run concurrently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 12
♻️ Duplicate comments (5)
packages/ai/src/ai/account/store_providers/azure.py (1)
335-363:⚠️ Potential issue | 🟠 MajorMove Azure blob I/O off the event loop.
These new
async defhandlers still call the synchronous Blob client (get_blob_properties(),download_blob().readall(),upload_blob(),commit_block_list(),stage_block()), so a slow blob operation will block unrelated coroutines on the same loop. The Azure Blob Storage Python docs already expose async clients underazure.storage.blob.aiofor both download and upload flows, so this can be switched directly instead of doing synchronous network I/O here. (learn.microsoft.com)Also applies to: 375-443
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/src/ai/account/store_providers/azure.py` around lines 335 - 363, The code uses synchronous Azure Blob Storage calls inside async handlers (see close_write, _stage_block, and any code that calls _get_client().get_blob_client(...).upload_blob()/commit_block_list()/stage_block()/download_blob().readall()/get_blob_properties()), which can block the event loop; replace the sync client usage with the async Azure client from azure.storage.blob.aio (e.g., use aio BlobServiceClient/BlobClient), update _get_client (or add an async _get_async_client) to return the aio client, and change calls to await blob_client.upload_blob(...), await blob_client.commit_block_list(...), await blob_client.stage_block(...), await blob_client.download_blob().readall(), etc.; ensure you open/close or reuse the async client properly and propagate async awaits through close_write and any other async methods that currently call blocking sync methods so all network I/O runs via the aio client.packages/ai/src/ai/modules/task/task_server.py (1)
83-86:⚠️ Potential issue | 🟠 MajorReject empty
client_idvalues here.The current launch paths in this PR pass
client_id, butTASK_CONTROLandstart_task()still default it to''and copy that value straight into the task. A missed or future call site will silently join the shared empty-ID namespace instead of failing fast.Suggested fix
`@dataclass` class TASK_CONTROL: @@ - client_id: str = '' + client_id: Optional[str] = None @@ async def start_task( @@ - client_id: str = '', + client_id: Optional[str] = None, @@ - control.client_id = client_id + if not client_id: + raise ValueError('client_id is required for task launches') + control.client_id = client_idAlso applies to: 817-818, 893-895
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/src/ai/modules/task/task_server.py` around lines 83 - 86, Replace the silent empty-ID behavior by requiring a non-empty client_id when creating or assigning task credentials: remove or stop using the empty-string default for client_id and add a validation that raises an error if client_id is falsy. Specifically, update the dataclass/structure that defines apikey, client_id, token (the apikey/client_id/token fields shown) to not accept '' as a valid client_id (use None default or no default), and add a check that raises ValueError (or similar) in the constructor/post_init and in the callers TASK_CONTROL and start_task so any missing client_id fails fast instead of being propagated into the task.packages/ai/src/ai/account/file_store.py (1)
273-286:⚠️ Potential issue | 🟠 MajorDelete still ignores open read handles.
_write_locksonly covers active writers. A live read handle inself._handlescan still be deleted out from under the caller, which gives backend-dependent behavior: Windows filesystem deletes fail, and object-store read handles start erroring mid-stream. Reject deletes while any non-closed handle targetsfull_path, not just while the write lock is held.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/src/ai/account/file_store.py` around lines 273 - 286, The delete method currently only checks self._write_locks; update it to also reject deletes when any active (non-closed) read handle in self._handles targets the same full_path: compute full_path via self._full_path(path), then iterate self._handles (keys/values) and if any handle corresponds to full_path and is not closed (e.g., not getattr(handle, "closed", False) or has a live/active flag), raise StorageError with the same message; only call await self._store.delete_file(full_path) when no such live read handles and no write lock exist. Ensure you reference the existing symbols: delete, _full_path, _write_locks, _handles, and _store.delete_file.packages/ai/src/ai/modules/task/commands/cmd_task.py (1)
381-388:⚠️ Potential issue | 🟡 MinorReject unknown
modevalues instead of defaulting them to read.Everything except
'w'currently falls through toopen_read()/close_read(). Typos like'W','read', orNoneturn into confusing invalid-handle errors, and on close they can leave a write handle plus its path lock open until disconnect cleanup runs.Also applies to: 423-429
packages/ai/src/ai/account/store_providers/filesystem.py (1)
129-131:⚠️ Potential issue | 🟠 MajorThe filesystem version token is still too weak and no longer matches the cloud backends.
Using
st_mtimeas the version identifier can miss fast rewrites on coarse-resolution filesystems, and the currentexpected_version is not Noneguards allow blind updates/deletes thatpackages/ai/src/ai/account/store_providers/s3.pyrejects. Local testing will exercise a different optimistic-locking contract than S3/Azure until this uses a stronger token and enforces version checks on existing files.Also applies to: 168-183, 222-230
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/src/ai/account/store_providers/filesystem.py` around lines 129 - 131, The current version token uses full_path.stat().st_mtime and returns (content, str(mtime)) which is weak; replace the token with a strong content-based hash (e.g., SHA-256 hex of the file bytes) computed when reading and after writes, and return that hash instead of str(mtime); then enforce S3-like optimistic locking in the write/update/delete paths by: if expected_version is None and the target file exists, raise a conflict (no blind overwrite/delete), and if expected_version is provided, compare it to the current hash and raise a conflict on mismatch; update all places that currently reference mtime/full_path.stat().st_mtime and the return tuple to use the new hash and apply the expected_version checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ai/src/ai/account/file_store.py`:
- Around line 119-123: The FileHandle connection ownership is not enforced:
thread the caller's connection_id through all handle operations (the methods
that create/read/write/close handles and any places calling _get_handle()) so
each operation accepts a connection_id param, set connection_id when creating
FileHandle (e.g., where FileHandle(...) is constructed), and modify
_get_handle() to validate that the stored handle.connection_id matches the
caller's connection_id and raise/return an error on mismatch; update the
read/write/close code paths to pass the caller connection_id and reject
operations from non-owners (also apply the same change for the other handle
creation/lookup sites mentioned).
In `@packages/ai/src/ai/account/store_providers/azure.py`:
- Around line 371-373: abort_write currently delegates to close_write so aborted
uploads get finalized; change abort_write(filename, context) to instead discard
any staged/write buffers and temporary state and avoid calling close_write or
any finalize/commit logic. Specifically, locate abort_write and replace the
close_write call with logic that clears the provider's in-memory or on-disk
write staging for filename/context (e.g., drop any buffer, delete temp blob or
temp file, remove entries from any staging maps or locks), update the
context/state to mark the upload as aborted, release resources/locks and return
without invoking _finalize/_commit methods used by close_write or touching
committed metadata. Ensure this mirrors the cleanup paths used for error/cleanup
elsewhere in the class so no partial data gets published.
In `@packages/ai/src/ai/account/store_providers/filesystem.py`:
- Around line 324-383: Open-write/read stream logic bypasses the existing lock
and writes to the live path; change open_write/open_read to acquire the store's
existing lock for the file and keep that lock for the lifetime of the returned
context, and stage writes to a temp file that is renamed atomically on close.
Specifically: in open_write(filename) use _get_full_path(filename) to compute
full_path, acquire the same lock the other APIs use (store lock file
.<name>.lock) and open a temp file (e.g. full_path.with_suffix(full_path.suffix
+ '.tmp') or full_path.with_name(full_path.name + '.partial')) for 'wb', then
return context containing 'file', 'path' (final full_path), 'temp_path', and
'lock'; in write_chunk/write_chunk use context['file'] to write to the temp
file; in close_write close and fsync the temp file, then rename temp_path ->
path atomically, then release the lock; in abort_write close and remove
temp_path and release the lock; in open_read(filename) acquire the same lock and
open the actual file for reading (store context with 'file','path','lock'), in
close_read close the file and release the lock; use the existing lock
acquire/release helpers (the same mechanism used by
read_file/write_file_atomic/delete_file) and ensure context keys
('file','path','temp_path','lock') are used so the other helper methods can
manage lifecycle correctly.
In `@packages/ai/src/ai/account/store.py`:
- Around line 274-276: abort_write currently delegates to close_write making
aborted/cancelled streams indistinguishable from successful finalization; change
abort_write(filename, context) to implement discard semantics (do not finalize
or persist data). Replace the call to close_write in AccountStore.abort_write
with logic that rolls back/remove any partial/temp artifacts (e.g., delete temp
files, abort multipart uploads, release locks) and ensure corresponding
providers (filesystem/S3 implementations) implement abort_write to delete the
temp path or cancel the upload instead of committing; keep close_write as the
successful finalize path and ensure callers can rely on abort_write to leave no
persisted/truncated artifact.
In `@packages/client-python/src/rocketride/cli/commands/store.py`:
- Around line 111-116: The _cmd_type function currently calls
client.fs_read_string(path) which materializes the whole file; change it to open
a remote handle via client.fs_open(path, 'r') (or the async equivalent) then
loop reading chunks with client.fs_read(handle, size) and write each chunk to
stdout (e.g., sys.stdout.buffer.write/flush) until EOF, then close the handle
and return 0; ensure you handle async/await for fs_open/fs_read and properly
close the handle in a finally block or async context manager to avoid resource
leaks.
- Around line 124-140: The code currently calls client.fs_open(...) before
opening the local file and uses client.fs_close(...) in the exception path,
which leaves empty/truncated remote files on failure; change the flow to open
the local file first (with open(file_path, 'rb') as f:), then call
client.fs_open(path, 'w') to get handle, perform client.fs_write(handle, ...) in
a try/except, and only call client.fs_close(handle, 'w') after the full
read/write loop completes successfully; on any exception after the remote handle
is created, do NOT call fs_close — instead call the appropriate abort/delete API
(e.g., client.fs_delete(path) or client.fs_abort(handle) if available) to remove
the partial remote file, and re-raise the exception; ensure references to
client.fs_open, client.fs_write, client.fs_close and the local file handling are
updated accordingly.
- Around line 82-85: When handling fs_list_dir() results in the command that
populates "entries" (the block using result.get('entries', []) and printing
"File Not Found"), don't treat an empty entries list as missing: call
fs_stat(path) when entries is empty and only print "File Not Found" if fs_stat
indicates the path does not exist (or returns an error/non-existent status).
Update the logic around result, entries and the early return so that an existing
empty directory is allowed to continue instead of immediately emitting "File Not
Found".
In `@packages/client-python/src/rocketride/mixins/store.py`:
- Around line 203-215: The fs_write_string function currently uses a nested
try/except to best-effort close the handle; simplify this by using a finally
block combined with contextlib.suppress(Exception) to call fs_close(handle, 'w')
once for cleanup. Update fs_write_string to open the handle via fs_open, perform
fs_write, and in a finally section call fs_close inside contextlib.suppress to
swallow any close errors; keep fs_open, fs_write, and fs_close as the referenced
operations and preserve the same error propagation for write failures.
- Around line 336-348: The loop silently swallows all exceptions when calling
fs_read_json over json_entries, hiding file corruption/permission/IO issues;
modify the try/except around the fs_read_json and pipeline parsing so that
instead of a bare "except Exception: continue" you capture the exception (e.g.,
"except Exception as e"), log it via the instance logger (or append an errors
list) with contextual info (entry['name'], directory, item_id) and continue or
propagate as appropriate; update references to fs_read_json, json_entries, items
and id_key in the same block so callers can inspect surfaced errors (or receive
an errors collection) rather than silently skipping entries.
In `@packages/client-python/tests/RocketRideClient_test.py`:
- Around line 2248-2388: Add tests that exercise fs_mkdir() and fs_list_dir():
create a unique directory path via _unique_path (e.g., 'dir-empty' and
'dir-nonempty'), call client.fs_mkdir(path) then use client.fs_list_dir(path)
and client.fs_stat(path) to assert the directory exists and lists as empty for
the empty-dir case; for the non-empty case, create a child file (use
fs_open/fs_write/fs_close), call fs_list_dir(path) to assert the child entry
appears and fs_stat(path) still reports type 'directory', then cleanup with
fs_delete for files and directory; ensure tests follow the same
connect/try/finally disconnect pattern and reuse RocketRideClient with
TEST_CONFIG.
In `@packages/client-typescript/src/cli/rocketride.ts`:
- Around line 978-982: The current branch treats an empty entries array from
client.fsListDir(path) as "File Not Found"; instead call client.fsStat(path)
when entries.length === 0 to differentiate an existing empty directory from a
missing path: if fsStat indicates the path exists and is a directory, print an
empty listing/summary (not "File Not Found"); if fsStat returns not found (or
throws a not-found error), print "File Not Found"; ensure you handle and log
other fsStat errors appropriately. Use client.fsListDir and client.fsStat as the
referenced symbols to implement this check.
In `@packages/client-typescript/src/client/client.ts`:
- Around line 1455-1472: The getAllProjects method swallows exceptions from
fsReadJson which hides storage/JSON issues; update the catch in getAllProjects
to log or surface the error (including the entry name and error details) instead
of silently continuing — use the existing logging facility (e.g.,
this.logger.error or console.error) to emit a clear message with entry.name and
the caught error, then continue to the next file to preserve current behavior.
---
Duplicate comments:
In `@packages/ai/src/ai/account/file_store.py`:
- Around line 273-286: The delete method currently only checks
self._write_locks; update it to also reject deletes when any active (non-closed)
read handle in self._handles targets the same full_path: compute full_path via
self._full_path(path), then iterate self._handles (keys/values) and if any
handle corresponds to full_path and is not closed (e.g., not getattr(handle,
"closed", False) or has a live/active flag), raise StorageError with the same
message; only call await self._store.delete_file(full_path) when no such live
read handles and no write lock exist. Ensure you reference the existing symbols:
delete, _full_path, _write_locks, _handles, and _store.delete_file.
In `@packages/ai/src/ai/account/store_providers/azure.py`:
- Around line 335-363: The code uses synchronous Azure Blob Storage calls inside
async handlers (see close_write, _stage_block, and any code that calls
_get_client().get_blob_client(...).upload_blob()/commit_block_list()/stage_block()/download_blob().readall()/get_blob_properties()),
which can block the event loop; replace the sync client usage with the async
Azure client from azure.storage.blob.aio (e.g., use aio
BlobServiceClient/BlobClient), update _get_client (or add an async
_get_async_client) to return the aio client, and change calls to await
blob_client.upload_blob(...), await blob_client.commit_block_list(...), await
blob_client.stage_block(...), await blob_client.download_blob().readall(), etc.;
ensure you open/close or reuse the async client properly and propagate async
awaits through close_write and any other async methods that currently call
blocking sync methods so all network I/O runs via the aio client.
In `@packages/ai/src/ai/account/store_providers/filesystem.py`:
- Around line 129-131: The current version token uses full_path.stat().st_mtime
and returns (content, str(mtime)) which is weak; replace the token with a strong
content-based hash (e.g., SHA-256 hex of the file bytes) computed when reading
and after writes, and return that hash instead of str(mtime); then enforce
S3-like optimistic locking in the write/update/delete paths by: if
expected_version is None and the target file exists, raise a conflict (no blind
overwrite/delete), and if expected_version is provided, compare it to the
current hash and raise a conflict on mismatch; update all places that currently
reference mtime/full_path.stat().st_mtime and the return tuple to use the new
hash and apply the expected_version checks.
In `@packages/ai/src/ai/modules/task/task_server.py`:
- Around line 83-86: Replace the silent empty-ID behavior by requiring a
non-empty client_id when creating or assigning task credentials: remove or stop
using the empty-string default for client_id and add a validation that raises an
error if client_id is falsy. Specifically, update the dataclass/structure that
defines apikey, client_id, token (the apikey/client_id/token fields shown) to
not accept '' as a valid client_id (use None default or no default), and add a
check that raises ValueError (or similar) in the constructor/post_init and in
the callers TASK_CONTROL and start_task so any missing client_id fails fast
instead of being propagated into the task.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5126084e-478e-4f87-932e-2e6713c84ccf
📒 Files selected for processing (16)
packages/ai/src/ai/account/file_store.pypackages/ai/src/ai/account/store.pypackages/ai/src/ai/account/store_providers/azure.pypackages/ai/src/ai/account/store_providers/filesystem.pypackages/ai/src/ai/account/store_providers/s3.pypackages/ai/src/ai/modules/task/commands/cmd_task.pypackages/ai/src/ai/modules/task/task_server.pypackages/ai/tests/ai/account/test_file_store.pypackages/ai/tests/ai/account/test_store.pypackages/client-python/src/rocketride/cli/commands/store.pypackages/client-python/src/rocketride/cli/main.pypackages/client-python/src/rocketride/mixins/store.pypackages/client-python/tests/RocketRideClient_test.pypackages/client-typescript/src/cli/rocketride.tspackages/client-typescript/src/client/client.tspackages/client-typescript/tests/RocketRideClient.test.ts
…o_thread Both the Azure and S3 storage providers use synchronous SDKs (azure-storage-blob and boto3) but are called from async methods on the event loop. With multiple clients connected over WebSocket via the rrext_store DAP path, a blocking upload_blob() or put_object() call freezes the entire event loop for all connected clients. Wrapped every synchronous SDK call in asyncio.to_thread() so network I/O runs in the default thread pool executor: Azure (azure.py): - upload_blob, download_blob/readall, get_blob_properties, exists, delete_blob, list_blobs, stage_block, commit_block_list — all offloaded - _stage_block made async to await the to_thread call S3 (s3.py): - put_object, get_object/Body.read, head_object, delete_object, paginate (list_objects_v2), create_multipart_upload, upload_part, complete_multipart_upload, abort_multipart_upload — all offloaded - _upload_part made async to await the to_thread call - Multi-step operations (read + parse, paginate + collect) wrapped in inner functions to keep the entire blocking sequence in one thread call Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ai/src/ai/account/store_providers/azure.py (1)
289-302:⚠️ Potential issue | 🟠 MajorMove Azure blob enumeration fully off the event loop.
Line 289 offloads only the pager construction. Since
list_blobs()returns a lazy iterator, thefor blob in blob_list:loop still performs synchronous network I/O on the event loop when fetching pages via continuation tokens.♻️ Fix by forcing eager evaluation in thread pool
- blob_list = await asyncio.to_thread(container_client.list_blobs, name_starts_with=blob_prefix) + blob_list = await asyncio.to_thread( + lambda: list(container_client.list_blobs(name_starts_with=blob_prefix)) + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/src/ai/account/store_providers/azure.py` around lines 289 - 302, The code currently calls container_client.list_blobs(...) via asyncio.to_thread but then iterates over the lazy pager on the event loop, causing sync I/O; instead, force eager evaluation inside the thread by calling list(container_client.list_blobs(name_starts_with=blob_prefix)) inside asyncio.to_thread (or wrap the entire enumeration and relative_name computation in a function run via asyncio.to_thread) so that container_client.list_blobs and the for blob in blob_list loop execute off the event loop; keep the existing relative_name logic (prefix checks) and return sorted(files) as before, but ensure all network paging happens within the to_thread call that produces the final files list.
♻️ Duplicate comments (1)
packages/ai/src/ai/account/store_providers/azure.py (1)
370-372:⚠️ Potential issue | 🟠 MajorMake
abort_write()discard staged data.This still delegates to
close_write(), so an explicit abort commits the blob. Clear the buffer and staged block metadata instead of finalizing.🐛 Minimal fix
async def abort_write(self, filename: str, context) -> None: - """Close the upload, committing whatever has been written.""" - await self.close_write(filename, context) + """Abort the upload without committing buffered data.""" + context['buffer'].clear() + context['block_ids'].clear() + context['block_counter'] = 0🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/src/ai/account/store_providers/azure.py` around lines 370 - 372, The abort_write implementation currently calls close_write and therefore commits the upload; change abort_write in azure.py so it does not call close_write but instead discards any staged data and metadata: clear the in-memory upload buffer (e.g., the buffer used in write/close_write), reset/clear the staged block list or block ID tracking (e.g., self._staged_blocks or equivalent), and remove any temporary/partial blob state if present; ensure you use the provided context to locate and delete any temp blob references and do not perform a Put Block/Put Block List or commit operation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ai/src/ai/account/store_providers/s3.py`:
- Around line 392-394: The abort_write implementation currently calls
close_write which commits buffered data; change abort_write in s3 provider to
instead cancel any in-progress multipart upload and discard local state: detect
the upload id/state stored in the write context (e.g., keys like "upload_id" or
"multipart_upload"), call the S3 client's abort_multipart_upload (or equivalent
abort API) for that upload, remove/clear any temporary buffer/file and the
upload id from context, and ensure no parts are finalized; do not call
close_write from abort_write.
---
Outside diff comments:
In `@packages/ai/src/ai/account/store_providers/azure.py`:
- Around line 289-302: The code currently calls container_client.list_blobs(...)
via asyncio.to_thread but then iterates over the lazy pager on the event loop,
causing sync I/O; instead, force eager evaluation inside the thread by calling
list(container_client.list_blobs(name_starts_with=blob_prefix)) inside
asyncio.to_thread (or wrap the entire enumeration and relative_name computation
in a function run via asyncio.to_thread) so that container_client.list_blobs and
the for blob in blob_list loop execute off the event loop; keep the existing
relative_name logic (prefix checks) and return sorted(files) as before, but
ensure all network paging happens within the to_thread call that produces the
final files list.
---
Duplicate comments:
In `@packages/ai/src/ai/account/store_providers/azure.py`:
- Around line 370-372: The abort_write implementation currently calls
close_write and therefore commits the upload; change abort_write in azure.py so
it does not call close_write but instead discards any staged data and metadata:
clear the in-memory upload buffer (e.g., the buffer used in write/close_write),
reset/clear the staged block list or block ID tracking (e.g.,
self._staged_blocks or equivalent), and remove any temporary/partial blob state
if present; ensure you use the provided context to locate and delete any temp
blob references and do not perform a Put Block/Put Block List or commit
operation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 888609b1-a34b-46db-b75b-e4a0a4fa04ed
📒 Files selected for processing (2)
packages/ai/src/ai/account/store_providers/azure.pypackages/ai/src/ai/account/store_providers/s3.py
…bort_write Applied fixes from code review. Each finding was verified against the current code; findings that were already addressed, architecturally unsound, or purely stylistic were rejected with reasoning below. Handle ownership enforcement --- _get_handle now accepts an optional connection_id and rejects operations from connections that don't own the handle. The cmd_task DAP handlers pass self._connection_id on every read_chunk, write_chunk, close_write, and close_read call. The parameter defaults to 0 (no check) so internal callers (convenience methods, tests, close_all_handles) are unaffected. This matters because handle IDs are UUIDs sent over the wire — without ownership checks, a client that guesses or intercepts a handle ID from another connection could read or write another user's open file. Empty directory vs missing path --- Both CLIs printed "File Not Found" when fs_list_dir returned zero entries, which is wrong for an existing empty directory. They now call fs_stat/fsStat to distinguish: empty dirs show a zero-count summary, missing paths show "File Not Found". Remove abort_write from API --- abort_write existed on IStore and all three providers but had zero callers — it was dead code. Rather than build out discard semantics for an unused API surface, the method was removed entirely. If abort semantics are needed in the future, they can be added with a clear use case driving the design. Silent exception swallowing in listing --- _get_all_items (Python) and getAllProjects/getAllTemplates (TS) caught all exceptions and silently continued when reading project/template JSON files. This hid file corruption, permission errors, and malformed JSON with no diagnostic output. Both now log the error at debug level before continuing, so issues are visible in logs without breaking the listing. Findings rejected (with reasoning) --- - task_server.py client_id empty default: The empty string is a dataclass initialization pattern, not a security gap. client_id is set from _account_info.clientid after authentication succeeds, and unauthenticated connections cannot reach the store. Adding validation at the dataclass level would require finding and updating every construction site for a field that is always set by the auth flow. - cmd_task.py chunk length clamping: Already implemented in the prior commit (ec225ed). The review was looking at stale code. - filesystem.py lock/temp-file staging for open_write: The review proposed acquiring the existing file lock for the entire lifetime of a write handle and writing to a temp file with atomic rename on close. This would be a significant architectural change that conflicts with the current design: FileStore._write_locks already provides single-writer exclusion at the application layer, and the handle-based API is designed for streaming large files where holding a filesystem lock for minutes would block all other operations (reads, stat, list_dir) on that file. The current approach — application-level write locks + direct file I/O — is appropriate for the access patterns. - fs_write_string simplification: The review suggested replacing the nested try/except with finally + contextlib.suppress. The current pattern correctly calls fs_close exactly once on the success path and exactly once (best-effort) on the error path before re-raising. A finally block would call close twice on the success path (once explicitly, once in finally). Equivalent behavior would require a flag variable, making it no simpler than the current code. - Integration tests for mkdir/list_dir: Test additions are valuable but are a separate concern from the code fixes in this commit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
packages/client-typescript/src/cli/rocketride.ts (1)
851-856:⚠️ Potential issue | 🟠 MajorPersist
start --argsintothis.args.
packages/client-typescript/src/cli/rocketride.ts::RocketRideCLI.cmdStart()now readsthis.args.pipeline_argsat Line 1246, but this action never sets that field. As written,rocketride start --args ...always launches with an empty argument list.💡 Minimal fix
this.args = { command: 'start', ...options, pipeline: options.pipeline, threads: parseInt(options.threads), + pipeline_args: options.args, };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/client-typescript/src/cli/rocketride.ts` around lines 851 - 856, RocketRideCLI.cmdStart currently builds this.args but never sets pipeline_args, so start --args is dropped; update cmdStart to persist the provided args by adding pipeline_args to the constructed this.args (e.g. set this.args.pipeline_args = options.args, and if downstream expects an array, convert a string input into an array or JSON-parse when appropriate) so that downstream reads (at RocketRideCLI.cmdStart and where this.args.pipeline_args is accessed) receive the user-supplied arguments.packages/ai/src/ai/account/store_providers/azure.py (1)
288-302:⚠️ Potential issue | 🟠 Major
list_files()still does blocking Azure I/O on the event loop.Only the initial
list_blobs(...)call is offloaded. The sync Azure client returns a lazy pager, so the actual network I/O happens during iteration in thefor blob in blob_listloop.💡 Suggested fix
- blob_list = await asyncio.to_thread(container_client.list_blobs, name_starts_with=blob_prefix) + def _list(): + return list(container_client.list_blobs(name_starts_with=blob_prefix)) + + blob_list = await asyncio.to_thread(_list) for blob in blob_list:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ai/src/ai/account/store_providers/azure.py` around lines 288 - 302, The list_files() function is still doing blocking I/O because container_client.list_blobs returns a lazy pager and the iteration over blob_list happens on the event loop; wrap the entire blocking iteration in a thread by calling asyncio.to_thread with a small helper that calls list(container_client.list_blobs(name_starts_with=blob_prefix)) (or otherwise fully consumes the pager) and returns the list of blob names, then run your existing prefix-stripping logic on that returned list; update references to blob_list and container_client.list_blobs in list_files() so the network I/O is performed inside the to_thread call.packages/client-typescript/src/client/client.ts (2)
1049-1056:⚠️ Potential issue | 🟠 Major
sendFiles()now fans out every upload at once.The new implementation creates one live
uploadFile()promise per input and dropped the documented concurrency control. Large batches will open all readers and pipes simultaneously, which can spike memory and overwhelm server-side upload limits. Reintroduce a small worker pool or keep an optionalmaxConcurrentparameter.Also applies to: 1167-1176
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/client-typescript/src/client/client.ts` around lines 1049 - 1056, The sendFiles function now starts an uploadFile promise for every input concurrently, which can exhaust memory and backend limits; update sendFiles (and the related overloaded variant around the other sendFiles usage) to process files with a bounded worker pool by adding an optional maxConcurrent parameter (default e.g. 4), create a small queue that launches up to maxConcurrent uploadFile calls, await completion of each before starting the next, and propagate results/errors into the returned UPLOAD_RESULT[] in the original order; reference the sendFiles function and uploadFile helper when locating where to implement the concurrency batching and parameter handling.
1100-1149:⚠️ Potential issue | 🟠 MajorClose failed upload pipes before recording the error.
If
reader.read()orpipe.write()fails after the pipe is opened, this catch only stores the error message and returns. The server-side handle then stays open until the whole client disconnects, andpackages/ai/src/ai/account/file_store.pykeeps that path write-locked until close, so retries for the same target can get stuck behind a leaked upload.🩹 Suggested change
try { // Step 1: Create and open pipe (waits for server to allocate) pipe = await this.pipe(token, this._objinfoWithSize({ name: file.name, ...objinfo }, fileSize), finalMimetype); await pipe.open(); @@ result = await pipe.close(); } catch (err) { + if (pipe?.isOpened) { + try { + await pipe.close(); + } catch { + // Best-effort cleanup + } + } error = err instanceof Error ? err.message : String(err); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/client-typescript/src/client/client.ts` around lines 1100 - 1149, The catch block currently only stores the error and returns, leaking an open pipe; update the error handling inside the upload sequence (the try around pipe = await this.pipe(...), pipe.open(), reader loop and result = await pipe.close()) to ensure the pipe is closed when an exception occurs: if a pipe was created/opened (check the local variable pipe), await pipe.close() (or call its cleanup/abort method if available) inside the catch/finally before rethrowing or returning the error, and also ensure the reader lock is released (reader.releaseLock()) if reader was acquired; reference the local variables pipe, reader, pipe.open(), pipe.write(), pipe.close() and the outer try/catch to locate where to add the cleanup.
♻️ Duplicate comments (1)
packages/client-typescript/src/client/client.ts (1)
1522-1532:⚠️ Potential issue | 🟠 MajorTreat log path fragments as single path segments.
validateId()still accepts".", andsaveLog()interpolatesbody.startTimewithout validation.projectId='.'collapses.logs/${projectId}/...to.logs/...after server-side normalization, while astartTimelike'1/2'creates nested files thatlistLogs()will never return. Reject dot-segments invalidateId()and coerce/validatestartTimebefore building the filename.🩹 Suggested change
private validateId(value: string, name: string): void { if (!value) throw new Error(`${name} is required`); + if (value === '.' || value === '..') throw new Error(`${name} must be a single path segment`); if (value.includes('/') || value.includes('\\')) throw new Error(`${name} must not contain path separators`); for (const ch of value) { if (RocketRideClient.INVALID_PATH_CHARS.has(ch) || ch.charCodeAt(0) < 0x20) { throw new Error(`${name} contains invalid characters: ${value}`); @@ - const startTime = options.contents?.body?.startTime; - if (startTime === undefined) throw new Error('contents must contain body.startTime'); + const rawStartTime = options.contents?.body?.startTime; + if (rawStartTime === undefined || rawStartTime === null) throw new Error('contents must contain body.startTime'); + if (typeof rawStartTime !== 'string' && typeof rawStartTime !== 'number') { + throw new Error('contents.body.startTime must be a string or number'); + } + const startTime = String(rawStartTime); + this.validateId(startTime, 'contents.body.startTime'); const filename = `${options.source}-${startTime}.log`;Also applies to: 1748-1756
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/client-typescript/src/client/client.ts` around lines 1522 - 1532, The current validateId and saveLog allow dot-segments and unvalidated startTime which can break path construction; update validateId (the function named validateId) to reject single-dot and double-dot segments ("." and "..") and any ID containing path separators, and update saveLog (the method saveLog) to validate and coerce options.contents.body.startTime into a safe single path segment (e.g., require it to be a string/number without slashes or replace/escape path separators) before building filename; ensure the same validation/coercion is applied where filenames are created elsewhere (see similar usage around the other save/list log code and listLogs) so listLogs can reliably find saved files.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ai/src/ai/account/file_store.py`:
- Around line 145-151: The current close_write implementation always calls
_release_handle in finally, which unlocks the path even if _store.close_write
fails; change close_write so it only releases the handle after a successful
await of self._store.close_write(handle.path, handle.context) and does not clear
write state when the commit rejects (i.e., remove the unconditional
_release_handle from the finally and call _release_handle(handle) only on
success, rethrowing the error to preserve the handle); apply the same fix to the
other symmetric close method referenced around the 266-272 area so both
_store.close_write failures leave the handle intact until a successful commit.
In `@packages/ai/src/ai/account/store.py`:
- Around line 470-487: The per-account cache in get_file_store storing FileStore
instances in _file_stores must evict idle entries to avoid unbounded growth; add
either (a) an eviction/TTL mechanism that tracks last_access timestamps on the
FileStore entries and runs a periodic cleanup method (e.g.,
evict_idle_file_stores) to remove and call a cleanup/close method on the
FileStore, or (b) expose explicit release semantics (e.g.,
close_file_store(client_id) / close_all_file_stores) that removes the key from
_file_stores and invokes FileStore.close() to free locks/handles; update
get_file_store to refresh last_access when returning an entry and ensure the
FileStore class implements a close() (or similar) cleanup method so eviction
safely releases resources.
In `@packages/client-typescript/src/cli/rocketride.ts`:
- Around line 531-534: createProgressBar currently assumes percent is within
0–100 and can call repeat() with a negative count when percent is >100 or NaN;
clamp percent to the 0..100 range (and handle non-finite values by treating them
as 0) before computing filledLength and building the bar so
CHR_BLOCK.repeat(filledLength) and CHR_LIGHT_BLOCK.repeat(width - filledLength)
never receive negative values; update all uses of percent in createProgressBar
to use the clamped value for both the bar and the displayed percent.
- Around line 1034-1036: The code uses client.fsReadString(path) which
materializes the entire file before writing; replace this with the store's
streaming API (e.g., a client method that returns a readable stream or async
iterator) so bytes are forwarded to process.stdout as they arrive; locate the
createAndConnectClient call and the fsReadString usage and change to something
like obtaining a read stream/async iterator from the client (stream/read
handle), pipe or loop over chunks writing to process.stdout, and ensure the
stream/handle and client are properly closed on finish/error.
- Around line 1056-1068: The code currently calls client.fsOpen(path, 'w')
before verifying options.file, which can create an empty remote file if the
local file is missing/unreadable; change the flow in the block that references
options.file so you preflight/open/verify the local source first (e.g., use
nodeFs.promises.access or attempt to createReadStream and await the first I/O)
and only call client.fsOpen(path, 'w') after confirming the local file is
readable; keep the existing try/catch/finally logic around client.fsWrite and
client.fsClose (references: options.file, nodeFs.createReadStream or
nodeFs.promises.access, client.fsOpen, client.fsWrite, client.fsClose, stream)
so that remote handles are only created when the local file is valid and are
always closed on error.
In `@packages/client-typescript/src/client/client.ts`:
- Around line 1409-1421: The JSDoc for saveProject (function saveProject in
client.ts) is stale: remove any mention of optimistic locking, expectedVersion
parameter, and the versioned save result (success/projectId/new version) and
update the doc to reflect the current signature which returns Promise<void>;
specifically delete descriptions for options.expectedVersion and the `@returns`
details about versioning, and replace them with a concise description that the
method saves or updates a pipeline and resolves to void (or throws on failure),
keeping references to options.projectId and options.pipeline only.
---
Outside diff comments:
In `@packages/ai/src/ai/account/store_providers/azure.py`:
- Around line 288-302: The list_files() function is still doing blocking I/O
because container_client.list_blobs returns a lazy pager and the iteration over
blob_list happens on the event loop; wrap the entire blocking iteration in a
thread by calling asyncio.to_thread with a small helper that calls
list(container_client.list_blobs(name_starts_with=blob_prefix)) (or otherwise
fully consumes the pager) and returns the list of blob names, then run your
existing prefix-stripping logic on that returned list; update references to
blob_list and container_client.list_blobs in list_files() so the network I/O is
performed inside the to_thread call.
In `@packages/client-typescript/src/cli/rocketride.ts`:
- Around line 851-856: RocketRideCLI.cmdStart currently builds this.args but
never sets pipeline_args, so start --args is dropped; update cmdStart to persist
the provided args by adding pipeline_args to the constructed this.args (e.g. set
this.args.pipeline_args = options.args, and if downstream expects an array,
convert a string input into an array or JSON-parse when appropriate) so that
downstream reads (at RocketRideCLI.cmdStart and where this.args.pipeline_args is
accessed) receive the user-supplied arguments.
In `@packages/client-typescript/src/client/client.ts`:
- Around line 1049-1056: The sendFiles function now starts an uploadFile promise
for every input concurrently, which can exhaust memory and backend limits;
update sendFiles (and the related overloaded variant around the other sendFiles
usage) to process files with a bounded worker pool by adding an optional
maxConcurrent parameter (default e.g. 4), create a small queue that launches up
to maxConcurrent uploadFile calls, await completion of each before starting the
next, and propagate results/errors into the returned UPLOAD_RESULT[] in the
original order; reference the sendFiles function and uploadFile helper when
locating where to implement the concurrency batching and parameter handling.
- Around line 1100-1149: The catch block currently only stores the error and
returns, leaking an open pipe; update the error handling inside the upload
sequence (the try around pipe = await this.pipe(...), pipe.open(), reader loop
and result = await pipe.close()) to ensure the pipe is closed when an exception
occurs: if a pipe was created/opened (check the local variable pipe), await
pipe.close() (or call its cleanup/abort method if available) inside the
catch/finally before rethrowing or returning the error, and also ensure the
reader lock is released (reader.releaseLock()) if reader was acquired; reference
the local variables pipe, reader, pipe.open(), pipe.write(), pipe.close() and
the outer try/catch to locate where to add the cleanup.
---
Duplicate comments:
In `@packages/client-typescript/src/client/client.ts`:
- Around line 1522-1532: The current validateId and saveLog allow dot-segments
and unvalidated startTime which can break path construction; update validateId
(the function named validateId) to reject single-dot and double-dot segments
("." and "..") and any ID containing path separators, and update saveLog (the
method saveLog) to validate and coerce options.contents.body.startTime into a
safe single path segment (e.g., require it to be a string/number without slashes
or replace/escape path separators) before building filename; ensure the same
validation/coercion is applied where filenames are created elsewhere (see
similar usage around the other save/list log code and listLogs) so listLogs can
reliably find saved files.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 68ebd790-8015-4902-bed3-04838243327c
📒 Files selected for processing (10)
packages/ai/src/ai/account/file_store.pypackages/ai/src/ai/account/store.pypackages/ai/src/ai/account/store_providers/azure.pypackages/ai/src/ai/account/store_providers/filesystem.pypackages/ai/src/ai/account/store_providers/s3.pypackages/ai/src/ai/modules/task/commands/cmd_task.pypackages/client-python/src/rocketride/cli/commands/store.pypackages/client-python/src/rocketride/mixins/store.pypackages/client-typescript/src/cli/rocketride.tspackages/client-typescript/src/client/client.ts
* feat(store): add handle-based streaming I/O to file store (open/read/write/close)
The store system previously had two problems: it buffered entire files
in memory for every read/write, and domain operations (save_project,
get_template, save_log, etc.) were implemented as monolithic methods
on the Store class with bespoke path construction and JSON
serialization baked in.
This change replaces that with a generic filesystem-style interface
(open, read, write, close, delete, stat, mkdir, list_dir) on
FileStore, with domain methods (save_project, get_template, save_log,
etc.) becoming thin convenience wrappers on the client SDKs that
call the generic file operations with well-known paths. The server
no longer needs to know about project/template/log semantics — it
just serves files.
The handle-based open/read/write/close pattern also enables streaming
large files without holding everything in memory, and lets each
backend use its native chunked upload API.
The open/write/close pattern is the lowest common denominator across
all three backends:
- S3: create_multipart_upload → upload_part (5 MB buffer) → complete
- Azure: stage_block (4 MB buffer) → commit_block_list
- Filesystem: open('wb') → write() → close()
Each handle is tagged with the owning connection_id so that when a
connection terminates, all its handles are force-closed (committing
whatever data has been written, not discarding it).
Changes by layer:
IStore (store.py):
- Added open_write, write_chunk, close_write, abort_write,
open_read, read_chunk, close_read with default in-memory
implementations so custom backends continue to work.
Backends (filesystem.py, s3.py, azure.py):
- FilesystemStore: holds aiofiles file descriptors across calls.
- S3Store: multipart upload with 5 MB buffer threshold; falls back
to single put_object for files under 5 MB.
- AzureBlobStore: staged blocks with 4 MB threshold; falls back to
upload_blob for small files.
- abort_write on all backends commits rather than discards.
FileStore (file_store.py — new file):
- FileHandle dataclass and FileHandleMode enum (inline, no separate
module — nothing outside FileStore imports them).
- Handle registry with per-path write locks (one writer at a time).
- close_all_handles(connection_id) for disconnect cleanup.
- read()/write() convenience methods now use handles internally.
- Fixed stat() to check directory before file (prevents filesystem
directories from being reported as files).
DAP command handler (cmd_task.py):
- fs_open, fs_read (handle-based), fs_write (handle-based), fs_close
replace the old path-based fs_read/fs_write subcommands.
- Removed domain-specific subcommands (save_project, get_template,
etc.) — these are now client-side convenience wrappers.
Disconnect cleanup (task_server.py):
- _dapbase_on_disconnected now calls close_all_handles for the
disconnecting connection.
Client SDKs (store.py, client.ts):
- fs_open/fs_read/fs_write/fs_close (Python) and
fsOpen/fsRead/fsWrite/fsClose (TypeScript) — identical shapes.
- Convenience wrappers (fs_read_string, fs_write_json, etc.) now
perform open/read|write/close internally.
- Domain methods (save_project, get_project, save_template, etc.)
are thin wrappers that serialize to JSON and write to well-known
paths using the generic file operations.
- Both SDKs use plain string handle IDs, no wrapper classes.
Tests:
- Fixed stale tests in test_store.py and test_file_store.py that
called methods removed from Store and FileStore.
- Added TestHandleIO to test_file_store.py (server-side).
- Added TestFileStoreOperations to Python client integration tests.
- Added File Store Operations to TypeScript client integration tests.
* fix(store): harden store API — validation, offset-on-read, file info, CLI fixes
The handle-based I/O added in f079c99 shipped with several gaps that
this commit addresses across the full stack (server, Python SDK, TS SDK,
both CLIs, and tests).
Security — path and ID validation
---
Paths and domain IDs (projectId, templateId, source) were interpolated
into storage keys without checking individual segments. A malicious
client_id like "../../other" or a projectId containing "*" could escape
account isolation or cause backend errors. Validation now happens at
three layers:
- Server (FileStore._validate_path): rejects *, ?, <, >, |, ", null,
and control characters per segment. __init__ rejects client_ids with
path separators or ".." values.
- Python SDK (StoreMixin._validate_store_path / _validate_id): same
rules applied before every DAP request that takes a path or domain ID.
- TS SDK (RocketRideClient.validateStorePath / validateId): same rules.
API change — move offset from open to read
---
Passing the byte offset at open time forced the server to track cursor
state internally, and gave the client no way to seek after opening.
Offset is now a parameter of read_chunk / fs_read / fsRead, letting the
client control position on every call. Convenience wrappers
(fs_read_string, fsReadString) track offset client-side in a loop.
File metadata — get_file_info, size in list_dir/stat
---
list_dir and stat previously returned only modification time for files,
and list_dir fetched it via a separate get_modified_time call. Added
IStore.get_file_info() returning {size, modified} in a single backend
call:
- Filesystem: one stat() call
- S3: one head_object call
- Azure: one get_blob_properties call
list_dir and stat now return both size (bytes) and modified (epoch
timestamp) for file entries. CLI dir output reformatted to match Windows
DIR style (date, time, <DIR> or size, name, summary counts).
Concurrency fixes in FileStore
---
- open_write: write lock was acquired after awaiting the backend, leaving
a race window at the suspension point. Lock now acquired before await,
released on failure.
- delete: rejects deletion while the path has an active write handle.
- read_chunk: negative offset rejected, length capped at MAX_CHUNK_SIZE.
- cmd_task handler: clamps client-supplied offset and length.
Broken CLI write commands
---
Both Python and TS CLIs called fs_write(path, data) — but after the
handle-based refactor, fs_write takes (handle, data). Fixed to use
fs_open/fs_write/fs_close with chunked streaming (64 KB in Python,
createReadStream in TS).
Cloud provider fixes
---
- Azure write_chunk: buffer bytes were deleted before _stage_block
completed, losing data on transient failures. Deletion now happens
after staging succeeds. close_write clears buffer after commit.
- S3 open_write: unconditionally called create_multipart_upload even for
small files, then aborted it in close_write. Multipart creation is now
deferred until the buffer first reaches 5 MB; small files use simple
put_object.
Minor fixes
---
- store.py: fallback temp path used 'dtc' instead of 'store', diverging
from the primary branch.
- task_server.py: disconnect path created a FileStore instance even when
the connection never used the store. Now checks the cache first.
- main.py: error message listed old command names (save_project, etc.)
instead of current ones (dir, type, write, rm, mkdir, stat).
- Integration tests: Python and TS test path schemes aligned to
.test-store/{lang}-{name}-{random} to prevent collision when run
concurrently.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(store): offload sync cloud SDK calls to thread pool via asyncio.to_thread
Both the Azure and S3 storage providers use synchronous SDKs (azure-storage-blob
and boto3) but are called from async methods on the event loop. With multiple
clients connected over WebSocket via the rrext_store DAP path, a blocking
upload_blob() or put_object() call freezes the entire event loop for all
connected clients.
Wrapped every synchronous SDK call in asyncio.to_thread() so network I/O runs
in the default thread pool executor:
Azure (azure.py):
- upload_blob, download_blob/readall, get_blob_properties, exists, delete_blob,
list_blobs, stage_block, commit_block_list — all offloaded
- _stage_block made async to await the to_thread call
S3 (s3.py):
- put_object, get_object/Body.read, head_object, delete_object, paginate
(list_objects_v2), create_multipart_upload, upload_part,
complete_multipart_upload, abort_multipart_upload — all offloaded
- _upload_part made async to await the to_thread call
- Multi-step operations (read + parse, paginate + collect) wrapped in
inner functions to keep the entire blocking sequence in one thread call
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(store): enforce handle ownership, fix empty-dir display, remove abort_write
Applied fixes from code review. Each finding was verified against the
current code; findings that were already addressed, architecturally
unsound, or purely stylistic were rejected with reasoning below.
Handle ownership enforcement
---
_get_handle now accepts an optional connection_id and rejects operations
from connections that don't own the handle. The cmd_task DAP handlers
pass self._connection_id on every read_chunk, write_chunk, close_write,
and close_read call. The parameter defaults to 0 (no check) so internal
callers (convenience methods, tests, close_all_handles) are unaffected.
This matters because handle IDs are UUIDs sent over the wire — without
ownership checks, a client that guesses or intercepts a handle ID from
another connection could read or write another user's open file.
Empty directory vs missing path
---
Both CLIs printed "File Not Found" when fs_list_dir returned zero
entries, which is wrong for an existing empty directory. They now call
fs_stat/fsStat to distinguish: empty dirs show a zero-count summary,
missing paths show "File Not Found".
Remove abort_write from API
---
abort_write existed on IStore and all three providers but had zero
callers — it was dead code. Rather than build out discard semantics for
an unused API surface, the method was removed entirely. If abort
semantics are needed in the future, they can be added with a clear
use case driving the design.
Silent exception swallowing in listing
---
_get_all_items (Python) and getAllProjects/getAllTemplates (TS) caught
all exceptions and silently continued when reading project/template JSON
files. This hid file corruption, permission errors, and malformed JSON
with no diagnostic output. Both now log the error at debug level before
continuing, so issues are visible in logs without breaking the listing.
Findings rejected (with reasoning)
---
- task_server.py client_id empty default: The empty string is a
dataclass initialization pattern, not a security gap. client_id is set
from _account_info.clientid after authentication succeeds, and
unauthenticated connections cannot reach the store. Adding validation
at the dataclass level would require finding and updating every
construction site for a field that is always set by the auth flow.
- cmd_task.py chunk length clamping: Already implemented in the prior
commit (ec225ed). The review was looking at stale code.
- filesystem.py lock/temp-file staging for open_write: The review
proposed acquiring the existing file lock for the entire lifetime of a
write handle and writing to a temp file with atomic rename on close.
This would be a significant architectural change that conflicts with
the current design: FileStore._write_locks already provides
single-writer exclusion at the application layer, and the handle-based
API is designed for streaming large files where holding a filesystem
lock for minutes would block all other operations (reads, stat,
list_dir) on that file. The current approach — application-level write
locks + direct file I/O — is appropriate for the access patterns.
- fs_write_string simplification: The review suggested replacing the
nested try/except with finally + contextlib.suppress. The current
pattern correctly calls fs_close exactly once on the success path and
exactly once (best-effort) on the error path before re-raising. A
finally block would call close twice on the success path (once
explicitly, once in finally). Equivalent behavior would require a
flag variable, making it no simpler than the current code.
- Integration tests for mkdir/list_dir: Test additions are valuable but
are a separate concern from the code fixes in this commit.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Rod.Christensen <rod.christensen@aparavi.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…933) Closes the 9 mechanically-fixable Scorecard `PinnedDependenciesID` alerts on this repo. Mutable tag references (`@v4`, `:tag`) become immutable hash references; Dependabot will continue to bump the SHAs as new versions ship. GitHub Actions (7 alerts): sync-models.yml actions/checkout v4 → 34e1148... #599 actions/setup-python v5 → a26af69... #600 actions/cache v4 → 0057852... #601 peter-evans/create-pull-req. v7 → 22a9089... #602 discord-discussions.yml actions/checkout v4 → 34e1148... #644 discord-issues.yml actions/checkout v4 → 34e1148... #645 discord-pr.yml actions/checkout v4 → 34e1148... #646 Docker base images (2 alerts): docker/Dockerfile.engine ubuntu:jammy-20240808 → @sha256:adbb90115a21969d2fe6fa7f9af4253e16d45f8d4c1e930182610c4731962658 #561 docker/Dockerfile.mcp python:3.12-slim → @sha256:9d3abd9fc11d06998ccdbdd93b4dd49b5ad7d67fcbbc11c016eb0eb2c2194891 #471 Both digests are the OCI image index (multi-platform manifest list), so platform resolution still happens at build time. `jammy-20240808` is already a date-pinned snapshot tag; `3.12-slim` is a floating upstream tag and was pinned at the digest current as of 2026-05-20. The remaining 6 `PinnedDependenciesID` alerts (#465, #466, #467, #468, #472, #603) flag pip/npm install commands with already-exact version pins (`twine==6.1.0`, `@vscode/vsce@3.7.1`, `ovsx@0.10.9`, etc.). Scorecard wants `pip install --require-hashes` or lockfile-driven installs for these; the ergonomics of doing that for one-shot workflow installs (and for the `./client-python` local-path install in Dockerfile.mcp, which can't be hash-pinned at all) outweigh the incremental supply-chain hardening over an already-exact version constraint. Those alerts are being dismissed separately with "won't fix" + per-alert justification.
* fix(security): prevent arbitrary module injection via /use endpoint (RCE) (#342)
* docs: add project rules for claude code
* fix(security): add module whitelist to prevent arbitrary code injection via /use endpoint
The /use endpoint accepts a module name from the HTTP query string and
passes it directly to importlib.import_module() with only lowercase/strip
normalization. This allows an attacker to load arbitrary Python modules
by sending crafted requests, potentially achieving remote code execution.
Add an ALLOWED_MODULES frozenset whitelist that restricts dynamic imports
to the 10 known service modules (chat, clients, data, dropper, pipe,
profiler, remote, services, task, task_http). Requests for any other
module name now raise ValueError, returning a 400 response.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add language identifier to markdown code fence
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(security): require authentication for profiler endpoints
All 5 profiler endpoints (/profile, /profile/start, /profile/stop,
/profile/status, /profile/report) were registered with public=True,
bypassing the AuthMiddleware entirely. This allows unauthenticated
users to start/stop profiling and read performance reports that expose
internal function names, call counts, and timing data.
Remove public=True from all profiler route registrations so they
require authentication like other protected endpoints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: correct HTTP method in profiler docs (PUT → POST)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: remove claude.md from version control
This file is project-specific AI tooling configuration and should not
be tracked in git. Added to .gitignore instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test(security): add tests for ALLOWED_MODULES allowlist validation
Verify that:
- ALLOWED_MODULES is an immutable frozenset with the expected 10 entries
- use() rejects non-allowlisted modules and path traversal attempts
- use() accepts valid modules and calls initModule correctly
- use() normalizes module names (lower + strip)
- use() skips already-loaded modules without re-importing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(security): address CodeRabbit review feedback on test_server.py
- Fix S104: change stub host from 0.0.0.0 to 127.0.0.1
- Add return type annotation to _make_server() -> WebServer
- Track injected sys.modules mocks and clean up in teardown_module()
- Assert cached module's initModule is not re-called in reload test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: minor changes
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: stepmik <stepmikhaylov@yandex.ru>
* fix(security): prevent filter expression injection in Milvus vector store (#355)
* fix(security): prevent filter expression injection in Milvus vector store
Add _escape_milvus_str() helper to sanitize user-controlled values
before interpolation into Milvus filter expressions. Escapes single
quotes and backslashes to prevent filter injection attacks across all
query construction points in the Milvus store implementation.
* fix: address review feedback on Milvus filter injection PR
- Remove unnecessary tuple wrappers on append calls
- Fix isTable filter using wrong field (docFilter.nodeId -> docFilter.isTable)
- Use unquoted boolean for isTable filter (matches isDeleted pattern)
- Add type annotation and docstring to _escape_milvus_str
* fix: move test to nodes/test/ per project conventions
* fix(security): use secure temporary file creation in task engine (#356)
* fix(security): use secure temporary file creation in task engine
Replace insecure predictable temp file path with tempfile.mkstemp()
to prevent information disclosure and symlink attacks.
_write_task_file previously wrote pipeline config (which may contain
API keys and resolved env vars) to /tmp/<task-id>.json with default
0644 permissions. This was vulnerable to:
- World-readable files exposing sensitive pipeline configuration
- Symlink attacks due to predictable path based on task ID
- TOCTOU races from lack of O_EXCL exclusive creation
mkstemp() creates the file atomically with O_EXCL, uses a random
suffix making the path unpredictable, and defaults to 0600 permissions
(owner read/write only).
Uses await asyncio.to_thread(os.write, ...) for async compatibility.
Tests use asyncio.run() instead of deprecated get_event_loop().
* fix: address CodeRabbit findings on temp file PR
- Use os.fdopen + f.write instead of os.write to prevent partial writes
- Remove unused tempfile import in tests
- Add @skipIf(os.name == 'nt') on POSIX-specific tests
* chore: minor changes
---------
Co-authored-by: stepmik <stepmikhaylov@yandex.ru>
* fix(security): require authentication for profiler endpoints and escape HTML output (#362)
* fix(security): require authentication for profiler endpoints and escape HTML output
Remove public=True from all 5 profiler routes so they require authentication
via AuthMiddleware, and HTML-escape the profile report output to prevent XSS.
* fix: improve profiler XSS tests to verify actual endpoint output
* fix: revert conftest.py changes, scope mocks to test file
Remove depends and rocketride mocks from conftest.py (they break
other tests per asclearuc). Move stubs into the profiler test file
where they're needed, scoped locally.
* fix(ci): pin all actions to immutable commit hash (#483)
* chore(ci): remove PR title validation check (#502)
Co-authored-by: Dmitrii Karataev <dmitriikarataev@Dmitriis-MacBook-Pro.local>
* Fix: SDK connect error callback type (#576)
* fix(client-ts): correct ConnectErrorCallback type signature
The callback type expected (message: string) => Promise<void> but
the implementation passes Error objects and callers may return void
instead of Promise<void>. Updated to accept Error | string and
return void | Promise<void>.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(client-ts): use ConnectionException in ConnectErrorCallback type
Address maintainer feedback:
- Replace Error | string with ConnectionException from exceptions module
- Pass ConnectionException object directly to callback instead of extracting message string
- Keep void | Promise<void> return type as approved
- Fix invocation site in client.ts to construct ConnectionException when needed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(apps): migrate onConnectError handlers to accept ConnectionException
Update three call sites to match the new ConnectErrorCallback type
signature that accepts ConnectionException instead of a plain string.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(client-ts): revert formatting changes
---------
Co-authored-by: NIHAL NIHALANI <nihal.nihalani@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: stepmik <stepmikhaylov@yandex.ru>
* fix(llm): clear correct _chat reference in endGlobal across all LLM nodes (#531)
All LLM node IGlobal classes assigned the Chat instance to `self._chat`
in `beginGlobal`, but `endGlobal` cleared `self.chat` (no underscore) —
a different attribute that was never set. This meant `endGlobal` was a
no-op: the Chat object was never explicitly released when a pipeline
stopped.
Fixed in 12 nodes: llm_anthropic, llm_bedrock, llm_deepseek, llm_gemini,
llm_ibm_watson, llm_mistral, llm_ollama, llm_openai, llm_perplexity,
llm_qwen, llm_vertex, llm_xai.
llm_vision_ollama and llm_vision_mistral were already correct.
* feat(llm): add GMI Cloud LLM connector (#540)
Adds a new LLM node for GMI Cloud (api.gmi-serving.com), an OpenAI-compatible
inference platform hosting 100+ models including DeepSeek, GPT, Claude, Gemini,
Llama 4, and Qwen3 on owned H100/H200 GPU infrastructure.
## Profiles
Two model tiers are supported:
Shared (always-on) — API key only required:
DeepSeek V3.2, V3, R1, R1 Distill 32B & 1.5B, Prover V2
GPT-5.2, 5.1, 5, 4o
Claude Opus 4.5, Sonnet 4.5
Gemini 3 Pro, Gemini 3 Flash
Deploy-on-demand — endpoint URL + API key required (deploy first at
console.gmicloud.ai, then paste the provided endpoint URL):
Llama 4 Scout, Llama 4 Maverick
Qwen3 235B, 32B, 30B, Coder 480B
A custom profile allows specifying any model name and endpoint URL manually.
* fix(security): use pathlib.is_relative_to for path traversal checks (#580)
Replace fragile str().startswith() path traversal checks with
Path.is_relative_to() in chat and dropper modules. The string prefix
comparison could be bypassed with crafted paths like /app/static/chat-evil/.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(security): switch SQL safety check from blacklist to whitelist approach (#577)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(security): expand sensitive field redaction patterns in VS Code logger (#578)
The redactSensitiveFields function only checked for auth-key, token-key,
and apikey patterns. This missed commonly used sensitive fields like
password, secret, authorization, bearer, credential, access_token,
refresh_token, and private_key, which could be logged unredacted.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add Product Hunt badge to all READMEs (#590)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* chore(community): add initial Code of Conduct (#591)
Establish baseline community guidelines for inclusive collaboration.
Intentionally kept lightweight to be expanded over time.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* docs: fix broken image links in README — use absolute URLs (#506)
* fix(vscode): remove Product Hunt SVG badge from VS Code README — marketplace rejects SVGs
* fix(vscode): add Product Hunt badge as PNG — marketplace rejects SVGs
* fix(security): restrict environment variable expansion in pipeline configs (#359)
* fix(security): restrict environment variable expansion in pipeline configs
Add an allowlist of permitted env var prefixes (ROCKETRIDE_, PIPELINE_,
NODE_, ROCKET_) to _resolve_pipeline(). All other ${VAR} references are
replaced with <REDACTED> to prevent exfiltration of sensitive environment
variables (AWS keys, DB URLs, tokens) via pipeline configuration.
* chore(ai): allow ROCKETRIDE_ prefixed variables
* chore(ai): check json injection
---------
Co-authored-by: stepmik <stepmikhaylov@yandex.ru>
* fix(client-ts): preserve user-specified port in normalizeUri (#377)
The URL API silently strips ports that are default-for-scheme (e.g. :443
on https), so url.port is empty for both "no port given" and
"scheme-default port given". This caused normalizeUri to always overwrite
with the default 5565 port, breaking connections through ngrok/Cloudflare
tunnels and custom reverse proxies.
Check the raw input string for an explicit port pattern before deciding
whether to apply the default port.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(connection): handle missing hostname in URI parsing (#530)
* Update connection.py
* cr
* Update dap_base.py (#532)
* Update execution.py (#537)
* feat(nodes): config - add deprecation pathway for deprecated profiles (#504)
* deprecation pathway
* coderabbit suggestions
* add tests
* cr
* fix build
* fix build
* Update conftest.py
* Update conftest.py
* Update conftest.py
* Update conftest.py
* simplify
* simplify
* fix(mixins): error handling for missing pipeline configuration files (#544)
* fix(nodes): openai - add latest openai models (#503)
* add latest openai model profiles
* coderabbit fixes
* fix typo (we didn't introduce)
* don't change default
* Update services.json
* Update services.json
* fix(nodes): remove deprecated gemini models (#500)
* remove gemini 3 pro (deprecated), gemini 2
* code rabbit response
* coderabbit
* Update services.json
* Update services.json
* feat: #429 Add Exa search node and working sample pipeline [FRONTIER TOWER HACKATHON] (#386)
* Add Exa search node and stable pipeline
* Harden Exa search node runtime handling
* Fix Exa fallback question parsing
* Fix Exa mock credential test wiring
* Assert Exa mock request contract
* Tighten Exa API exception types
* Document Exa node lifecycle hooks
* Handle unsafe Exa result URLs per item
* Clean up Exa backend from endpoint bag
* Unpin Exa node requests dependency
* Add comments to Exa service definition
* Add Exa search docstrings
* Parse Exa boolean config defensively
* Guard Exa error payload parsing
* revert: remove Exa node test changes
* revert: restore base test framework behavior
* chore: drop test framework whitespace diff
---------
Co-authored-by: Kaushik Sivakumar <kaushik.siva88@gmail.com>
* fix(vscode): register canvas-played pipelines in sidebar menu (#571)
* feat(vscode): improve stop button feedback in Pipeline Observability screen
Handle TASK_STATE.STOPPING in the control button to show "Stopping..."
with a disabled state and distinct orange styling, preventing duplicate
clicks and giving immediate visual feedback during pipeline shutdown.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(vscode): register canvas-played pipelines in sidebar menu
The PIPELINES sidebar failed to track pipelines started from the canvas
because source-component detection relied solely on config.mode being
set to "Source". The canvas editor never writes that field — only the
C++ engine adds it at execution time — so freshly saved .pipe files
from the canvas had zero recognised source components.
Three changes fix the issue:
1. PipelineFileParser.getSourceComponents now accepts an optional
service catalog and also checks each component's provider classType
array for "source", matching the same logic the canvas uses to
decide which nodes get a Run button.
2. SidebarFilesProvider passes the cached service catalog to the parser
when loading/re-parsing files, and re-parses all files when the
catalog first arrives (servicesUpdated) so that files parsed before
connect are retroactively enriched.
3. handleEvent now handles the "restart" apaevt_task action, which the
server sends instead of "begin" when a pipeline is restarted. Without
this, restarted pipelines silently dropped out of the active set.
Closes #396
#Hack-with-bay-2
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(test): resolve flaky timeouts and hanging in concurrent pipeline tests (#561)
The stress test (4 pipelines x 32 cycles) used a 30s hard-coded timeout
that was too tight for CI runners, causing both Jest timeout errors and
"Connection closed" failures under load. Several other concurrent tests
had the same issue. Test teardown could also hang indefinitely if a
WebSocket connection failed to close cleanly.
Root causes addressed:
- Hard-coded 30s timeouts on concurrent tests replaced with
TEST_CONFIG.timeout (120s) matching the rest of the suite
- Added single-retry with backoff in the stress test to handle transient
"Connection closed" errors from server-side frame drops under load
- Added bounded timeouts to all afterEach teardown blocks so cleanup
never hangs the runner
- Added forceExit to jest.config.js so Jest exits even with leaked handles
- Added pytest-timeout (120s default) in pyproject.toml to prevent
individual Python tests from hanging indefinitely
- Removed deprecated event_loop fixture from conftest.py (replaced by
pytest-asyncio auto mode)
- Added asyncio_mode = "auto" to pyproject.toml for consistent async
test handling
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(vscode): change play button to show actionable text instead of current state (#575)
- Rename idle label from "Play" to "Run Pipeline" for clearer intent
- Add STOPPING state with "Stopping..." disabled button to prevent
double-clicks and provide immediate visual feedback during shutdown
- Widen hover expansion to accommodate longer label text
- Smooth CSS transitions with easing functions for polished UX
Closes #398
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(ci): add build passthrough for docs-only PRs (#607)
When a PR only changes docs/README files, the Build job is correctly
skipped. But branch protection requires "Build / Ubuntu 22.04",
"Build / macOS (ARM64)", and "Build / Windows Server 2022" checks
to pass. The skipped jobs never report status, so PRs hang forever.
Add a build-skip job that runs on docs-only PRs and reports success
under the same check names, satisfying branch protection without
running actual builds.
Co-authored-by: Dmitrii <dmitrii@Dmitriis-MacBook-Pro-2.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore(docs): reorder README header (#594)
* chore(docs): reorder README header — move language icons above description
Swaps the position of the language icon badges and the project
description so the icons appear more prominently. Also removes
fixed height attributes to let icons render at their native size.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): move closing div to include screenshots in header block
Extends the centered header div to wrap the screenshot images and
captions so they inherit the same alignment as the rest of the hero
section.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): remove Product Hunt badges from all READMEs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): reformat features section as table and update install screenshot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): simplify features table — remove icons column
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): theme-aware language icons and replace emojis with unicode
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): revert language icons to original native-color PNGs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): reorder README header — move language icons above description
Swaps the position of the language icon badges and the project
description so the icons appear more prominently. Also removes
fixed height attributes to let icons render at their native size.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): move closing div to include screenshots in header block
Extends the centered header div to wrap the screenshot images and
captions so they inherit the same alignment as the rest of the hero
section.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): remove Product Hunt badges from all READMEs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): reformat features section as table and update install screenshot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): simplify features table — remove icons column
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): theme-aware language icons and replace emojis with unicode
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): revert language icons to original native-color PNGs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): rename engine badge to Runtime and capitalize License
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(docs): capitalize all badge labels for consistency
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat(engine): support for experimental capability (#606)
* feat(engine): support for experimental capability
* feat(engine): support for experimental capability
* feat(engine): add DEPRECATED capability bit, move EXPERIMENTAL to BIT(16), and surface experimental badge in UI
- Insert DEPRECATED = BIT(15) into PROTOCOL_CAPS so services.json can
flag drivers as deprecated; shift EXPERIMENTAL from BIT(15) to BIT(16).
- Wire "deprecated" string in services.cpp parser and expose the new
constant via pybind11 bindings.
- Add PROTOCOL_CAPS enum to both client SDKs (TypeScript and Python)
with all 17 capability flags.
- Add Experimental flag (1 << 16) to the shared-ui IServiceCapabilities
enum.
- Render a yellow "EXPERIMENTAL" / "Experimental" badge on canvas nodes,
the Add Node slider, and the Quick Add popup when a service carries
the experimental capability.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Rod.Christensen <rod.christensen@aparavi.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(store): handle-based streaming I/O for file store (#600)
* feat(store): add handle-based streaming I/O to file store (open/read/write/close)
The store system previously had two problems: it buffered entire files
in memory for every read/write, and domain operations (save_project,
get_template, save_log, etc.) were implemented as monolithic methods
on the Store class with bespoke path construction and JSON
serialization baked in.
This change replaces that with a generic filesystem-style interface
(open, read, write, close, delete, stat, mkdir, list_dir) on
FileStore, with domain methods (save_project, get_template, save_log,
etc.) becoming thin convenience wrappers on the client SDKs that
call the generic file operations with well-known paths. The server
no longer needs to know about project/template/log semantics — it
just serves files.
The handle-based open/read/write/close pattern also enables streaming
large files without holding everything in memory, and lets each
backend use its native chunked upload API.
The open/write/close pattern is the lowest common denominator across
all three backends:
- S3: create_multipart_upload → upload_part (5 MB buffer) → complete
- Azure: stage_block (4 MB buffer) → commit_block_list
- Filesystem: open('wb') → write() → close()
Each handle is tagged with the owning connection_id so that when a
connection terminates, all its handles are force-closed (committing
whatever data has been written, not discarding it).
Changes by layer:
IStore (store.py):
- Added open_write, write_chunk, close_write, abort_write,
open_read, read_chunk, close_read with default in-memory
implementations so custom backends continue to work.
Backends (filesystem.py, s3.py, azure.py):
- FilesystemStore: holds aiofiles file descriptors across calls.
- S3Store: multipart upload with 5 MB buffer threshold; falls back
to single put_object for files under 5 MB.
- AzureBlobStore: staged blocks with 4 MB threshold; falls back to
upload_blob for small files.
- abort_write on all backends commits rather than discards.
FileStore (file_store.py — new file):
- FileHandle dataclass and FileHandleMode enum (inline, no separate
module — nothing outside FileStore imports them).
- Handle registry with per-path write locks (one writer at a time).
- close_all_handles(connection_id) for disconnect cleanup.
- read()/write() convenience methods now use handles internally.
- Fixed stat() to check directory before file (prevents filesystem
directories from being reported as files).
DAP command handler (cmd_task.py):
- fs_open, fs_read (handle-based), fs_write (handle-based), fs_close
replace the old path-based fs_read/fs_write subcommands.
- Removed domain-specific subcommands (save_project, get_template,
etc.) — these are now client-side convenience wrappers.
Disconnect cleanup (task_server.py):
- _dapbase_on_disconnected now calls close_all_handles for the
disconnecting connection.
Client SDKs (store.py, client.ts):
- fs_open/fs_read/fs_write/fs_close (Python) and
fsOpen/fsRead/fsWrite/fsClose (TypeScript) — identical shapes.
- Convenience wrappers (fs_read_string, fs_write_json, etc.) now
perform open/read|write/close internally.
- Domain methods (save_project, get_project, save_template, etc.)
are thin wrappers that serialize to JSON and write to well-known
paths using the generic file operations.
- Both SDKs use plain string handle IDs, no wrapper classes.
Tests:
- Fixed stale tests in test_store.py and test_file_store.py that
called methods removed from Store and FileStore.
- Added TestHandleIO to test_file_store.py (server-side).
- Added TestFileStoreOperations to Python client integration tests.
- Added File Store Operations to TypeScript client integration tests.
* fix(store): harden store API — validation, offset-on-read, file info, CLI fixes
The handle-based I/O added in f079c994 shipped with several gaps that
this commit addresses across the full stack (server, Python SDK, TS SDK,
both CLIs, and tests).
Security — path and ID validation
---
Paths and domain IDs (projectId, templateId, source) were interpolated
into storage keys without checking individual segments. A malicious
client_id like "../../other" or a projectId containing "*" could escape
account isolation or cause backend errors. Validation now happens at
three layers:
- Server (FileStore._validate_path): rejects *, ?, <, >, |, ", null,
and control characters per segment. __init__ rejects client_ids with
path separators or ".." values.
- Python SDK (StoreMixin._validate_store_path / _validate_id): same
rules applied before every DAP request that takes a path or domain ID.
- TS SDK (RocketRideClient.validateStorePath / validateId): same rules.
API change — move offset from open to read
---
Passing the byte offset at open time forced the server to track cursor
state internally, and gave the client no way to seek after opening.
Offset is now a parameter of read_chunk / fs_read / fsRead, letting the
client control position on every call. Convenience wrappers
(fs_read_string, fsReadString) track offset client-side in a loop.
File metadata — get_file_info, size in list_dir/stat
---
list_dir and stat previously returned only modification time for files,
and list_dir fetched it via a separate get_modified_time call. Added
IStore.get_file_info() returning {size, modified} in a single backend
call:
- Filesystem: one stat() call
- S3: one head_object call
- Azure: one get_blob_properties call
list_dir and stat now return both size (bytes) and modified (epoch
timestamp) for file entries. CLI dir output reformatted to match Windows
DIR style (date, time, <DIR> or size, name, summary counts).
Concurrency fixes in FileStore
---
- open_write: write lock was acquired after awaiting the backend, leaving
a race window at the suspension point. Lock now acquired before await,
released on failure.
- delete: rejects deletion while the path has an active write handle.
- read_chunk: negative offset rejected, length capped at MAX_CHUNK_SIZE.
- cmd_task handler: clamps client-supplied offset and length.
Broken CLI write commands
---
Both Python and TS CLIs called fs_write(path, data) — but after the
handle-based refactor, fs_write takes (handle, data). Fixed to use
fs_open/fs_write/fs_close with chunked streaming (64 KB in Python,
createReadStream in TS).
Cloud provider fixes
---
- Azure write_chunk: buffer bytes were deleted before _stage_block
completed, losing data on transient failures. Deletion now happens
after staging succeeds. close_write clears buffer after commit.
- S3 open_write: unconditionally called create_multipart_upload even for
small files, then aborted it in close_write. Multipart creation is now
deferred until the buffer first reaches 5 MB; small files use simple
put_object.
Minor fixes
---
- store.py: fallback temp path used 'dtc' instead of 'store', diverging
from the primary branch.
- task_server.py: disconnect path created a FileStore instance even when
the connection never used the store. Now checks the cache first.
- main.py: error message listed old command names (save_project, etc.)
instead of current ones (dir, type, write, rm, mkdir, stat).
- Integration tests: Python and TS test path schemes aligned to
.test-store/{lang}-{name}-{random} to prevent collision when run
concurrently.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(store): offload sync cloud SDK calls to thread pool via asyncio.to_thread
Both the Azure and S3 storage providers use synchronous SDKs (azure-storage-blob
and boto3) but are called from async methods on the event loop. With multiple
clients connected over WebSocket via the rrext_store DAP path, a blocking
upload_blob() or put_object() call freezes the entire event loop for all
connected clients.
Wrapped every synchronous SDK call in asyncio.to_thread() so network I/O runs
in the default thread pool executor:
Azure (azure.py):
- upload_blob, download_blob/readall, get_blob_properties, exists, delete_blob,
list_blobs, stage_block, commit_block_list — all offloaded
- _stage_block made async to await the to_thread call
S3 (s3.py):
- put_object, get_object/Body.read, head_object, delete_object, paginate
(list_objects_v2), create_multipart_upload, upload_part,
complete_multipart_upload, abort_multipart_upload — all offloaded
- _upload_part made async to await the to_thread call
- Multi-step operations (read + parse, paginate + collect) wrapped in
inner functions to keep the entire blocking sequence in one thread call
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(store): enforce handle ownership, fix empty-dir display, remove abort_write
Applied fixes from code review. Each finding was verified against the
current code; findings that were already addressed, architecturally
unsound, or purely stylistic were rejected with reasoning below.
Handle ownership enforcement
---
_get_handle now accepts an optional connection_id and rejects operations
from connections that don't own the handle. The cmd_task DAP handlers
pass self._connection_id on every read_chunk, write_chunk, close_write,
and close_read call. The parameter defaults to 0 (no check) so internal
callers (convenience methods, tests, close_all_handles) are unaffected.
This matters because handle IDs are UUIDs sent over the wire — without
ownership checks, a client that guesses or intercepts a handle ID from
another connection could read or write another user's open file.
Empty directory vs missing path
---
Both CLIs printed "File Not Found" when fs_list_dir returned zero
entries, which is wrong for an existing empty directory. They now call
fs_stat/fsStat to distinguish: empty dirs show a zero-count summary,
missing paths show "File Not Found".
Remove abort_write from API
---
abort_write existed on IStore and all three providers but had zero
callers — it was dead code. Rather than build out discard semantics for
an unused API surface, the method was removed entirely. If abort
semantics are needed in the future, they can be added with a clear
use case driving the design.
Silent exception swallowing in listing
---
_get_all_items (Python) and getAllProjects/getAllTemplates (TS) caught
all exceptions and silently continued when reading project/template JSON
files. This hid file corruption, permission errors, and malformed JSON
with no diagnostic output. Both now log the error at debug level before
continuing, so issues are visible in logs without breaking the listing.
Findings rejected (with reasoning)
---
- task_server.py client_id empty default: The empty string is a
dataclass initialization pattern, not a security gap. client_id is set
from _account_info.clientid after authentication succeeds, and
unauthenticated connections cannot reach the store. Adding validation
at the dataclass level would require finding and updating every
construction site for a field that is always set by the auth flow.
- cmd_task.py chunk length clamping: Already implemented in the prior
commit (ec225ed3). The review was looking at stale code.
- filesystem.py lock/temp-file staging for open_write: The review
proposed acquiring the existing file lock for the entire lifetime of a
write handle and writing to a temp file with atomic rename on close.
This would be a significant architectural change that conflicts with
the current design: FileStore._write_locks already provides
single-writer exclusion at the application layer, and the handle-based
API is designed for streaming large files where holding a filesystem
lock for minutes would block all other operations (reads, stat,
list_dir) on that file. The current approach — application-level write
locks + direct file I/O — is appropriate for the access patterns.
- fs_write_string simplification: The review suggested replacing the
nested try/except with finally + contextlib.suppress. The current
pattern correctly calls fs_close exactly once on the success path and
exactly once (best-effort) on the error path before re-raising. A
finally block would call close twice on the success path (once
explicitly, once in finally). Equivalent behavior would require a
flag variable, making it no simpler than the current code.
- Integration tests for mkdir/list_dir: Test additions are valuable but
are a separate concern from the code fixes in this commit.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Rod.Christensen <rod.christensen@aparavi.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tools): Replace tool declarations @tool_function decorators on IInstanceBase (#599)
* refactor(engine): replace ToolsBase driver classes with @tool_function decorators on IInstanceBase
Every tool-providing node previously required two parallel classes: an
IInstance (pipeline integration) and a ToolsBase driver (tool definitions).
The driver implemented three abstract methods (_tool_query, _tool_validate,
_tool_invoke) and the IInstance wired them together with boilerplate
delegation in invoke(). This created a parallel system that was hard to
understand and tedious to write — the driver often just called back into
the instance for the actual work, and every node repeated the same
delegation pattern.
The root cause was that tool declaration was separate from the class that
actually owned the state and connections needed to execute the tool. A
MySQL node's IInstance had the database connection, the LLM access, and
the lane handlers — but its tool definitions lived in a MySQLDriver class
that had to reach back into the instance for everything.
This commit collapses both layers into one by adding @invoke_function and
@tool_function decorators directly to IInstanceBase in rocketlib/filters.py.
Any IInstanceBase subclass can now declare tool entry points with a
decorator — the method name becomes the tool ID, the decorator carries the
schema and description, and the base class invoke() dispatches
automatically. No separate driver class, no factory method, no delegation.
Usage example — static tool:
from rocketlib import IInstanceBase, tool_function
class IInstance(IInstanceBase):
IGlobal: IGlobal
@tool_function(
input_schema={
'type': 'object',
'required': ['url', 'method'],
'properties': {
'url': {'type': 'string'},
'method': {'type': 'string', 'enum': ['GET', 'POST']},
},
},
description='Make an HTTP request.',
)
def http_request(self, args):
if args['method'] not in self.IGlobal.enabled_methods:
raise ValueError('Method not allowed')
return execute_request(url=args['url'], method=args['method'])
Usage example — dynamic description from config:
class DatabaseInstanceBase(IInstanceBase):
@tool_function(
input_schema={...},
description=lambda self: (
f'Query the {self._db_display_name()} database. '
f'Just describe what data you need.'
),
)
def get_data(self, args):
...
Usage example — dynamic tools (MCP, tools discovered at runtime):
class IInstance(IInstanceBase):
def _tool_query_dynamic(self):
return self.IGlobal.list_namespaced_tools()
def _tool_invoke_dynamic(self, *, tool_name, input_obj):
server, bare = tool_name.split('.', 1)
return self.IGlobal.call_tool(server, bare, input_obj)
The decorator system follows the existing control/invoke layering:
control() <- engine entry point, rarely overridden
└─ invoke() <- dispatches on param.op
├─ tool.* -> @tool_function methods (tool.query builds
| descriptors, tool.invoke calls the method)
└─ other ops -> @invoke_function methods (op name = method name)
Key design decisions:
- Decorators live in rocketlib/filters.py with zero upstream dependencies.
The declaration plumbing (ToolDescriptor, @tool_function, @invoke_function,
dispatch logic) is entirely self-contained in the engine base layer.
- No tool name prefix. Tool IDs are bare method names (e.g. 'get_data',
not 'mysql.get_data'). The agent host already namespaces by nodeId to
prevent collisions between multiple nodes of the same type.
- No separate validation step. tool.validate is removed from the dispatch.
Validation is guard clauses at the top of the function body — simpler,
more obvious, impossible to forget.
- Decorator parameters accept static values or callables. Roughly half of
all tools need runtime config in their descriptions (e.g. the user-entered
database description, allowed import lists, display names). These use
lambda self: ... which is resolved at tool.query time when self.IGlobal
is available. This is a first-class pattern, not an escape hatch.
- User-entered tool descriptions are auto-prepended. The "tool" field from
the node config (e.g. "This is a database of world cities") is read via
_tool_config_description() and prepended to every @tool_function's
description automatically. Individual decorators only provide the fixed
part.
- Dynamic tools (MCP) use _tool_query_dynamic / _tool_invoke_dynamic
overrides on IInstanceBase for tools discovered at runtime from external
servers. Only MCP needs this.
- Backward compatible with the agent-as-tool pattern. The four agent nodes
still use _AgentAsToolProvider via ToolsBase — they are not tool nodes in
the decorator sense, they use a different mechanism for exposing
themselves as tools to other agents.
Migrated nodes:
- chart_chartjs: generate_chart (also eliminated the set_llm_invoker
callback — IInstance calls self.instance.invoke('llm', ...) directly)
- tool_python: execute
- tool_http_request: http_request
- tool_firecrawl: scrape_url, map_url
- memory_internal: put, get, list, clear
- db_mysql, db_postgres: get_data, get_schema, get_sql (via
DatabaseInstanceBase with callable descriptors for display names)
- db_neo4j: get_data, get_schema, get_cypher
- mcp_client: dynamic tools via _tool_query_dynamic/_tool_invoke_dynamic
Deleted (11 files, ~1600 lines):
- All *_driver.py files (http, python, firecrawl, chartjs, memory, mcp,
mysql, postgres, neo4j)
- packages/ai/src/ai/common/database/db_driver_base.py
- DatabaseDriverBase removed from database __init__.py exports
Updated imports:
- Agent framework drivers (langchain, crewai, deepagent) and AgentBase
now use ToolDescriptor from rocketlib instead of ToolsBase.ToolDescriptor
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(nodes): fix tool schema key mismatch, harden node implementations
The @tool_function decorator builds ToolDescriptors with camelCase keys
(inputSchema, outputSchema) but three of the four agent drivers were
reading snake_case (input_schema), silently getting None for every
tool's parameter schema. The LLM never saw real parameter definitions —
it always fell back to a generic "accept anything" schema.
Tool schema fix (3 agent drivers)
---
- agent_langchain: td.get('input_schema') → td.get('inputSchema')
- agent_deepagent: td.get('input_schema') → td.get('inputSchema')
- agent_crewai: already handled both with fallback; simplified to
td.get('inputSchema') for consistency
llm_base: replace manual dispatch with @invoke_function
---
The manual match/case block in llm_base/IInstance.py duplicated what the
base class invoke() auto-dispatcher already provides. Replaced with four
@invoke_function decorated methods (ask, getContextLength,
getOutputLength, getTokenCounter). Removed the now-unused IInvokeLLM
import.
Node hardening (from code review)
---
- chart_chartjs: inverted ternary → idiomatic `description or "default"`
- memory_internal: _store type MemoryStore → MemoryStore | None; put/get/
clear raise ValueError on non-dict args instead of silently coercing
- tool_firecrawl: metadata.model_dump() exception now logged via warning;
JSON parse catch narrowed to JSONDecodeError/TypeError with log
- tool_http_request/IGlobal: mutable class-level set()/[] defaults →
None; typing.Set/List → built-in set/list
- tool_http_request/IInstance: str(body_json) fallback → json.dumps() so
non-dict/list/str values produce valid JSON
- tool_python/IGlobal: typing.Set → built-in set; removed unused imports
- db_instance_base: int(raw_limit) wrapped in try/except, falls back to
250 on parse error instead of raising
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(nodes): address PR review findings — input validation, lint, and hardening
- langchain: fix ANN401/ARG002/UP037 on bind_tools signature
- chart_chartjs: reject non-list/dict data, cap serialized payload at 20KB,
validate and normalize LLM JSON output before wrapping in chartjs fence
- llm_base: rename unused param → _param on invoke handlers (ARG002)
- tool_firecrawl: simplify formats array → single format string, redact raw
payload from warning log
- tool_http_request: fail-fast validation on auth/body types and nested
fields; fail-closed on malformed urlWhitelist in guardrails
- tool_python: validate json.loads result is a list before iterating
- memory_internal: enforce key type/presence in put/get/clear, add dict
check to list handler
- db_instance_base: add missing valid boolean to success/failure return
dicts; fix stale _create_driver docstring → _db_display_name()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Rod.Christensen <rod.christensen@aparavi.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: add Discord notifications for PRs, issues, and discussions (#612)
- Posts to separate Discord channels via webhooks on PR open, issue
open, and discussion create events
- Uses jq for safe JSON construction (avoids shell escaping issues)
- Truncates body to 1500 chars with unclosed code block detection
- Webhook URLs stored as GitHub Secrets
- Uses GitHub Actions (not native /github endpoint which is unreliable
for discussions per Reddit r/discordapp consensus)
Closes #610
Co-authored-by: Dmitrii <dmitrii@Dmitriis-MacBook-Pro-2.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(vscode,engine): Add server monitor (#595)
* refactor(engine): remove ServicePython log level in favor of DebugOut
ServicePython was a dedicated trace level only used by the Python
service layer, but it duplicated what DebugOut already provides.
Consolidating into DebugOut simplifies the Lvl enum surface, removes
a Python-specific flag that callers had to know about separately,
and makes trace configuration more intuitive — `--trace=debugOut`
now covers Python service output alongside other debug tracing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(sdk): add dashboard API and client identification to auth handshake
The server's new rrext_dashboard command provides real-time visibility into
connections, tasks, and aggregate metrics — but neither SDK could call it.
This adds getDashboard() (TS) and get_dashboard() (Python) with full type
definitions so consumers like the VS Code extension can surface server
health without raw DAP calls.
Both SDKs now also accept clientName/clientVersion config options and
forward them during the auth handshake. This lets the server distinguish
which client is connected (e.g. "VS Code 0.9.4" vs "CLI 1.2.0"), which
the dashboard surfaces in each connection's clientInfo field.
The Python DAPClient also now skips the auth message when the transport
lacks get_auth() (e.g. stdio to a subprocess), fixing a crash for
non-WebSocket transports that don't implement DAP authentication.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(vscode): add server monitoring dashboard and fix subscription stomping
Multiple VS Code providers (editor, status, sidebar) share a single
WebSocket connection but independently called rrext_monitor with REPLACE
semantics — each provider's subscription silently overwrote the previous
one, causing missed events depending on activation order.
Introduce MonitorManager, a reference-counted subscription layer that
merges per-key bitmasks across providers and replays them on reconnect.
All providers now subscribe/unsubscribe through MonitorManager instead
of issuing raw rrext_monitor requests.
Add a Server Monitor dashboard (PageDashboardProvider + ServerMonitor
shared-ui component) that surfaces connected clients, running tasks,
and server activity without leaving the IDE. To support this, the
auth handshake now sends clientName/clientVersion so the server can
identify who is connected.
Also threads pipeline names through the execute command and defaults
component display names from the service catalog, so tasks appear with
human-readable labels in the dashboard and status views.
* feat(engine): add dashboard endpoint, connection tracking, and transport fixes
Implement rrext_dashboard command handler with server overview, active
connections, and task metrics. Track per-connection message counts, activity
timestamps, and client identity from auth handshake. Fix status_object event
name typo and exit message parsing in stdio transport. Add task name priority
from execute args over config.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(monitor): improve dashboard readability, component naming, and UX polish
The server monitoring dashboard was functional but hard to read — monitor
subscription keys showed raw UUIDs (p.3fda047b-fcc8-...), attached tasks
showed internal IDs (aa37e50b.chat_1), the outgoing message counter was
never incremented, and several UI details felt rough.
Dashboard data improvements (cmd_misc.py, task_conn.py):
- Resolve monitor keys to human-friendly labels: '*' becomes 'All tasks',
'p.{uuid}.*' becomes 'analyze.*', 'p.{uuid}.chat_1' becomes 'analyze.Chat'
- Show event type flags (summary, flow, task, etc.) alongside each monitor
subscription so operators can see what each connection is listening for
- Return task display names in attachedTasks instead of internal token IDs
- Increment _messages_out counter via send() override in TaskConn — the
counter was initialized but never updated, so the dashboard always showed 0
Task naming (task_engine.py):
- Change status name format to '{task_name|task_id}.{component_name|source}'
so tasks are identifiable by both their execution context and component,
which feeds into the dashboard's friendly label resolution
Component name enrichment (PageEditorProvider.ts):
- Enrich pipeline components with default names from the service catalog
before sending to the canvas webview, so components that lack an explicit
name get the service title (e.g. 'Chat', 'OpenAI') at the provider level
rather than displaying blank or falling back to the raw component ID
Connection page UX (PageConnection.tsx):
- Show Monitor button always, disabled when not connected — previously it
disappeared entirely, giving no indication the feature exists
Sidebar UX (SidebarFilesProvider.ts):
- Switch pipeline restart prompt from modal to toast notification to
eliminate the redundant Cancel button that VS Code forces on modal dialogs
Dashboard UI (ConnectionsTab.tsx, server-monitor.css, dashboard.ts):
- Render each monitor subscription on its own row with flag badges instead
of cramming all keys into a single tag list
- Remove left border accent from selected table row in favor of full
background highlight for cleaner selection feedback
- Update DashboardConnection.monitors type from string[] to {key, flags}[]
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(engine): add task token auth, harden multi-tenant isolation, and clean up teardown
The task server lacked tenant isolation — any authenticated API key could
interact with any task, the dashboard exposed all connections and tasks
across accounts, monitor subscriptions weren't ownership-checked, and
there was no way for external tools to authenticate scoped to a single
task. The debug disconnect also didn't actually detach, and subprocess
teardown had race conditions.
Task token authentication (task_server.py):
- Introduce 'tk_' prefixed task tokens that grant scoped control over a
single task, alongside the existing 'pk_' public tokens for data-only
access. This gives external integrations (MCP, webhooks) a way to
authenticate directly to a task without a full API key.
- Generate task tokens with the 'tk_' prefix during task setup so they
are distinguishable from public and API key credentials.
- Rework control.id to strip the auth prefix before hashing, so display
IDs remain clean regardless of token type.
- Remove get_server_status() and the _tasks_peak/_tasks_total counters —
these were server-global metrics that leaked cross-tenant data and are
now replaced by the per-account dashboard endpoint.
Multi-tenant dashboard isolation (cmd_misc.py):
- Add permission check (task.monitor) to the dashboard endpoint.
- Filter task_controls and connections to only the caller's API key so
each account sees only its own tasks and connections.
- Remove peakTasks and totalTasksLifetime from overview — these were
server-global counters that exposed cross-tenant activity.
Dashboard type updates (dashboard.ts, dashboard.py, OverviewTab.tsx):
- Remove peakTasks and totalTasksLifetime from DashboardOverview in both
TypeScript and Python SDK types.
- Update OverviewTab to remove the Total Tasks card and peak subtitle.
- Update comments to clarify metrics are scoped to the caller's account.
Task ownership enforcement (task_conn.py, cmd_task.py, cmd_monitor.py):
- Add apikey ownership checks in get_task() so API key callers can only
access tasks they launched — previously any valid key could reach any
task. pk_ and tk_ auth are already inherently scoped by get_task_token.
- Add permission check and ownership verification to rrext_get_token so
the token for a running task can't be retrieved by a different account.
- Add ownership checks to monitor set_monitor() for both token-based and
project-based subscriptions, with PermissionError re-raised past the
generic exception handler.
- Fix verify_permission return type annotation (was bool, actually None).
- Resolve token from request.arguments.token as a fallback, not just the
top-level request.token, so callers that pass token in args work correctly.
- Recognize tk_ tokens in get_task_token as locked to their task, same as pk_.
Debugger fixes (cmd_debug.py):
- Rewrite attach to use get_task()/get_task_token() for ownership validation
instead of manually extracting the token and calling verify_permission,
aligning it with how all other commands validate access.
- The disconnect handler was calling self.get_task() (which just validates)
but never called self._server.detach_task(), so disconnecting a debug
session left the debugger attached on the task side. Now properly detaches.
- Rewrite terminate to also use get_task()/get_task_token() consistently.
- Save task control ID on attach so debug events reference the right task.
Subprocess teardown hardening (task_engine.py):
- Set _is_terminating flag at the start of on_teardown and on_terminate to
block new data operations from racing against shutdown.
- Guard engine.terminate() against None engine reference — the subprocess
may not have started if the task fails during init.
- Use local 'engine' variable consistently instead of self._engine_process
to avoid TOCTOU issues during termination.
- Use Task.TaskData wrapper for data client connections.
- Reset exitCode to None instead of 0 in reset_status so completed-with-
success (exit 0) is distinguishable from never-ran.
Source resolution extraction (pipeline.py):
- Extract the duplicated "find the single source component" logic from
task_server.py and cmd_misc.py into a shared resolve_implied_source()
utility. Both call sites had identical logic for scanning components,
detecting ambiguity, and returning the source ID.
Minor cleanup:
- Replace magic number 3 with TASK_STATE.RUNNING.value in MCP tool listing.
- Remove unused HTTPException import and dead config variable in task_server.
- Remove stray blank line in data_conn.py.
- Fix error log in detach to reference token instead of unresolved control.id.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(monitor): add strongly-typed event definitions, dashboard activity stream, and SDK self-identification
The server monitor Activity tab was always empty because no events were
emitted or forwarded. Monitor subscriptions leaked when tasks were removed
or editors closed. The SDKs didn't identify themselves, making connections
opaque. And the event type definitions between Python and TypeScript were
inconsistent, incomplete, and weakly typed — the old EVENT_TASK used a
loose TypedDict with total=False in Python and a DAP wrapper with fields
that never existed on the wire in TypeScript.
Strongly-typed event definitions (events.ts, events.py, dashboard.ts, dashboard.py):
- Replace weak, inconsistent event types with strongly-typed discriminated
unions in both SDKs, using 'action' as the discriminant field. TypeScript
enforces exact field sets per variant at compile time; Python uses Literal
types on action fields for the same guarantee at type-check time.
- TaskEvent (TS) / TASK_EVENT (Python): four variants — TaskEventRunning,
TaskEventBegin, TaskEventEnd, TaskEventRestart. Each lifecycle variant
includes the new 'name' field. These are body-only types describing the
apaevt_task payload — not DAP message wrappers. The old EVENT_TASK had
an 'id' field at the root that never existed on the wire (the server
puts id into body.__id via build_event). The new types correctly describe
what clients actually receive.
- DashboardEvent (TS) / DASHBOARD_EVENT (Python): eight variants —
ConnectionAdded, ConnectionRemoved, TaskStarted, TaskStopped,
TaskRemoved, TaskError, AuthFailed, MonitorChanged. Each variant has
only the fields that apply — connection events carry connectionId and
optional client identity, task events carry taskId, error events carry
exitCode, etc. No optional fields leaking across variants.
- Both SDKs are in full parity: identical variant names (PascalCase TS,
SCREAMING_CASE Python), identical fields per variant, identical action
string literals.
- Add DASHBOARD (1 << 7) and SSE (1 << 6) to EVENT_TYPE enum in both
SDKs — SSE was already on the server but missing from the client types.
- Update DASHBOARD_MONITOR, DASHBOARD_TASK (add name, Optional nullables,
rate/count fields) and DASHBOARD_CONNECTION (monitors as {key, flags}[])
in both SDKs.
Server event emission (task_server.py, task_conn.py, cmd_monitor.py, task_engine.py):
- Add broadcast_server_event(type, event) on TaskServer and
send_server_event(type, event) on MonitorCommands for server-level
events that aren't task-scoped. Mirrors the existing
broadcast_task_event/send_task_event pattern — both paths go through
the connection's monitor layer, server events just check the '*'
wildcard only.
- Rename forward_event to send_task_event for clarity alongside the new
send_server_event.
- Emit apaevt_dashboard events: connection_added (from on_auth, after
client info is captured), connection_removed (from on_disconnect),
task_removed (from remove_task cleanup), task_error (non-zero exit
in task teardown), auth_failed (from on_auth rejection),
monitor_changed (from set_monitor subscribe/unsubscribe).
- Include 'name' in all apaevt_task lifecycle event bodies (begin, end,
restart) so consumers can display human-readable task names.
- Clean up monitor subscriptions when tasks are removed from the registry.
Dashboard provider and webview (PageDashboardProvider.ts, PageDashboard.tsx):
- Subscribe to ['task', 'summary', 'dashboard'] so the provider receives
both apaevt_task and apaevt_dashboard events.
- Forward them as separate typed message types to the webview: 'taskEvent'
with TaskEvent body, 'dashboardEvent' with DashboardEvent body. No
conversion between them — each channel keeps its native shape.
- Webview wraps both in ActivityEvent tagged union ({ source: 'task' |
'dashboard', body }) and accumulates up to 100 events newest-first.
Activity tab display (ActivityTab.tsx, OverviewTab.tsx):
- Separate display functions per event source: getTaskEventDisplay handles
running/begin/end/restart, getDashboardEventDisplay handles all eight
dashboard event types. Both leverage discriminant narrowing for type-safe
field access.
- Show client identity in connection events: "Cursor 1.0.6:#3 connected".
- Fix completed tasks showing internal ID instead of display name.
Monitor lifecycle cleanup (task_server.py, PageEditorProvider.ts):
- Remove monitor subscriptions for a task across all connections when the
task is removed from the registry.
- Fix PageEditorProvider.stopMonitoring to always call removeMonitor on
editor dispose regardless of isMonitoring flag — a disconnect/reconnect
cycle could desync the flag from the MonitorManager refcount, leaking
subscriptions.
SDK self-identification (DAPClient.ts, client.py, constants.ts, tasks.js):
- Default clientName to 'TypeScript SDK' / 'Python SDK' when not provided
by the caller, so connections are identifiable in the dashboard.
- Default clientVersion to the SDK's own version: TypeScript reads
SDK_VERSION from constants.ts (auto-synced from package.json by the new
sync-version build task), Python reads from importlib.metadata so it
always matches pyproject.toml. Source files default to '' — the real
value is set at build time (TS) or import time (Python).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(vscode): fix broken CSS comment headers and move padding/background to views
Every view-specific CSS file (PageConnection, PageDeploy, PageEditor,
PageSettings, PageStatus) plus the shared app.css and vscode.css were
missing the opening '/*' on their license comment blocks. The CSS parser
treated the unclosed comment as content, silently dropping all rules that
followed — body resets, container padding, layout classes, everything.
This is why view-specific styles appeared to have no effect.
CSS comment fixes:
- Add missing '/*' opener to PageConnection, PageEditor, PageStatus,
PageSettings, app.css, and vscode.css
- Remove stray closing comment fragment from PageDeploy
View-owned padding and background:
- Remove view-specific body padding rules (body.settings, body.sidebar-status,
body:not(...)) from vscode.css — these were unreliable because VS Code's
own webview styles can override body padding
- Set body to padding: 0; margin: 0 as a clean baseline
- Each view's root container now owns its own padding and background:
PageSettings gets padding: 24px, PageStatus/PageDeploy get background-color
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(monitor): harden monitor branch — security, correctness, and cleanup
Addresses code review findings across the monitor feature branch. Each
fix was verified against the current code before applying.
Security
---
- ConnectionsTab: raw API key no longer displayed in the detail panel;
masked to first/last 4 chars with bullets in between.
- cmd_misc: _resolve_monitor_label no longer echoes raw task tokens for
non-'p.' monitor keys; returns 'Task monitor' instead.
Correctness
---
- extension.ts: _pageDashboard.dispose() added to deactivate() — was
leaking event listeners registered in setupEventListeners().
- PageDashboardProvider: generateNonce() now uses crypto.randomBytes()
instead of Math.random(); require('fs') replaced with ES import.
- SidebarFilesProvider: pipeName strips both .pipe and .pipe.json
suffixes so legacy filenames produce the correct name.
- cmd_debug: disconnect flow tolerant of tasks removed by on_terminate
(best-effort detach); debug state cleared in finally block.
- cmd_monitor: 'type' parameter renamed to 'event_type' to avoid
shadowing the Python builtin; bitmask parsing now accepts integer
values and legacy listenType in addition to string arrays.
- pipeline.py: separate seen_source boolean from source_id to correctly
detect multiple Source components even when the first has no id.
- task_conn: mutable default dict on on_receive replaced with None
guard to prevent shared-state leakage across calls.
- dap_client: auth request wrapped in try/except — transport is now
disconnected if the auth request itself throws (timeout, network
error) instead of leaving a half-open connection.
- transport_stdio: None guard at top of _process_message prevents
AttributeError when message is None (end-of-stream).
- FlowGraphContext: shallow clone data.config before mutating .name so
the caller's object is not modified.
Cleanup
---
- client.ts: getDashboard docstring corrected from 'server.monitor' to
'task.monitor'.
- engine.py: debug() docstring no longer references removed
ServicePython trace level.
- hooks/index.ts: added export {} so the file is a valid ES module.
- server-monitor.css: currentColor → currentcolor for stylelint
value-keyword-case rule.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(monitor): address PR review findings — error propagation, naming, types
- monitor-manager: syncKey now rethrows on failure; addMonitor rolls back
refCounts so local state stays in sync with server on error
- PageDashboardProvider: add hasWildcardMonitor guard to prevent duplicate
wildcard subscriptions on reconnect
- cmd_debug: move get_task_token() before get_task() in attach/terminate
so token is always defined in error handlers
- cmd_monitor: rename shadowed `type` parameter to `event_type` in
send_task_event (A002); update callers in task_server and task_engine
- task_conn: fix mutable default argument on on_receive (Dict={} → Optional=None)
- task_server: include token-scoped keys in stop_task monitor cleanup;
only strip known auth prefixes (tk_, pk_) when building display id
- tasks.js: use robust regex for SDK_VERSION matching; throw on no match
instead of silently succeeding
- dashboard.ts: allow string | null on nullable wire fields (clientName,
clientVersion, clientId, exitMessage)
- events.ts: fix docstring example to match TaskEvent type fields
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update packages/shared-ui/src/modules/flow/context/FlowGraphContext.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix(monitor): address remaining PR review findings — security, dedup, a11y, types
- Restrict tk_ token dashboard scope to own task/connection (cmd_misc.py)
- Deduplicate overlapping monitor event sends by merging preferences (cmd_monitor.py)
- Import shared ActivityEvent type instead of local duplicate (PageDashboard.tsx)
- Stamp receivedAt on activity events at receive time, not render (ActivityTab/types)
- Add ARIA tab semantics: role=tablist/tab/tabpanel, aria-selected (ServerMonitor)
- Add keyboard accessibility: tabIndex/onKeyDown on tr, semantic close button (ConnectionsTab)
- Extract TRANSITIONAL_STATES constant to eliminate 4× duplicated OR-chains (PageConnection)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(monitor): tenant-scope broadcasts, coalesce fetches, balance monitors, harden dashboard
- Add apikey parameter to broadcast_server_event + send_server_event for tenant scoping
- Pass apikey from all 6 scoped call sites (connection add/remove, task error/remove, monitor change)
- Coalesce overlapping fetchAndPost() calls via in-flight/pending flags (PageDashboardProvider)
- Balance wi…
…g#600) * feat(store): add handle-based streaming I/O to file store (open/read/write/close) The store system previously had two problems: it buffered entire files in memory for every read/write, and domain operations (save_project, get_template, save_log, etc.) were implemented as monolithic methods on the Store class with bespoke path construction and JSON serialization baked in. This change replaces that with a generic filesystem-style interface (open, read, write, close, delete, stat, mkdir, list_dir) on FileStore, with domain methods (save_project, get_template, save_log, etc.) becoming thin convenience wrappers on the client SDKs that call the generic file operations with well-known paths. The server no longer needs to know about project/template/log semantics — it just serves files. The handle-based open/read/write/close pattern also enables streaming large files without holding everything in memory, and lets each backend use its native chunked upload API. The open/write/close pattern is the lowest common denominator across all three backends: - S3: create_multipart_upload → upload_part (5 MB buffer) → complete - Azure: stage_block (4 MB buffer) → commit_block_list - Filesystem: open('wb') → write() → close() Each handle is tagged with the owning connection_id so that when a connection terminates, all its handles are force-closed (committing whatever data has been written, not discarding it). Changes by layer: IStore (store.py): - Added open_write, write_chunk, close_write, abort_write, open_read, read_chunk, close_read with default in-memory implementations so custom backends continue to work. Backends (filesystem.py, s3.py, azure.py): - FilesystemStore: holds aiofiles file descriptors across calls. - S3Store: multipart upload with 5 MB buffer threshold; falls back to single put_object for files under 5 MB. - AzureBlobStore: staged blocks with 4 MB threshold; falls back to upload_blob for small files. - abort_write on all backends commits rather than discards. FileStore (file_store.py — new file): - FileHandle dataclass and FileHandleMode enum (inline, no separate module — nothing outside FileStore imports them). - Handle registry with per-path write locks (one writer at a time). - close_all_handles(connection_id) for disconnect cleanup. - read()/write() convenience methods now use handles internally. - Fixed stat() to check directory before file (prevents filesystem directories from being reported as files). DAP command handler (cmd_task.py): - fs_open, fs_read (handle-based), fs_write (handle-based), fs_close replace the old path-based fs_read/fs_write subcommands. - Removed domain-specific subcommands (save_project, get_template, etc.) — these are now client-side convenience wrappers. Disconnect cleanup (task_server.py): - _dapbase_on_disconnected now calls close_all_handles for the disconnecting connection. Client SDKs (store.py, client.ts): - fs_open/fs_read/fs_write/fs_close (Python) and fsOpen/fsRead/fsWrite/fsClose (TypeScript) — identical shapes. - Convenience wrappers (fs_read_string, fs_write_json, etc.) now perform open/read|write/close internally. - Domain methods (save_project, get_project, save_template, etc.) are thin wrappers that serialize to JSON and write to well-known paths using the generic file operations. - Both SDKs use plain string handle IDs, no wrapper classes. Tests: - Fixed stale tests in test_store.py and test_file_store.py that called methods removed from Store and FileStore. - Added TestHandleIO to test_file_store.py (server-side). - Added TestFileStoreOperations to Python client integration tests. - Added File Store Operations to TypeScript client integration tests. * fix(store): harden store API — validation, offset-on-read, file info, CLI fixes The handle-based I/O added in f079c99 shipped with several gaps that this commit addresses across the full stack (server, Python SDK, TS SDK, both CLIs, and tests). Security — path and ID validation --- Paths and domain IDs (projectId, templateId, source) were interpolated into storage keys without checking individual segments. A malicious client_id like "../../other" or a projectId containing "*" could escape account isolation or cause backend errors. Validation now happens at three layers: - Server (FileStore._validate_path): rejects *, ?, <, >, |, ", null, and control characters per segment. __init__ rejects client_ids with path separators or ".." values. - Python SDK (StoreMixin._validate_store_path / _validate_id): same rules applied before every DAP request that takes a path or domain ID. - TS SDK (RocketRideClient.validateStorePath / validateId): same rules. API change — move offset from open to read --- Passing the byte offset at open time forced the server to track cursor state internally, and gave the client no way to seek after opening. Offset is now a parameter of read_chunk / fs_read / fsRead, letting the client control position on every call. Convenience wrappers (fs_read_string, fsReadString) track offset client-side in a loop. File metadata — get_file_info, size in list_dir/stat --- list_dir and stat previously returned only modification time for files, and list_dir fetched it via a separate get_modified_time call. Added IStore.get_file_info() returning {size, modified} in a single backend call: - Filesystem: one stat() call - S3: one head_object call - Azure: one get_blob_properties call list_dir and stat now return both size (bytes) and modified (epoch timestamp) for file entries. CLI dir output reformatted to match Windows DIR style (date, time, <DIR> or size, name, summary counts). Concurrency fixes in FileStore --- - open_write: write lock was acquired after awaiting the backend, leaving a race window at the suspension point. Lock now acquired before await, released on failure. - delete: rejects deletion while the path has an active write handle. - read_chunk: negative offset rejected, length capped at MAX_CHUNK_SIZE. - cmd_task handler: clamps client-supplied offset and length. Broken CLI write commands --- Both Python and TS CLIs called fs_write(path, data) — but after the handle-based refactor, fs_write takes (handle, data). Fixed to use fs_open/fs_write/fs_close with chunked streaming (64 KB in Python, createReadStream in TS). Cloud provider fixes --- - Azure write_chunk: buffer bytes were deleted before _stage_block completed, losing data on transient failures. Deletion now happens after staging succeeds. close_write clears buffer after commit. - S3 open_write: unconditionally called create_multipart_upload even for small files, then aborted it in close_write. Multipart creation is now deferred until the buffer first reaches 5 MB; small files use simple put_object. Minor fixes --- - store.py: fallback temp path used 'dtc' instead of 'store', diverging from the primary branch. - task_server.py: disconnect path created a FileStore instance even when the connection never used the store. Now checks the cache first. - main.py: error message listed old command names (save_project, etc.) instead of current ones (dir, type, write, rm, mkdir, stat). - Integration tests: Python and TS test path schemes aligned to .test-store/{lang}-{name}-{random} to prevent collision when run concurrently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(store): offload sync cloud SDK calls to thread pool via asyncio.to_thread Both the Azure and S3 storage providers use synchronous SDKs (azure-storage-blob and boto3) but are called from async methods on the event loop. With multiple clients connected over WebSocket via the rrext_store DAP path, a blocking upload_blob() or put_object() call freezes the entire event loop for all connected clients. Wrapped every synchronous SDK call in asyncio.to_thread() so network I/O runs in the default thread pool executor: Azure (azure.py): - upload_blob, download_blob/readall, get_blob_properties, exists, delete_blob, list_blobs, stage_block, commit_block_list — all offloaded - _stage_block made async to await the to_thread call S3 (s3.py): - put_object, get_object/Body.read, head_object, delete_object, paginate (list_objects_v2), create_multipart_upload, upload_part, complete_multipart_upload, abort_multipart_upload — all offloaded - _upload_part made async to await the to_thread call - Multi-step operations (read + parse, paginate + collect) wrapped in inner functions to keep the entire blocking sequence in one thread call Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(store): enforce handle ownership, fix empty-dir display, remove abort_write Applied fixes from code review. Each finding was verified against the current code; findings that were already addressed, architecturally unsound, or purely stylistic were rejected with reasoning below. Handle ownership enforcement --- _get_handle now accepts an optional connection_id and rejects operations from connections that don't own the handle. The cmd_task DAP handlers pass self._connection_id on every read_chunk, write_chunk, close_write, and close_read call. The parameter defaults to 0 (no check) so internal callers (convenience methods, tests, close_all_handles) are unaffected. This matters because handle IDs are UUIDs sent over the wire — without ownership checks, a client that guesses or intercepts a handle ID from another connection could read or write another user's open file. Empty directory vs missing path --- Both CLIs printed "File Not Found" when fs_list_dir returned zero entries, which is wrong for an existing empty directory. They now call fs_stat/fsStat to distinguish: empty dirs show a zero-count summary, missing paths show "File Not Found". Remove abort_write from API --- abort_write existed on IStore and all three providers but had zero callers — it was dead code. Rather than build out discard semantics for an unused API surface, the method was removed entirely. If abort semantics are needed in the future, they can be added with a clear use case driving the design. Silent exception swallowing in listing --- _get_all_items (Python) and getAllProjects/getAllTemplates (TS) caught all exceptions and silently continued when reading project/template JSON files. This hid file corruption, permission errors, and malformed JSON with no diagnostic output. Both now log the error at debug level before continuing, so issues are visible in logs without breaking the listing. Findings rejected (with reasoning) --- - task_server.py client_id empty default: The empty string is a dataclass initialization pattern, not a security gap. client_id is set from _account_info.clientid after authentication succeeds, and unauthenticated connections cannot reach the store. Adding validation at the dataclass level would require finding and updating every construction site for a field that is always set by the auth flow. - cmd_task.py chunk length clamping: Already implemented in the prior commit (ec225ed). The review was looking at stale code. - filesystem.py lock/temp-file staging for open_write: The review proposed acquiring the existing file lock for the entire lifetime of a write handle and writing to a temp file with atomic rename on close. This would be a significant architectural change that conflicts with the current design: FileStore._write_locks already provides single-writer exclusion at the application layer, and the handle-based API is designed for streaming large files where holding a filesystem lock for minutes would block all other operations (reads, stat, list_dir) on that file. The current approach — application-level write locks + direct file I/O — is appropriate for the access patterns. - fs_write_string simplification: The review suggested replacing the nested try/except with finally + contextlib.suppress. The current pattern correctly calls fs_close exactly once on the success path and exactly once (best-effort) on the error path before re-raising. A finally block would call close twice on the success path (once explicitly, once in finally). Equivalent behavior would require a flag variable, making it no simpler than the current code. - Integration tests for mkdir/list_dir: Test additions are valuable but are a separate concern from the code fixes in this commit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Rod.Christensen <rod.christensen@aparavi.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ocketride-org#933) Closes the 9 mechanically-fixable Scorecard `PinnedDependenciesID` alerts on this repo. Mutable tag references (`@v4`, `:tag`) become immutable hash references; Dependabot will continue to bump the SHAs as new versions ship. GitHub Actions (7 alerts): sync-models.yml actions/checkout v4 → 34e1148... rocketride-org#599 actions/setup-python v5 → a26af69... rocketride-org#600 actions/cache v4 → 0057852... rocketride-org#601 peter-evans/create-pull-req. v7 → 22a9089... rocketride-org#602 discord-discussions.yml actions/checkout v4 → 34e1148... rocketride-org#644 discord-issues.yml actions/checkout v4 → 34e1148... rocketride-org#645 discord-pr.yml actions/checkout v4 → 34e1148... rocketride-org#646 Docker base images (2 alerts): docker/Dockerfile.engine ubuntu:jammy-20240808 → @sha256:adbb90115a21969d2fe6fa7f9af4253e16d45f8d4c1e930182610c4731962658 rocketride-org#561 docker/Dockerfile.mcp python:3.12-slim → @sha256:9d3abd9fc11d06998ccdbdd93b4dd49b5ad7d67fcbbc11c016eb0eb2c2194891 rocketride-org#471 Both digests are the OCI image index (multi-platform manifest list), so platform resolution still happens at build time. `jammy-20240808` is already a date-pinned snapshot tag; `3.12-slim` is a floating upstream tag and was pinned at the digest current as of 2026-05-20. The remaining 6 `PinnedDependenciesID` alerts (rocketride-org#465, rocketride-org#466, rocketride-org#467, rocketride-org#468, rocketride-org#472, rocketride-org#603) flag pip/npm install commands with already-exact version pins (`twine==6.1.0`, `@vscode/vsce@3.7.1`, `ovsx@0.10.9`, etc.). Scorecard wants `pip install --require-hashes` or lockfile-driven installs for these; the ergonomics of doing that for one-shot workflow installs (and for the `./client-python` local-path install in Dockerfile.mcp, which can't be hash-pinned at all) outweigh the incremental supply-chain hardening over an already-exact version constraint. Those alerts are being dismissed separately with "won't fix" + per-alert justification.
Summary
Test plan
builder ai:test— all 164 passed (server-side store + file_store tests)builder client-python:test— TestFileStoreOperations passed (live server integration)builder client-typescript:test— File Store Operations passed (live server integration)Summary by CodeRabbit
New Features
Refactor
Tests
Chores