[DOCS-1532] Fix inaccurate delete-batch and delete-run API docs samples - #77
Open
rosalie-byrnes wants to merge 1 commit into
Open
[DOCS-1532] Fix inaccurate delete-batch and delete-run API docs samples#77rosalie-byrnes wants to merge 1 commit into
rosalie-byrnes wants to merge 1 commit into
Conversation
Correct inaccurate code samples reported via in-site feedback, align delete-batch polling with the preferred jobs.status endpoint, and add path-parameter examples so Fern-generated snippets use real values. Co-authored-by: Cursor <cursoragent@cursor.com>
abhishek-ib
approved these changes
Jul 29, 2026
abhishek-ib
left a comment
Contributor
There was a problem hiding this comment.
lgtm, No breaking changes. But can you please hold off on merging this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Two in-site feedback reports flagged inaccurate code samples on:
The reports included no further detail beyond there being code sample issues.
As I'm not involved in the backend, I set Cursor in the issue. To investigate, I asked Cursor to verify the published samples against:
instabase-aihub0.14.0)instabase-fernWhat Cursor found
Delete run — real defects
KeyErrorwhen indexingdelete_input_dir_job_id/delete_output_dir_job_id/delete_log_dir_job_iddirectly. The server omits those keys when the matching query flag isfalse(or when that filesystem delete is not enqueued). It does not returnnull. Verified inpy/src/instabase/jobs/job_handler.py(delete_job_idsstarts empty; keys are inserted only inside the correspondingif delete_input:/if delete_output:/if delete_logs:branches) and returned verbatim as the 202 payload fromapps.py.FAILEDorCANCELLED. The sample only removed job IDs onCOMPLETE. Terminal states confirmed infile_service.proto(COMPLETE,FAILED,CANCELLED) and surfaced by the shared job-status handler.run_idin the URL (for example.../apps/runs/run_id), which 404s if copy-pasted. Cause: therun_idpath parameter had noexamplevalue, so Fern fell back to the parameter name.Delete batch — no broken Python sample, but related polish and shared docs issues
The delete-batch Python samples matched the API/SDK behavior (202 +
{"job_id": ...}, polled successfully). Remaining issues were:client.batches.poll_job()path, while the preferred equivalent isclient.jobs.status()(already documented on the poll-batches-job page as preferred).PENDING/RUNNINGstate without telling the reader when deletion failed.examplevalues caused weak/placeholder URLs in generated language tabs (integer params fell back to values like1/0).Fixes in this PR
Delete run
COMPLETE,FAILED, andCANCELLEDas terminal; report non-success terminal states; skip the final sleep when done.if key in job_ids), matching server “omit key” behavior.false, and link to job-status polling.nullable: truefrom the three job-ID properties; describe when each key is returned.Delete batch
client.batches.poll_job()to preferredclient.jobs.status(); report when the terminal state is notCOMPLETE.job_idfield links from legacy poll-batches-job to preferred/jobs/job-status.Legacy poll-batches-job page (kept)
client.jobs.status().Path-parameter examples (docs rendering)
examplevalues forbatch_id,run_id, and bothjob_idpath parameters so Fern-generated snippets substitute real example values instead of parameter-name placeholders.Testing
requestslayers covering:COMPLETE)FAILED/CANCELLED(previously hung on delete-run)KeyErroron delete-run)instabase-aihub0.14.0.fern docs devpreview and confirmed on localhost that:run_id)client.jobs.status()Next steps (outside this PR)
nullablemarking on the delete-run 202 response fields (behaviorally optional either way; server never sendsnull).filename,session_id,path, etc.) still lackexamplevalues and can produce similar placeholder URLs on their pages.What to review
examplevalues look reasonable for generated snippetsMade with Cursor