sessions

Read one session workspace file and its git diff

Changed on
get/api/v1/sessions/{sessionId}/workspace/file

Request

  • Base URL
    http://127.0.0.1:3001
  • URL
    http://127.0.0.1:3001/api/v1/sessions/{sessionId}/workspace/file
  • Auth
    none declared

Path parameters

sessionIdstring required

Session identifier, e.g. project-1.

Query parameters

snapshotboolean

Read the immutable review snapshot instead of the live worktree.

branchstring

Local or remote-tracking branch to read without checkout.

prNumberinteger

Associated pull request number.

sourceUrlstring

Associated pull request URL.

expectedTipShastring

Pinned source tip for snapshot reads. Must remain reachable from the selected source.

expectedBaseShastring

Pinned comparison base for snapshot reads.

commitShasstring

Comma-separated selected commit SHAs.

pathstring

Session-worktree-relative file path.

section'uncommitted' | 'committed' | 'staged' | 'unstaged' | 'untracked'

Git-state section the file was opened from (see WorkspaceFileSections). uncommitted diffs the worktree against HEAD; staged diffs the index against HEAD; unstaged diffs the worktree against the index; omitted/committed/untracked diff the worktree against the compare base.

commitShastring

Exact commit SHA to read as an immutable committed-scope snapshot.

Response

OK

additionsinteger required
binaryboolean required
compareBaseRefstring
compareBaseShastring
compareMode'base' | 'head_fallback'
contentstring required
contentTruncatedboolean required
deletedboolean required
deletionsinteger required
diffstring required
diffTruncatedboolean required
editableboolean required
fileFingerprintstring required
historicalboolean

True only for a read-only revision, never a live worktree file.

imageMediaTypestring
pathstring required
previousPathstring
sessionIdstring required
sizeinteger required
status'unmodified' | 'modified' | 'added' | 'deleted' | 'renamed' required
workspaceVersionstring required

Changes

    • info

      removed the agent_switch_saga enum value from the response property for the response status

    • info

      removed the agent_switch_saga enum value from the response property for the response status

    • info

      removed the agent_switch_saga enum value from the response property for the response status

    • info

      removed the agent_switch_saga enum value from the response property for the response status

    • info

      removed the agent_switch_saga enum value from the response property for the response status

    • info

      added the new optional query request parameter branch

    • info

      added the new optional query request parameter commitShas

    • info

      added the new optional query request parameter expectedBaseSha

    • info

      added the new optional query request parameter expectedTipSha

    • info

      added the new optional query request parameter prNumber

    • info

      added the new optional query request parameter snapshot

    • info

      added the new optional query request parameter sourceUrl

    • info

      added the new enum value uncommitted to the query request parameter section

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status