Skip to content

Commit 36573cb

Browse files
cursoragentechobt
andcommitted
feat(tui): complete code session agent loop
Wire the TUI to the live Code session API with device login, streaming tokens, tool rows, Plan/Spec locks, and cancel. Co-authored-by: Mathis <echobt@users.noreply.github.com>
1 parent 1e94b07 commit 36573cb

34 files changed

Lines changed: 1497 additions & 756 deletions

File tree

.rules/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# API and product
22

33
- Default API origin: `https://api.cortex.foundation`.
4-
- Auth origin: `https://auth.cortex.foundation` (WorkOS session / device code / existing `/v1` auth).
4+
- Device login: `POST /v1/auth/device` and `POST /v1/auth/device/token` on the API origin. Do not call `/v1/auth/device/code` (404). `auth.cortex.foundation` is not the device endpoint.
55
- Software / updates: `https://software.cortex.foundation`.
66
- The harness is a client. Chat/Code turns, tools, computers, plugins, and snapshots go through that API. Do not embed a second model provider.
7-
- Keep `/v1/models`, `/v1/responses` (or the current Chat/Code route in `cortex-engine`), and `/v1` auth paths. If the backend adds a route, update the client and the user-facing error map together.
7+
- Code turns: `POST /v1/code/sessions/{id}/turns` with `{ message, mode: "chat"|"code" }`. Plan/ask are TUI/harness locks, not API modes.
88
- When the API is unreachable, the product fails closed with a product-facing error. Do not fall back to a local mock model.
99
- Environment overrides (`CORTEX_API_URL`, `CORTEX_API_KEY`, `CORTEX_AUTH_TOKEN`) are for operators and tests. Defaults must stay production Cortex URLs.

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## Unreleased
11+
12+
### Added
13+
- Code session turns against `POST /v1/code/sessions/{id}/turns` (streaming tokens, tool rows, Plan/Spec harness locks)
14+
- Device login against `POST /v1/auth/device` on `api.cortex.foundation` (no silent guest substitution)
15+
- This PC / Cloud / SSH computer label on the welcome card
16+
- Workspace Code session id cache (`~/.cortex/code-sessions.json`)
17+
- Guest session as an explicit TUI login choice
18+
19+
### Fixed
20+
- Cancel aborts the local SSE stream and best-effort POSTs cancel (API route is still 404)
21+
- Task without a live ModelClient reports failure instead of a fake success
22+
- Remote tool rows keep their label instead of dropping arguments
23+
24+
### Changed
25+
- Sign-in docs point at `api.cortex.foundation` device login
26+
- Stream timeouts use the product-facing coding-service error
27+
28+
---
29+
1030
## 0.0.5
1131

1232
### Added

0 commit comments

Comments
 (0)