Disable release LTO (`options=('!debug' '!lto')`) so the final link no
longer gets OOM-killed on low-memory AUR build hosts, and pin CARGO_HOME
to the registry that build() already populated before check() repoints
HOME at an empty test home, so the --frozen test run can resolve the
packages it fetched instead of failing offline.
Guarded by a packaging test that asserts both properties.
Closes#677
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDbhmszrjG9s5MrPrTuNtm
OpenCode Zen/Go notified operators that requests missing an
`x-opencode-session` header may start erroring, and reported ai-memory's
traffic as "Unknown client — your requests carry no user agent, so we
can't tell what sends them". Both halves are real: `reqwest` sends no
`User-Agent` unless one is configured, and nothing in the crate could
attach a caller-supplied header.
Add `AI_MEMORY_LLM_HEADERS` (`llm_headers` in config.toml): comma-separated
`Name=Value` / `Name: Value` entries, parsed and validated once at the
configuration boundary into a typed `ExtraHeaders`, then sent on every chat
request. This follows the rule provider auth already obeys — providers
consume typed material and never re-parse operator strings — and means a
malformed entry fails at startup rather than on the first consolidation
pass. Headers ai-memory sets itself are refused rather than duplicated:
`RequestBuilder::header` appends, so a second `authorization` would break
the request instead of overriding it. Values are marked sensitive and never
logged; `Debug` prints names only.
Two defaults ride on the same mechanism, layered *under* the operator's so
an explicit entry always wins:
- `User-Agent: ai-memory/<version>` on every provider. Not opencode-specific:
an unattributable request is the one a rate limiter throttles first, and
any gateway benefits from knowing what called it. Copilot is excluded — it
keeps `GitHubCopilotChat/<version>`, the agent GitHub's API expects.
- `x-opencode-session` on the `opencode` provider, one id per process, since
that header is Zen/Go's own request-correlation field.
Zen/Go permits this. Its documentation ("Where can I use it?", docs/go.mdx)
says Go "is designed to be used with OpenCode and other popular coding
agents that produce a similar types of requests", documents the
`https://opencode.ai/zen/go/v1/...` endpoints for direct use, and asks that
the calling tool "does not generate abusive traffic" and "properly
identifies itself (no broad user agents)". Hence naming ai-memory in the
agent string rather than copying OpenCode's own — identifying the caller is
the requirement, and impersonation would defeat it.
Integration tests drive `build_provider` against wiremock: asserting the
header is on the struct is not the same claim as asserting the right single
value is on the wire.
macOS had no documented way to keep the server running after the
terminal that started it closes, so hook delivery silently stopped.
Add the LaunchAgent counterpart of packaging/systemd/ai-memory-user.service
and ship it in the macOS release tarballs.
launchd expands nothing, so the template carries explicit
__AI_MEMORY_BIN__ / __HOME__ placeholders instead of a home specifier,
and passes neither --data-dir nor --config: both already resolve to the
macOS platform defaults. ProcessType is pinned to Interactive because an
unset value makes launchd throttle CPU and I/O, which the hook ingress
budget cannot absorb.
Config typos were becoming provider 400s on the first consolidation
call. Fail closed at load, then clamp each host to its published
enum so OpenAI/Anthropic/Grok/OpenRouter/Codex get a valid wire value.
Co-authored-by: Cursor <cursoragent@cursor.com>
`release.yml` copies both PKGBUILDs at publish time and rewrites pkgver,
pkgrel and the checksums from the release tag, so the in-repo values never
reach a user. They have read `0.3.2` for a long time, which looks like
neglect and invited #444 — a hand bump to 1.28.0, already two releases
stale by the time it was opened, fixing something that was never broken.
The comment says so at the top of both files and points at the AUR RPC as
the way to check what is actually published (1.29.0-1 for both packages at
the time of writing).
Verified the annotation does not disturb the rewrite: `^pkgver=` still
matches only the real assignment, a simulated release sed produces
`pkgver=1.29.0`, and both files still parse as shell.
Comment-only; no behaviour change, so no changelog entry per the
internal-churn exemption in AGENTS.md.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>