Skip to content

feat(kin): one stored session per chat survives restarts and long gaps, with notes instead of resets - #1095

Merged
GLDRoger merged 23 commits into
kinfrom
train-18-1129/step-4
Nov 29, 2026
Merged

GLDRoger merged 23 commits into
kinfrom
train-18-1129/step-4

Conversation

@GLDRoger

Copy link
Copy Markdown
Owner

Kin ends an agent's provider session at every restart, every change to a standing rule or list, and after a long gap, so the model loses the conversation and pays to read the whole prompt again. Rooms and teammate chats start fresh every turn.

  • Changes to standing rules, lists, budgets, recipes, the time zone and the index now arrive as notes in the same session instead of ending it. A rule change carries the whole new rulebook under "# Standing rules changed since your previous turn". Outside content, permission, audience and lifecycle changes still start fresh.
  • One stored session per chat (migration K246, kin_session_seen) survives restarts and long gaps. While it is still warm, Kin compacts a large owner session itself and opens the next turn with the current rules, then that chat's own quoted summary.
  • A confined room or teammate chat keeps its own session while its audience and briefing stay the same. Seats that can reach other chats' files stay fresh.
  • Each fresh start records its reason code.

People-change: Kin remembers the conversation in your own chat, or in a room it can safely keep, across restarts and breaks; when who can read it changes, Kin starts the session over.

Checked as part of train 18's one check at the tip.

Three independent reviews by Claude Opus 5.5 (company data as notes, owner chats across restarts, and confined sessions) each found it LANDS AFTER FIXES. The first two reviews' fixes are on this branch; the third's arrive as their own PR.

🤖 Generated with Claude Code

GLDRoger and others added 23 commits November 29, 2026 15:09
T3-file: evals/mcp-tool-use/changed/surface.ts: pin the joined reviewed runner

People-change: none

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Keep owner Claude sessions when definitions or the memory index change. Send whole rule revisions outside data quotes; keep outside-content and authority resets, and start fresh if a rule revision cannot fit.

T3-file: evals/mcp-tool-use/kin.ts: render live-format standing and data notes in carry samples
T3-file: evals/mcp-tool-use/changed/surface.ts: pin the reviewed note render path

People-change: Kin keeps the conversation when company data changes and reads rule changes without losing the chat.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
T3-file: evals/mcp-tool-use/run.ts: the reviewed first-response fixture must stop in the shared response loop before dispatch; this merge does not add another execution path.

People-change: none

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
T3-file: apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts: reconcile the provider request fixture without changing the ordinary prompt

People-change: none

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
People-change: none

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
J3a removed the standing reset for every standing part of the briefing, but only
the rulebook gets a note: a withdrawn owner permission, a person's access, a
playbook or What we sell now carry unseen. These fail on the reviewed tip.

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s changes

The rulebook reaches a carried session as a note, so it leaves the standing key;
the seat's owner permissions, the people, playbooks, What we sell and set-up
stay in it and still start a fresh session (`standing`) when they change.

People-change: An agent starts a new conversation again when the owner changes its standing permissions, the team or the playbooks; a rule edit still keeps the conversation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…carries

The "by" in a rule line is the git author string of the last commit to
rules.md, which whoever pushed chose; and any rulebook over about 900
characters made every edit start fresh, though a fresh start sends the whole
rulebook again. These fail on the reviewed tip.

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People-change: none

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…ny length

The line said "changed by" the last commit's git author, a name whoever pushed
set, and a missing name ended the session; it now states only when. A rule
note is always sent whole, beside the turn or, past the hook's bound, in its
message, instead of starting fresh past about 900 characters.

People-change: A long rulebook's edit keeps the conversation; Kin no longer names who changed a rule from the memory repo's commit author.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…outside quotes

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Persist the exact seen chat and provider session, resume eligible small sessions cold, and compact warm idle work once. Restart only its own chat with a quoted summary and current standing rules; book only incremental SDK spend.

People-change: Owner chats keep their place across restarts and breaks.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Match stored and current standing authority across restarts, send long rulebook notes inline, and keep current rules and maintenance receipts separate from old session data.

T3-file: evals/mcp-tool-use/kin.ts: match the rule note renderer, which no longer refuses long documents.
T3-file: evals/mcp-tool-use/changed/surface.ts: re-pin the reviewed fixture runner from failing test output.

People-change: Owner rulebook edits stay in the same session; other standing changes start a fresh one.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
An unread hook deliberately has no reusable snapshot. Keep its existing missed diagnosis ahead of the generic missing-standing-key fallback.

People-change: none

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
A cold session is sized against the shared part, not the first briefing, so a
cold resume never rewrites more than a fresh start would. A restart from a
compaction summary keeps the summarized session's sensitive mark.

Both fail at 4fb98e8.

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cold resume rewrites everything after the shared part, the first briefing
included, so the 5,000-token rule now measures from that part: a warm first
request's read, or the part's next larger read when the block was cold. Before,
a "small" cold resume could rewrite the briefing plus 5,000 tokens, about twice
a fresh start.

A restart from Kin's compaction summary now inherits the summarized session's
marks, as a carried turn does: the summary holds what that session was shown,
so a sensitive Work entry it read keeps what the next turn writes the owner's.

People-change: A chat that restarts from its summary keeps its private notes private.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The live J3b run measured a first briefing of 5,240 tokens. Measuring from the
shared part alone would make no cold session small, so a cold resume would
never happen. The base past the first briefing is the right measure: a cold
resume costs a fresh start plus the conversation after that briefing. The
comment now says so. The summary-mark fix stays.

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep a separate Claude session per confined chat and end reuse when its saved audience or authorized briefing changes. Refuse cross-chat wakes and unproven transcript contents.

People-change: A confined room or teammate chat keeps its conversation while the people and information it can see stay the same.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
People-change: Sensitive information stays protected when Kin restarts a chat from its summary.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Use one size baseline for warm and cold first requests. Pin mark inheritance, transcript tool denial and scoped snapshot deletion.

People-change: A small chat can continue after a cold gap even when its first request started cold.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
A provider-generated summary lacks the same fresh-briefing proof as ordinary chat context. Leave the owner's existing refill path unchanged.

People-change: Confined chats start fresh after the provider summarizes a long session.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…ps, with notes instead of resets

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People-change: none

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@GLDRoger
GLDRoger merged commit 5941018 into kin Nov 29, 2026
14 of 17 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T15:35:13.782296Z 7ac1d45 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant