Skip to content

feat: track latest OpenShell SDK + wire v0.0.113 stop/start, exit code, draft-policy diff data - #52

Merged
Gkrumbach07 merged 3 commits into
mainfrom
chore/bump-sdk-latest
Aug 27, 2026
Merged

Gkrumbach07 merged 3 commits into
mainfrom
chore/bump-sdk-latest

Conversation

@Gkrumbach07

Copy link
Copy Markdown
Contributor

Summary

Now that the BFF is on the official Go SDK (#43), tracking upstream is a go get bump. This bumps github.com/NVIDIA/OpenShell/sdk/go to latest (pulls upstream v0.0.115; we were pinned to the Aug‑14 / ~v0.0.106 commit) and wires up the additive API surface that shipped since then.

Delivers the "keep the repo working against the latest" ask from the #team-openshell thread.

Changes

SDK bump

  • go get github.com/NVIDIA/OpenShell/sdk/go@latest.
  • Fix the one compile break: ApproveDraftChunk now requires a review_token (optimistic concurrency). The BFF resolves the chunk's token server-side from GetDraft before approving — no frontend contract change; older gateways return an empty token, which the RPC accepts.

Sandbox stop/start (new StopSandbox/StartSandbox RPCs, phases STOPPING/STOPPED/STARTING)

  • BFF: StopSandbox/StartSandbox handlers + POST /sandboxes/{name}/stop|start routes.
  • Frontend: Stop/Start actions on the sandbox detail header and list row (phase‑gated); PhaseLabel renders the new phases; SandboxPhase type + create‑modal copy updated.

Exit code

  • Surface SandboxStatus.exitCode (models DTO + converter + detail view row) — helps triage ERROR‑phase sandboxes.

Draft‑policy diff data

  • Expose reviewToken, applicationError, and current/candidate effective‑policy hashes + full policies on PolicyChunk (BFF converter uses the existing marshalSDKPolicy; TS types added) so the draft inbox can render a before/after diff. (Diff UI itself is a follow‑up.)

Docs

Testing

  • go build ./..., go vet ./..., go test ./... — green.
  • npm run typecheck, npm run lint, npm test (178 passing) — green.

Follow-ups (not in this PR)

  • Stop/Start on the gallery SandboxCard (only table row + detail wired here).
  • The draft‑policy before/after diff UI (data is now plumbed through).
  • README still references backend/gen/ + internal/gateway/ removed by feat(bff): migrate BFF handlers to OpenShell Go SDK [RHOAIENG-83116] #43 — belongs to the SDK migration cleanup (RHOAIENG-83124).
  • The harness picker (AGENT‑category provider profiles) for click‑to‑add Claude/Codex/OpenCode — separate feature.

🤖 Generated with Claude Code

Gkrumbach07 and others added 3 commits August 27, 2026 13:39
Bump github.com/NVIDIA/OpenShell/sdk/go to latest (v0.0.115 upstream) and
adopt the additive API surface that shipped since the pinned Aug-14 build.

- Sandbox stop/start (StopSandbox/StartSandbox) with STOPPING/STOPPED/
  STARTING phases: BFF handlers + routes, frontend actions on the sandbox
  list and detail pages, PhaseLabel handling.
- SandboxStatus.exitCode surfaced in the detail view (aids ERROR triage).
- Draft-policy review_token: resolved server-side on approve (now required
  by ApproveDraftChunk) and exposed on chunks alongside applicationError and
  current/candidate effective policies for a future before/after diff.

Also refresh the stale "no stop/start" docs (openshell-api rule, CLAUDE.md,
CONTRIBUTING, README, create-sandbox modal copy).

All green: go build/vet/test, tsc, eslint, jest (178 passing).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
- Reorder SandboxStatus and PolicyChunk fields to minimize pointer-scan
  bytes (govet fieldalignment), preserving doc comments.
- Run prettier on SandboxDetailPage.tsx.

Both check-backend and check-frontend CI jobs were failing on these.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
- Fix false-positive success toasts: list-page Stop/Start now report
  success/failure from the mutation's actual outcome, not immediately
  on click. Detail-page Stop/Start gained the error feedback they were
  missing entirely.
- Extract canStopSandbox/canStartSandbox so the list row and detail page
  page can't disagree on which phases allow which action.
- Add STOPPED/STOPPING/STARTING colors to StatusDot (PhaseLabel already
  had them).
- Drop the delete-confirmation copy claiming deletion is "the only way
  to stop a running sandbox" — no longer true now that Stop exists.
- ApproveDraftChunk: accept an optional client-supplied reviewToken
  (the frontend already has it from GetDraftPolicy) and only fall back
  to the extra GetDraft round-trip when the client didn't send one.
- Add handler tests for StopSandbox/StartSandbox (previously untested;
  the SDK mock's Stop/Start literally panicked) and for both
  ApproveDraftChunk token paths.
- Correct .claude/rules/openshell-api.md and CLAUDE.md: backend/proto/
  and backend/internal/gateway/ were removed by the SDK migration (#43)
  and are stale/unused — the vendored Go SDK is the source of truth now,
  not a local proto copy. Also documented ApproveDraftChunk's new
  review_token under the optimistic-concurrency hard fact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
@Gkrumbach07
Gkrumbach07 merged commit 2c84aaa into main Aug 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant