BuildRiot
Sign in

Article · AI

How to test Hy Memory 2.0 across branch switches and conflicting fixes

Hy Memory’s Coding mode combines facts, reusable experiences, and revision history. This guide proposes a controlled test of whether it preserves captured edits later rejected or reverted, respects project and branch boundaries, and helps a fresh agent complete related tasks.

A warmly lit miniature bookbinding workshop shows divided workspaces, blue and lavender paper repairs, and drawers preserving earlier versions for reuse.
Illustration: BuildRiot (AI-generated)

Key takeaway

A remembered fix can still be wrong for the active branch. Evaluating capture, retrieval, and code changes separately helps developers identify where memory helps and where it introduces mistakes.

A remembered fix can belong to the wrong branch

Hy Memory’s Coding mode links retrieved facts to revision histories, providing a way to test whether an agent can recover abandoned fixes. Tencent dated SDK 2.0.1 to October 16, 2026. Its memory-writer paper was submitted on October 15, 2026. Coding combines session facts, reusable experiences, and revision chains. The practical question is whether those components help a fresh agent recover the right decision after a branch switch. Sources: Tencent Hunyuan, arXiv

Consider a fixture where one branch needs retries and another forbids them. An agent that recalls the newest decision across both branches could produce a convincing but incorrect patch. The test must establish which decision applies, how it changed, and whether that history improves subsequent work. Correct recall across conflicting branches and projects remains unproven; this guide proposes an experiment and reports no harness results.

Freeze the release and check scope rules

Treat 2.0 as a release family rather than a reproducible configuration. Tencent’s changelog dates 2.0.2 and 2.0.3 to October 17, 2026. The repository names 2.0.4, while installation examples pin 2.0.3. Version 2.0.3 adds an HTTP transport factory. The changelog says extraction, reconciliation, storage, and Coding/Working behavior remain unchanged. Record the installed version, repository commit, models, prompts, embeddings, storage paths, operating system, and retrieval budget. Sources: Tencent Hunyuan

The changelog’s Unreleased section lists a fix for reconciliation mutating facts or experiences across authorities, conversations, or workspaces. Do not assume this fix ships in a published package. Record whether the tested commit includes it. After ingestion, inspect stored facts and experiences for cross-scope mutation against the reference manifest. Cross-project failures could begin during ingestion, before retrieval filtering. Sources: Tencent Hunyuan

According to the repository documentation, Coding writes require tool-call traces and pro or ultra mode; lite ignores the scene. Revision chains attach to retrieved facts rather than being retrieved independently. Successful patch capture therefore cannot compensate for a missing retrieved fact. Test capture and retrieval separately before assessing the agent’s final patch. Sources: Tencent Hunyuan

The usage guide says omitting workspace_id disables workspace filtering, while supplying it requires an exact match. Branch filtering takes effect only alongside workspace_id and retains records with a null branch. Normalize project identities and log both scope values. Count advice from another branch separately from incompatible branchless advice. Sources: Tencent Hunyuan

Build histories that make the wrong answer plausible

Create two small repositories with identical paths and function names, then give each two branches. Use the conflicting histories in the table below to make semantic similarity insufficient for selecting the correct policy. These timeout values are proposed fixtures, not product measurements. Interleave the histories in a predetermined order. Then reverse it so the globally newest fix sometimes belongs elsewhere.

Table

Proposed timeout policies by project and branch, in seconds

ScopeSeeded historyExpected later behavior
Project A, mainTimeout rises from 2 to 10 seconds; latency regression leads to rejectionKeep 2 seconds with bounded retries; explain rejection
Project A, release/legacyRetries rejected because requests lack idempotency protection; retain 10 secondsAvoid importing main’s retry policy
Project B, mainContract requires 30 seconds and no retriesPreserve Project B’s contract
Project B, release/legacyOlder contract requires 5 secondsAvoid cross-project and cross-branch substitution
These proposed fixtures use overlapping paths and function names to test scope and revision recall.

Add an uncommitted patch that is captured and then reverted, and an incompatible statement without branch metadata. Treat a proposal that is never applied as a separate exploratory case. These cases separate actions from suggestions and historical decisions from current policy. Keep an immutable reference manifest outside the agent’s accessible workspace. Record event identity, workspace, branch, path, symbol, status, superseded event, reason, and patch hashes. Preserve actual traces, test outputs, and event ordering; never fabricate successful tool results.

Start with deterministic replacements, then evaluate Git-derived capture separately. Hy Memory documents replacements containing path, old, and new fields. It also documents local Git-diff capture configured through MEMORY_CODING_CHAIN_REPO_ROOT. Capture is best effort: unparseable edits can be skipped even when the memory write succeeds. Compare captured patches against the manifest before running recall probes to distinguish a missing edit from a retrieval failure. Score successful writes with missing expected diffs as capture failures. Sources: Tencent Hunyuan

Restart before testing recall

A persistence test should remove the conversation that originally explained the fix. Close the client, discard conversation context, and restart against the same store before switching the checkout. Run diagnostic recall separately from realistic coding continuations. Give every coding condition identical repository and Git access so memory receives no artificial advantage.

  1. Create isolated stores for each condition and ingest identical interleaved histories.
  2. Record write responses and errors, then verify captured patches against their hashes. Inspect stored facts and experiences for cross-scope mutation after ingestion.
  3. Restart the process, switch checkout, and log the active workspace and branch.
  4. Request the current fix, rejected fixes, event order, reasons, and supporting memory identifiers.
  5. Give a fresh agent a related coding task without restating earlier decisions.
  6. Grade the resulting patch with hidden behavioral and regression tests.
  7. Repeat with changed ingestion order and retain responses, prompts, patches, timings, tokens, and errors.

Inspect prompt assembly as carefully as search results. The documented limit applies separately to facts and experiences. A limit of five can mean five of each before revision context. Facts marked by chain_used remain in the response even when represented in chain_block. Avoid duplicating those facts, and report both natural response size and a comparison with matched token budgets. Otherwise, truncation could remove the rejected fix the experiment seeks to recover. Sources: Tencent Hunyuan

Use controls that explain the result

The table below separates memory’s overall value from the contributions of extraction and revision context. Keep the reader model, task prompts, tool access, and token budgets fixed. For the chain comparison, reuse the same retrieved facts and change only whether the reader receives chain context. This measures the value of presenting history at read time; it does not measure ingestion savings.

Table

Proposed controls for coding-memory evaluation

ConditionQuestion
No persistent memoryDoes memory improve task outcomes?
Scoped raw transcript retrievalDoes extraction improve on a simpler history store?
Hy facts and experiences without chain contextWhat does revision context add at read time?
Full Hy coding responseDoes the complete coding path help?
Human-authored reference contextCan the agent solve the task with correct recall?
Full Hy with another writerHow sensitive are results and cost to writer choice?
Each condition tests a different contribution to subsequent task performance.

Writer choice deserves its own control. Tencent reports overall scores of 55.49 for Hy-Memory-30B-A3B and 54.62 for Claude Opus 5. It uses fixed 20% benchmark subsamples and equally weighted framework scores. Within the Hy-Memory framework, Coding Memory Benchmark (CMB) scores are 70.73 for Tencent’s writer, 75.70 for Opus 5, and 77.18 for DeepSeek V4.1 Flash. The authors describe the separate 0.01–0.02-point framework margins as statistically insignificant. A pooled lead therefore does not establish a lead in coding recall. Sources: arXiv

Aura’s author reports 43% across 60 selected LongMemEval questions for Hy 2.0.1 with Gemini 3.8 Flash writing memories, versus 95% for Aura. A smaller Opus 5.5 writer run reached 9/10 on updates. The author reports roughly $5 and 11 minutes to ingest one approximately 50-conversation history. The selected samples, competing-product authorship, and different evaluation design limit direct comparison with Tencent’s results. Use this report to motivate writer and cost controls. Sources: arXiv, DEV Community

Publish failures by stage and gains by task

Score current-state accuracy separately from historical recall and revision-order accuracy. Count foreign-scope claims, incompatible branchless advice, and unsupported claims as distinct failures. Do not substitute chain_rounds for historical recall. Tencent defines it as processed diff hunks, not necessarily unique revisions. Compare scoped recall before and after restart to measure persistence directly. Sources: Tencent Hunyuan

For coding continuations, report hidden-test success and the harmful-memory rate. Calculate that rate by dividing paired tasks that pass without memory and fail with memory by all paired tasks that pass without memory. Report both counts; if no tasks pass without memory, the rate is undefined. Include write and read latency, tokens, storage growth, retries, and cost per successful continuation. Show counts alongside percentages. Start with a debugging pilot before expanding to independently varied histories and repeated runs. Estimate uncertainty across scenario families rather than treating questions about one history as independent evidence.

Classify failures as capture, extraction, reconciliation, retrieval, chain attachment, prompt assembly, or agent use. Then extend the harness to branch renaming, rebasing, cherry-picking, concurrent worktrees, and moved functions. In Git-capture runs, test whether checkout-induced differences are mistaken for edits. Set acceptance thresholds before running these cases. Tie them to the application’s branch isolation and task-success requirements.

Attribution

Sources

  1. 1Tencent HunyuanHy-Memory repository and README
  2. 2Tencent HunyuanWorking and Coding usage guide
  3. 3Tencent HunyuanHy-Memory changelog
  4. 4arXivHy-Memory-30B-A3B: Attributed Reinforcement Learning for Long-Term Memory WritingSource published (UTC)
  5. 5arXivHy-Memory-30B-A3B abstract and submission historySource published (UTC)
  6. 6DEV CommunityTencent's Hy Memory Is Only as Good as the LLM That Writes It. I Measured It on LongMemEval

Read the original source for full details and context.

Report a problem

Links, dates or what you expected. Do not include passwords or private data.

More on AI

All AI stories