Skip to content

fix(session): wire SessionGoal/SessionLedger into the httpapi app node list - #9

Merged
sepo-eng merged 1 commit into
devfrom
fix/tkt-317-goal-ledger-node-wiring
Aug 10, 2026
Merged

fix(session): wire SessionGoal/SessionLedger into the httpapi app node list#9
sepo-eng merged 1 commit into
devfrom
fix/tkt-317-goal-ledger-node-wiring

Conversation

@sepo-eng

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • New feature
  • Bug fix
  • Refactor / code improvement
  • Documentation

What does this PR do?

Standalone, urgent extraction from TKT-315's in-flight branch, per Ethan's sequencing call: this
is a live defect on merged dev, not something that should wait behind TKT-315's own PR
(which is separately held pending Henry's TKT-314 for its app half).

session.goal.* and session.ledger.* routes have been 500ing with "Service not found" from cold
boot since #7 (TKT-317) merged: the app's LayerNode.group in
packages/opencode/src/server/routes/instance/httpapi/server.ts — the V1 HttpApiApp, which is
what test:httpapi and the live server actually build against, not
packages/server/routes.ts — never listed SessionGoal.node / SessionLedger.node. Two-line fix:
list them explicitly, same pattern as every other node already in that list.

This blocks Gemma's slice-5 gate, which runs test:httpapi in mode=effect — the only mode that
currently exercises this path enough to catch it.

Enumeration, per Ethan's earlier ask (grep every AppNodeBuilder/LayerNode.group full-app
assembly site in the repo): there are five —
packages/server/src/routes.ts (v2 API, cli/sdk-next), packages/cli/src/commands/handlers/serve.ts,
packages/sdk-next/src/opencode.ts, packages/opencode/src/server/routes/instance/httpapi/server.ts
(this file — the one that was actually missing the fix), and
packages/opencode/src/effect/app-runtime.ts (CLI/TUI). location-services.ts is a sixth
LayerNode.group call but is a different category — per-location services, not a full-app
composition site, and global nodes don't belong there.

Checked all five against fresh dev (this branch, before any TKT-315 changes): only this file
(server.ts) currently has both SessionGoal/SessionLedger routes registered and the nodes
missing — that's why it's the only one fixed here. app-runtime.ts has no references to
SessionGoal/SessionLedger/ProjectV2 at all today, so nothing there is currently reachable
through a crash; TKT-315's own branch found and fixed a related but distinct gap there once
ProjectV2's interface grew (documented in that PR, not duplicated here). The full checklist,
with the HttpRouter.toWebHandler/provideRequest distinction that makes sdk-next special,
lands in FORK.md via TKT-315's PR.

Fixing this crash unmasked a separate, unrelated pre-existing bug in TKT-317's own code:
v2.session.goal.get fails one assertion in mode=effect only ("a session with no goal set
should report no data"). Not fixed here — filed as feedback anomalyco#145, documented as a new named
exception in FORK.md's known-red table, same convention as TKT-305's CI-enablement PR.

How did you verify your code works?

  • bun typecheck: 30/30 green.
  • packages/opencode test:httpapi --mode coverage: 221/0 (was crashing on every goal/ledger
    scenario before this fix).
  • packages/opencode test:httpapi --mode auth: 221/0 (same).
  • packages/opencode test:httpapi --mode effect: 220/1 — the crash is gone; the one remaining
    failure is the newly-unmasked, newly-filed, newly-documented TKT-317 assertion bug above, not
    caused by this diff.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…e list
session.goal.* and session.ledger.* routes were 500ing with "Service not
found" from cold boot on merged dev: the app's LayerNode.group in
packages/opencode/src/server/routes/instance/httpapi/server.ts (the V1
HttpApiApp -- what test:httpapi and the live server actually build
against, not packages/server/routes.ts) never listed SessionGoal.node /
SessionLedger.node after they landed in #7 (TKT-317).
Found while working TKT-315, extracted standalone per Ethan's
sequencing call: this is a live defect on merged dev, not scoped to
TKT-315's own PR, and TKT-315's own gate should not hold Gemma's
slice-5 gate hostage (test:httpapi effect mode is what catches this
class of bug).
Validation: bun typecheck 30/30. test:httpapi mode=coverage 221/0,
mode=auth 221/0 (both were crashing on every goal/ledger scenario
before this fix). mode=effect 220/1 -- the crash is gone; the one
remaining failure (v2.session.goal.get, "a session with no goal set
should report no data") is TKT-317's own pre-existing assertion bug,
now reachable for the first time instead of masked by the crash. Filed
as feedback anomalyco#145, documented as a named exception in FORK.md's
known-red table, matching the TKT-305 convention.
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No issue referenced. Please add Closes #<number> linking to the relevant issue.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@sepo-eng
sepo-eng merged commit 627eaaa into devAug 10, 2026
4 of 10 checks passed
@sepo-eng
sepo-eng deleted the fix/tkt-317-goal-ledger-node-wiring branch August 10, 2026 19:07
sepo-eng pushed a commit that referenced this pull request Aug 10, 2026
slice-4 defect surfaced by effect mode post-#9, fixed here. `{ data:
yield* goal.get(...) }` keeps the "data" key present with value
undefined when no goal exists; the httpapi JSON encoder writes that as
`data: null` rather than omitting the key, so a client checking
`=== undefined` for "no goal set" sees null instead. Omitting the key
entirely (not just its value) is what round-trips as absent -- caught
by httpapi-exercise effect mode once #9 cleared the node-list gap that
was masking it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@sepo-eng