Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "1.1.1",
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:94879eebb6a0e4e2f197de9f12db7427cb4a25b82d93c55239ce8c8fc394a1b4",
"integrity": "sha256:94879eebb6a0e4e2f197de9f12db7427cb4a25b82d93c55239ce8c8fc394a1b4"
}
}
}
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:5-24-trixie",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// Named steps run in parallel and are reported separately, so a failure in one
// is not hidden by the other. Both install into ~/.bun and ~/.qlty and append
// their PATH exports to ~/.bashrc.
// QLTY_VERSION is pinned so `qlty smells` metrics stay reproducible across
// rebuilds; drop it to track latest.
"postCreateCommand": {
"bun": "curl -fsSL https://bun.sh/install | bash",
"qlty": "QLTY_VERSION=0.643.0 bash -c 'curl -fsSL https://qlty.sh | bash'"
}


// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
36 changes: 0 additions & 36 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions packages/opencode/src/session/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@ import type { MessageV2 } from "./message-v2"
import type { MessageID } from "./schema"

function extract(messages: SessionV1.WithParts[]) {
const paths = new Set<string>()
for (const msg of messages) {
for (const part of msg.parts) {
if (part.type === "tool" && part.tool === "read" && part.state.status === "completed") {
if (part.state.time.compacted) continue
const loaded = part.state.metadata?.loaded
if (!loaded || !Array.isArray(loaded)) continue
for (const p of loaded) {
if (typeof p === "string") paths.add(p)
}
}
}
}
return paths
return new Set(messages.flatMap((msg) => msg.parts).flatMap(loadedPaths))
}

// Paths a completed, uncompacted read tool call reported loading. Anything else contributes none.
function loadedPaths(part: SessionV1.Part) {
if (part.type !== "tool" || part.tool !== "read") return []
if (part.state.status !== "completed" || part.state.time.compacted) return []
const loaded = part.state.metadata?.loaded
if (!Array.isArray(loaded)) return []
return loaded.filter((p) => typeof p === "string")
}

export interface Interface {
Expand Down
Loading