opencode

package
v0.7.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package opencode holds OpenCode's header rules. They are plain functions of the request headers, so any host can call them. agent/client calls Identify.

Index

Constants

View Source
const (
	SessionHeader       = "x-opencode-session-id"
	ParentSessionHeader = "x-opencode-parent-session-id"
)

The request headers OpenCode names its sessions with.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields struct {
	// SessionID is x-opencode-session-id.
	SessionID string
	// ParentSessionID is x-opencode-parent-session-id: set only on a subagent's session.
	ParentSessionID string
}

Fields are the ids OpenCode sends in headers.

func Identify

func Identify(h http.Header) (f Fields, ok bool)

Identify reads OpenCode's ids from h. ok is true when OpenCode sent one of its headers. A nil header gives the zero Fields and false.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL