[protocol] Reject an AgentSession with no Thread

Open Beginner friendly
#633 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
database

Research direction

Read docs/core/agent-session.md at lines 21 and 165, then inspect packages/protocol/src/models/agent.ts at line 47 and apps/nanocore/src/storage/schema/work-product.ts at line 47. Make threadId required in the protocol schema and the thread_id column, preserving the existing creation refusal and stored rows that already have a Thread. Done when both schemas enforce the documented one-Thread rule.

Written by the indexing model from the issue text.

Description

after-v0.1.0 bug

Doc rule. docs/core/agent-session.md:21 and :165 bind an AgentSession to exactly one Thread for its whole life.

Current code. packages/protocol/src/models/agent.ts:47 types threadId as nullable. apps/nanocore/src/storage/schema/work-product.ts:47 leaves thread_id nullable. apps/nanocore/src/lib/store.ts:5868-5870 already refuses creation when threadId is missing, so this is a schema hole, not a shown production threadless session.

Impact. A retained or imported row can still omit the Thread. Readers cannot rely on the schema for the cardinality the core doc requires.

Smallest fix. Require threadId on the protocol schema and the column. Keep the existing create refusal. Do not rewrite historical rows that already have a Thread.

Source finding IDs. DOC-C-02

Filed from the 2026-11-07 core-doc audit (base 27fb8a0013ec86729475617609e9acc3fcb376f3); deferred past v0.1.0 by coordinator + Astra adjudication.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
5h 57m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lingkaix/openkit

All issues in lingkaix/openkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.