Repository navigation
fix: persist metadata for imported sessions, and list config keys in config get --help - #892
Merged
Merged
Conversation
…nfo entry
`future session set --title/--thinking` on a legacy-imported session printed
"Updated" and persisted nothing; the agent log showed
Failed to persist session name: Query returned no rows
`update_session_info_fields` read the newest `session_info` entry to use as its
merge base, but the legacy importer never synthesises one — it only inserts the
conversation entries the JSONL contained. `query_row` therefore found no row and
failed with a bare "Query returned no rows".
The entry is not the right base anyway: `entry_records` is a *view* that
projects a `session_info` entry's content from `sessions.current_metadata_json`
(`records.rs` `VIEWS`), so the table column is the authoritative copy and
reading the entry only added a dependency on something that need not exist. The
base is now that column, with the three cases kept distinct:
no row -> error, naming the session: the append would fail on its
foreign key anyway, so surface the real cause
NULL column -> empty object: nothing recorded yet, which is exactly the
legacy-import case being fixed
non-object JSON -> error, as before: this is corrupt metadata, and silently
replacing it would drop every other field it held
That third arm is not hypothetical: collapsing it into the empty-object default
while developing this change silently swallowed the corruption two existing
tests inject ("session has no session_info object"), which is how it was caught.
Reporting is deliberately left alone. A genuine durable-write failure is still
logged rather than returned, and `set_thinking_level` documents that choice
("predates fallible RPC setters, so report a durable error without changing its
public signature") with a test pinning it — changing it would alter client-visible
behaviour for the TUI and Desktop, which is a separate decision.
Two other help texts send readers to `future config get --help` for the keys — `config set --help` says "Run `future config get --help` for the settable keys", and the main `config --help` advertises the same — but only `config --help` actually contained them, so following the pointer gave a page with no keys on it. Found by auditing every command the `future-self` skill documents against a real agent, which is also what the skill promises this page contains. The list now lives where it is pointed at, including the accepted values and the "when does it take effect" table. A test asserts every key in the command's own `KEYS` table appears in both help texts and that the pointer still exists, so the two cannot drift apart again; verified by deleting one key and watching it fail.
…set gap Fills in the guide for what the audit found, so the repo-side documentation matches the skill: - **Finding your own session**: the row with `isStreaming: true` is the session executing the turn (verified against a real run), and nothing in the environment carries the id — the `shell` tool has no `$FUTURE_SESSION_ID`. - `session rename` and asynchronous `session compact --session <id>` alongside `session set`. - `session list` returns rows newest-first and its summary deliberately holds no usage; tokens and cost are in `session info <id>`. - The two gaps worth knowing: a session's tool set has **no** CLI switch (`--tools` is a `future run` flag; the persistent per-session set is an RPC), and a never-run session stores a title/cwd change only when it first runs. Skills pointer -> futuregene/future-skills#66 (future-self v1.4.0).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two fixes plus the documentation, found by auditing every command the
future-selfskill names against a real agent.1.
fix(agent): session metadata never persisted for imported sessionsfuture session set --title/--thinkingon a legacy-imported session printed"Updated" and persisted nothing:
update_session_info_fieldsread the newestsession_infoentry as its mergebase, but the legacy importer never synthesises one — it inserts only the
conversation entries the JSONL held, so
query_rowfound no row.The entry was the wrong base anyway:
entry_recordsis a view that projectsa
session_infoentry's content fromsessions.current_metadata_json(
agent/src/session/records.rs,VIEWS), so the table column is theauthoritative copy and reading the entry only added a dependency on something
that need not exist. The three cases are now kept distinct:
The third arm is not hypothetical: collapsing it into the empty-object default
while developing this silently swallowed the corruption two existing tests
inject, which is how it was caught.
Left alone deliberately: reporting. A durable-write failure is still logged
rather than returned, and
set_thinking_leveldocuments that choice ("predatesfallible RPC setters, so report a durable error without changing its public
signature") with a test pinning it. Changing it would alter client-visible
behaviour for the TUI and Desktop — a separate decision.
Regression test reproduces the exact shape the importer produces (conversation
entries, no
session_info) and fails with "Query returned no rows" without thefix.
2.
fix(cli):config get --helpdidn't list the keys it's pointed atTwo other help texts send readers there —
config set --helpsays "Runfuture config get --helpfor the settable keys" — but onlyconfig --helpactually hadthem, so following the pointer produced a page with no keys. The list now lives
where it is pointed at, with accepted values and the "when does it take effect"
table.
A test asserts every key in the command's own
KEYStable appears in both helptexts and that the pointer still exists, so they cannot drift apart again;
verified by deleting a key from one text and watching it fail.
3.
docs(self)+ skill: coverage the audit showed was missingSkill → futuregene/future-skills#66
(
future-selfv1.4.0), which corrects two claims that were simply wrong:future session set <id> --tools read,shelldoes not exist —--toolsisa
future runflag, and the persistent per-session set is an RPC the TUI andDesktop call. An agent following the old text would have promised a tool change
it cannot make.
future session list --jsonwas described as carrying "usage"; it carries none(tokens/cost are in
session info <id>).And fills gaps the skill depended on but never explained: which session am I
(the
isStreaming: truerow — verified against a live run),session rename,asynchronous
session compact, list ordering, and the never-run case.How the coverage was verified
Every command the skill names, run against an isolated
FUTURE_HOMEon a freshport with sessions seeded via
--migrate-sessions(no model calls, no cost):65 assertions, all passing, including the documented argument-rejection
boundaries and the
byteOffset→get --offsethandoff.isStreamingwasverified with a local OpenAI-compatible endpoint that accepts and never answers,
so a run could be held open without credentials or spend.
Scoped checks
Not changed (flagging, not fixing)
future auth credentialprints "Not logged in." and exits 0 when logged out— pinned by unit tests and a 1:1 port of the retired TS CLI, so scripts must read
the payload rather than the status. Debatable for a scripting command, but
changing it is a product decision.