Skip to content

Commit 32c3ead

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/learn-workspace-sync
# Conflicts: # packages/opencode/src/altimate/workspace/manage.ts # packages/opencode/src/plugin/tui/altimate/index.ts # packages/opencode/src/plugin/tui/altimate/workspace-sidebar.tsx
2 parents 3b60694 + 9281c22 commit 32c3ead

60 files changed

Lines changed: 5206 additions & 227 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ concurrency:
1010
group: ci-${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
# ---------------------------------------------------------------------------
1518
# Detect which areas of the codebase changed to skip unaffected jobs.
@@ -18,6 +21,9 @@ jobs:
1821
changes:
1922
name: Detect Changes
2023
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
pull-requests: read
2127
timeout-minutes: 2
2228
outputs:
2329
typescript: ${{ steps.filter.outputs.typescript }}
@@ -181,6 +187,8 @@ jobs:
181187
timeout-minutes: 60
182188
steps:
183189
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
190+
with:
191+
persist-credentials: false
184192

185193
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
186194
with:
@@ -429,6 +437,8 @@ jobs:
429437
430438
steps:
431439
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
440+
with:
441+
persist-credentials: false
432442

433443
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
434444
with:
@@ -524,6 +534,8 @@ jobs:
524534
timeout-minutes: 5
525535
steps:
526536
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
537+
with:
538+
persist-credentials: false
527539

528540
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
529541
with:
@@ -550,6 +562,8 @@ jobs:
550562
timeout-minutes: 10
551563
steps:
552564
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
565+
with:
566+
persist-credentials: false
553567

554568
- name: Install Pester
555569
shell: pwsh
@@ -579,6 +593,8 @@ jobs:
579593
timeout-minutes: 15
580594
steps:
581595
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
596+
with:
597+
persist-credentials: false
582598

583599
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
584600
with:
@@ -715,6 +731,8 @@ jobs:
715731
timeout-minutes: 10
716732
steps:
717733
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
734+
with:
735+
persist-credentials: false
718736

719737
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
720738
with:
@@ -758,6 +776,7 @@ jobs:
758776
steps:
759777
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
760778
with:
779+
persist-credentials: false
761780
fetch-depth: 0
762781

763782
- uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2

‎.opencode/skills/altimate-setup/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: altimate-setup
3-
description: Configure Altimate platform credentials for datamate and API access
3+
description: Configure Altimate platform credentials for API and workspace access
44
---
55

66
# Altimate Setup
@@ -28,4 +28,4 @@ Guide the user through configuring their Altimate platform credentials.
2828
```
2929
Then set permissions to owner-only: `chmod 600 ~/.altimate/altimate.json`
3030

31-
4. **Validate**: Call the `datamate_manager` tool with `operation: "list"` to verify the credentials work. Report success or failure to the user.
31+
4. **Validate**: If the `datamate_manager` tool is available, call it with `operation: "list"` to verify the credentials work, and report success or failure to the user. If it is not (it is turned off in a project linked to an Altimate workspace), ask the user to run `/workspace` → Refresh instead, which calls the Altimate API with these credentials and reports an error if they don't work.

‎CHANGELOG.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.12.7] - 2026-10-13
9+
10+
**Workspace skills and knowledge come first.** In a linked project the agent prefers the workspace's own skills over lookalikes in the repo or your home folder, and checks the workspace's knowledge base for best practices without being asked. Linking now ends with a starter that says what the workspace provides and suggests prompts. Also in this release: opt-in automatic promotion for `learn`, session traces for the IDE extension, and Snowflake reconnects written to `opencode.log`.
11+
12+
**Heads-up for support:**
13+
- **The start-screen workspace box is back.** 0.12.6 removed it because it stopped every keybinding once it loaded. The cause is fixed, and Ctrl+C, Ctrl+P and Esc were checked on the start screen of the release build, linked, unlinked and with the workspace service unreachable. If a signed-in user still reports dead keys, `ALTIMATE_DISABLE_WORKSPACE=1` remains the stopgap.
14+
- **The skill list changes for everyone, not only workspace users.** Each skill the agent sees now carries its source (`workspace`, `project`, `built-in`, `personal` or `other`), and the agent is told to prefer them in that order. So a skill in the repository now outranks a personal one with a similar purpose. It is guidance to the agent, not a filter: every skill is still listed and can be asked for by name.
15+
- **The agent may search the workspace knowledge base on its own.** When the linked workspace has knowledge, the agent consults it for best practices and team conventions without the user asking. Unlinking the project, or turning knowledge off for the workspace, stops it.
16+
- **`serve` has new read-only routes for the IDE extension** (see Added). Traces hold prompts and tool output, including SQL and query results. Like every `serve` route, they need no password unless `OPENCODE_SERVER_PASSWORD` is set, so set one on a shared machine.
17+
18+
### Changed
19+
20+
- **Workspace skills and knowledge are preferred.** Every skill in the agent's list is labelled with where altimate-code found it, and one rule tells the agent to load the highest source that fits instead of asking which team's skill to follow. A project skill with exactly the same name as a workspace skill still replaces it. Listings stay in name order, so built-in skills are not pushed out of the skill tool's list. With knowledge on, the workspace section also tells the agent to check the knowledge base before answering best-practice questions. (#1435)
21+
22+
### Added
23+
24+
- **A starter after linking.** `altimate-code link` ends with what the workspace provides (skills, knowledge, integrations, memory setting) and up to three prompts to try; the TUI shows the same after a link and from `/workspace` → **Get started**, where picking a prompt fills the input without sending it. It makes no model call, and anything not yet known is left out rather than shown as "none". `GET /altimate/workspace/starter` serves it to the IDE extension. (#1435)
25+
- **`learn` can promote lessons without a person, if you opt in.** `learn enable --auto-promote` (or `learn.auto_promote: true`, or `ALTIMATE_LEARN_AUTO_PROMOTE=1`) promotes a lesson an automatic reflection staged when every check passes: it came from a correction, review or CI signal; it is exactly what was staged; it validates like a manual promote; it does not weaken a verification step; it does not edit or remove a lesson a person approved or pinned; and it stays within 3 changes per promotion and 5 per day (`learn.auto_promote_max_changes`, `learn.auto_promote_daily`). Otherwise the candidate stays staged and `learn status` says why. Off by default, needs capture and automatic reflection on, and `learn rollback` undoes a promotion. (#1418)
26+
- **Session traces for the IDE extension.** `serve` adds `GET /altimate/trace` (a page of traces, newest first) and `GET /altimate/trace/<session>/view` (the trace viewer, without Copy Link), so the extension's `/traces` can list and open them. Browser-originated requests are refused, as for the workspace routes. (#1415)
27+
28+
### Fixed
29+
30+
- **The TUI's keybindings keep working with the start-screen workspace box.** The box rendered nothing until the project's link was resolved; each time its lines arrived, the start screen remounted it empty, and it resolved again without end, which held up every keybinding. It now keeps a root element from its first render. (#1435)
31+
- **Snowflake reconnects are in `opencode.log`.** When Snowflake closes a session and the driver reopens it, the log gains `reconnecting`, then `reconnected` (with the reason, how long it took, how many session settings were restored, and whether temporary tables or a transaction may have been lost) or `reconnect failed` (a warning with the masked error). The lines name the account, and the connection when only one uses it; they never contain SQL. Before, a session that kept dropping left no trace. (#1427)
32+
- **A trace containing `<!--<script` no longer opens as an empty page.** The viewer embeds the trace in an inline script, and that text in tool output (a fetched web page, say) stopped the script from running. Affected the TUI's `/traces` too. Found in this release's testing.
33+
- **The trace viewer page cannot call the server's API.** Served from `serve` for the IDE, the page now carries a content security policy that allows its own script but no requests or form posts, so script injected through trace content cannot reach other routes. Found in this release's review.
34+
835
## [0.12.6] - 2026-10-06
936

1037
Hotfix for 0.12.5. **Heads-up for support:** anyone on 0.12.5 who is signed in to Altimate gets a TUI where keybindings do nothing and Ctrl+C does not quit; they have to close the terminal. Upgrading fixes it, and so does `ALTIMATE_DISABLE_WORKSPACE=1` as a stopgap.

‎docs/docs/configure/skills.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,19 @@ This disables skill discovery from `~/.claude/skills/` and `~/.agents/skills/` b
325325
## Duplicate Handling
326326

327327
If multiple skills share the same name, project-level skills override global skills. A warning is logged when duplicates are found.
328+
329+
## Which Skill the Agent Picks
330+
331+
The skill list the agent sees marks each skill with where it was found:
332+
333+
| Source | Where |
334+
|---|---|
335+
| `workspace` | Synced from the Altimate workspace this project is linked to |
336+
| `project` | Inside the project, such as `.claude/skills/`, `.agents/skills/` or `.altimate-code/skills/` |
337+
| `built-in` | Ships with altimate-code |
338+
| `personal` | Your own folders under your home directory, such as `~/.claude/skills/` |
339+
| `other` | Anywhere else, such as a `skills.paths` entry outside the project and your home directory |
340+
341+
When more than one skill fits a task, the agent is told to load the one from the highest source in that order, and to fall back to a lower source only when nothing higher covers the task. So a skill your team added to the workspace is preferred over a similar skill another team left in the repository. The label comes from the skill's location, not from anything written in the skill.
342+
343+
One exception: a project skill with exactly the same name as a workspace skill replaces it, and is listed as `project`. That keeps a skill you are editing in the repository, and may later publish, from being shadowed by the workspace's older copy.

‎docs/docs/configure/warehouses.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Each warehouse has a key (the connection name) and a config object:
5353
| `database` | No | Database name |
5454
| `schema` | No | Schema name |
5555
| `role` | No | User role |
56-
| `client_session_keep_alive` | No | Keep the session alive while Altimate Code is running (default `true`). A connection Snowflake closes anyway is reopened automatically. `USE`, `ALTER SESSION` and `SET` settings are applied again to the reopened session. A single read-only query interrupted by the close is run again; a statement that changes data, or calls a sequence, is not, because it may already have run, and the error says so. Temporary tables and an open transaction cannot be restored: statements issued before the reopen report that instead of running. |
56+
| `client_session_keep_alive` | No | Keep the session alive while Altimate Code is running (default `true`). A connection Snowflake closes anyway is reopened automatically. `USE`, `ALTER SESSION` and `SET` settings are applied again to the reopened session. A single read-only query interrupted by the close is run again; a statement that changes data, or calls a sequence, is not, because it may already have run, and the error says so. Temporary tables and an open transaction cannot be restored: statements issued before the reopen report that instead of running. Each reopen is written to `opencode.log` under `warehouse-connect` as `reconnecting`, then `reconnected` (with `reason`, `duration_ms`, `settings_restored` and `session_state_lost`) or `reconnect failed` (a warning with the masked error). The lines name the account, and the connection when only one uses that account; they never contain SQL. |
5757

5858
### Key-pair authentication
5959

‎docs/docs/usage/cli.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@ Workspace features are on by default. When you are signed in to Altimate, altima
5454

5555
With workspaces on:
5656

57-
- `altimate-code link` links the current project to a workspace (or creates one). The sidebar then names the workspace and shows how many memories are not yet synced and when skills last synced.
57+
- `altimate-code link` links the current project to a workspace (or creates one), then shows what the workspace provides (its skills, knowledge, integrations and whether memory is on) and a few prompts to start with. The sidebar then names the workspace and shows how many memories are not yet synced and when skills last synced.
5858
- From a shell, script or CI job, without the TUI:
5959
- `altimate-code link --workspace <name|id>` links to an existing workspace (an id is matched before a name), and `altimate-code link --create [name]` creates one (named after the repo by default) and links to it. Neither prompts. If the project is already linked to a different workspace they refuse unless `--yes` is passed. Running `--create` again when the project is already linked to a workspace of that name creates nothing, so it is safe in a devcontainer's setup command; if another workspace already has that name it refuses and names its id, unless `--allow-duplicate` is passed. Linking to the workspace the project is already linked to confirms that link on this machine, which a fresh clone needs before `workspace sync` sends its memory.
6060
- `altimate-code workspace status [--json]` shows the linked workspace and, when known, how many saved memories have not reached it and when skills last synced.
6161
- `altimate-code workspace refresh` pulls the workspace's skills (memory is loaded by the next session started in the project); `altimate-code workspace sync` sends memory the workspace has not received; `altimate-code workspace unlink [--yes]` detaches the project (`--yes` is required without a terminal).
6262
- These commands accept `--directory`. Exit codes: `0` done, `1` failed (including when the workspace service could not be reached), `2` a request to change (not signed in, a re-link or unlink without `--yes` and no terminal to confirm on, or a `sync` to a link not yet confirmed on this machine), `3` the project is not linked. With `--json`, `ok` is `true` exactly when the exit code is `0`.
63-
- `/workspace` in the TUI opens a menu: **Refresh** pulls the workspace's skills and memory into this project, **Sync** re-sends local memory the workspace never received, **Open in browser** (when a web URL is available) shows the workspace on the web, **Switch workspace** relinks the project, **Unlink** detaches it. In a project that is not linked yet, it offers **Link to a workspace** instead.
63+
- `/workspace` in the TUI opens a menu: **Get started** shows what the workspace provides and prompts to try (choosing one puts it in the prompt without sending it; after you link from the TUI, the confirmation shows the same summary and prompts), **Refresh** pulls the workspace's skills and memory into this project, **Sync** re-sends local memory the workspace never received, **Open in browser** (when a web URL is available) shows the workspace on the web, **Switch workspace** relinks the project, **Unlink** detaches it. In a project that is not linked yet, it offers **Link to a workspace** instead.
6464
- `altimate-code skill publish <name>` uploads a project skill to the linked workspace; see [Skills](../configure/skills.md#cli-commands).
65+
- When the linked workspace has knowledge, the agent is told to check it for best practices and team conventions before answering, without you having to mention the knowledge base.
6566
- In an ordinary session the agent is told every turn which workspace the project is linked to — or that none is, or that the link could not be verified just now. In an extension-pinned session it is told the pinned workspace instead, and that it differs from the project's own link. Either way "which workspace am I in?" has an answer, and the agent is told not to confuse it with a Databricks workspace or an IDE workspace folder.
6667
- When `altimate-code serve` is launched by the VS Code / Cursor extension, the workspace selected in the extension's panel governs that session's skills, memory and (unless `--integrations local` is set) warehouse tool routing, taking priority over whatever the project is linked to on the backend, and is scoped to the folder it was launched for. A pin is fixed for the life of the `serve` process, so the extension relaunches `serve` when the selection changes; nothing updates a running one.
68+
- `serve` also gives the IDE extension what the TUI shows: `GET /altimate/workspace/starter` (the starter message after a link) and `GET /altimate/trace` with `GET /altimate/trace/<session>/view` (the trace list and viewer behind `/traces`). Traces hold prompts and tool output, including SQL and query results. Like every `serve` route, these need no password unless `OPENCODE_SERVER_PASSWORD` is set, so set one on a shared machine.
6769

6870
## Global Flags
6971

‎packages/drivers/src/index.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export { normalizeConfig, sanitizeConnectionString } from "./normalize"
88
export { onBrowserSignIn, redactSignInUrl } from "./sign-in"
99
export type { BrowserSignInNotice } from "./sign-in"
1010

11+
// Re-export reconnect events (a closed session reopened by the driver)
12+
export { onReconnect } from "./reconnect-events"
13+
export type { ReconnectEvent } from "./reconnect-events"
14+
1115
// Re-export file-backed store guards
1216
export { allowsCreate, assertStoreExists, isLocalFilePath, requireStorePath } from "./file-store"
1317

0 commit comments

Comments
 (0)