Skip to content

fix(#9517)!: remove the sticky history folding and keep_history - #9986

Merged
waynesun09 merged 14 commits into
fullsend-ai:mainfrom
tpouyer:chore/9517-sticky-remove-history-folding-keep
Dec 3, 2026
Merged

waynesun09 merged 14 commits into
fullsend-ai:mainfrom
tpouyer:chore/9517-sticky-remove-history-folding-keep

Conversation

@tpouyer

@tpouyer tpouyer commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

#9334 made every agent post a new comment per run instead of editing one in place; this removes the compatibility machinery it kept: the history folding and the keep_history setting.

Related Issue

Fixes #9517

Changes

  • internal/sticky: BuildUpdatedBody, the Previous run folding (detailsRe, legacyDetailsRe, history sentinels) and Config.KeepHistory/Config.FooterMarker deleted; posting is new-comment-only. Tests of the removed code are deleted or trimmed; other test edits swap keep_history fixtures for kill_switch or roles.
  • internal/cli: --keep-history stays a hidden no-op on the three posting doors; pre-Remove sticky comments: post every agent result as a new comment #9334 post-scripts pass it unconditionally under set -euo pipefail, and its deprecation warning never prints. --fullsend-dir becomes a hidden no-op on post-comment and post-review only, which no longer load config.yaml for keep_history; on issues post-comment it keeps working for tracker and Jira defaults. Why-and-until-when comments mark the read-side sentinel handling in reviewdedup.go and jira/adf.go; the flag shim in issues.go carries its own.
  • internal/config: keep_history leaves perRepoConfig, ManagedConfig, defaults and effective config, and ConfigKeepHistory/SetKeepHistory the reader/writer interfaces; managed overlays reject the key (the breaking surface), a repo's own config.yaml keeps loading.
  • internal/repos: fullsend repos adoption guidance — proposals drop overlay keys the managed validator rejects (each named and quoted in a note) instead of proposing config blocks that fail validation, keys with a dedicated migration error (create_issues) stay in the proposed block so the strict-decode probe reports the migration path, and the settings difference marks a removed key as a setting that no longer exists, carrying the migration text where there is one.
  • internal/forge/jira/adf.go: comments cite pre-Remove sticky comments: post every agent result as a new comment #9334 CLIs, not the deleted builder.
  • Scaffold scripts: comment-only (below).
  • internal/agentnew: post.sh.tmpl and its four goldens, comment only (the flag's behaviour history by version); its help-probe stops passing --keep-history to a current CLI (the flag is now hidden).
  • Docs (own commit): keep_history and the sticky/Previous run passages dropped from five pages.

Protected paths

  • internal/scaffold/fullsend-repo-gitlab/.gitlab/ci/scripts/run-agent-job.sh — comment only: four lines on why the sticky:history-start cut stays while pre-Remove sticky comments: post every agent result as a new comment #9334 review comments age out.
  • internal/scaffold/fullsend-repo/scripts/pre-fetch-prior-review.sh — comment only: one line reworded, four added, same reason.
  • internal/scaffold/fullsend-repo/scripts/pre-fetch-prior-review-test.sh — comment only: drops the reference to the deleted sticky.BuildUpdatedBody.

Reproduction

Four new test files hold the acceptance tests; six fail on the base, pass at head: --keep-history removed or hidden on each of the three doors, the generated post-script passing no flag to a current CLI, managed-overlay rejection of keep_history, and a guard for the removed symbols in production Go. A seventh, that a repo's own config.yaml with keep_history still loads, passes on both. Checks green: make lint, go vet; patch coverage 35/35 (final review).

External re-check

Re-checked scripts/post-code.src.sh and scripts/pre-review.src.sh in fullsend-ai/agents at main (7c5993fb, 2026-12-01): post-code.src.sh posts via issues post-comment --tracker jira --marker <!-- fullsend:code-agent --> --result - and passes no --keep-history, so the hidden no-op does not affect it. Its rerun note (post-code.src.sh:388-389) still says a rerun after an ambiguous POST 5xx relies on the CLI's sticky-marker property lookup to find a created comment — a lookup the always-create change (#9399, 635b640) already removed, so a rerun has posted a duplicate comment since v0.58.0; this PR changes nothing there. pre-review.src.sh:85-88, the read-side sentinel cut that actually runs, still says "The poster preserves old markers in sticky history".

Follow-ups

Closes #7468, closes #7289 and closes #7290 as obsolete when this merges: all three ask to fold or cap the Previous run sticky history, machinery that has been dead since #9334 made every result a new comment and that this change deletes. fullsend-ai/agents#324 asks for the same capping and is obsolete the same way; closing keywords cannot reach another repository, so it needs a manual close.

Re-check #6150: it asks for a way to skip the sticky find-and-update behaviour — behaviour #9334 already removed (every result is a new comment); this PR deletes the leftover folding machinery and the keep_history surface.

Re-check #8858: it asks for a visible signal when a run only edits the sticky comment — behaviour #9334 already removed (every result is a new comment); this PR deletes the leftover folding machinery and the keep_history surface.

Deferred from the final review: the dead FULLSEND_DIR env default in addLegacyFullsendDirFlag; the false "never regenerated" and "nothing is edited in place" comments.

In fullsend-ai/agents: reword pre-review.src.sh:85-86 into the read-side-shim note the scaffold copies carry, and fix or guard the post-code.src.sh rerun expectation (accept duplicate comments on rerun, or add an idempotency check).

Testing

  • make lint passes (stage changes first, then run)
  • Tests added/updated for new or modified logic

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO) — human and human-directed agent sessions only
  • I wrote this contribution myself and can explain all changes in it

BREAKING CHANGE: managed configuration overlays now reject keep_history through strict validation — delete the key from managed repos.yaml config blocks; it has had no effect since #9334.

@tpouyer
tpouyer requested a review from a team as a code owner December 1, 2026 13:46
…ry folding

Acceptance tests for fullsend-ai#9517 (5
of 7 criteria; the rest declared for a person).
ac_1: TestHistoryFoldingMachineryRemovedFromProductionGo
ac_2: TestPostCommentCmd_KeepHistoryRemovedOrSilentHiddenNoOp,
TestIssuesPostCommentCmd_KeepHistoryRemovedOrSilentHiddenNoOp,
TestPostReviewCmd_KeepHistoryRemovedOrSilentHiddenNoOp
ac_3: TestLoadConfig_KeepHistoryKeyToleratedAfterRemoval,
TestManagedConfig_KeepHistoryKeyRejectedAfterRemoval
ac_4: TestGeneratedPostScriptPassesNoKeepHistoryToCurrentCLI
ac_5: TestHistoryFoldingMachineryRemovedFromProductionGo
ac_6: not testable — docs: keep_history and the sticky/Previous-run passages
are removed from docs/reference/config-reference.md,
docs/guides/infrastructure/layered-config-reference.md and
docs/contributing/config-source-inventory.md, and the changelog states the
flag and key decisions; a person reads that diff on the PR (doc wording is
not tested)
ac_7: not testable — external: the re-check reads fullsend-ai/agents
scripts/post-code.src.sh (marker <!-- fullsend:code-agent -->), a different
repository, and its outcome is recorded in this PR's body; a person does the
re-check and writes the PR body section
Red run on the base: 6 of these fail
(TestPostCommentCmd_KeepHistoryRemovedOrSilentHiddenNoOp,
TestIssuesPostCommentCmd_KeepHistoryRemovedOrSilentHiddenNoOp,
TestPostReviewCmd_KeepHistoryRemovedOrSilentHiddenNoOp,
TestGeneratedPostScriptPassesNoKeepHistoryToCurrentCLI,
TestManagedConfig_KeepHistoryKeyRejectedAfterRemoval,
TestHistoryFoldingMachineryRemovedFromProductionGo); the log is kept in the
run's evidence.

Signed-off-by: Tim Pouyer <tim.pouyer@gmail.com>
…story

Fixes fullsend-ai#9517

Acceptance tests: see the test(fullsend-ai#9517) commit in this branch.

BREAKING CHANGE: managed configuration overlays now reject keep_history
  through strict validation — delete the key from managed repos.yaml config
  blocks; it has had no effect since fullsend-ai#9334. A repository's own config.yaml
  keeps loading (the layered loader ignores unknown keys), and --keep-
  history stays a hidden no-op on the three posting doors.

Signed-off-by: Tim Pouyer <tim.pouyer@gmail.com>
@qodo-code-review

qodo-code-review Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Remove sticky history folding and keep_history setting

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Deletes sticky history folding (BuildUpdatedBody, "Previous run" regexes, KeepHistory,
 FooterMarker); posting is new-comment-only.
• Removes the keep_history config key from the per-repo config, defaults and effective YAML;
 managed overlays now reject it, while a repo's own config.yaml still loads.
• Keeps --keep-history as a hidden no-op and --fullsend-dir as a hidden no-op on
 post-comment/post-review, so pre-#9334 post-scripts keep running; adds acceptance and guard
 tests.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 2 capabilities

  • 2 affected capabilities span independent functional scopes: agent-result-posting, repository-configuration-management.
  • Issue, comment, review, and sticky posting entry points all produce the same end-to-end agent-result delivery behavior; their differences are invocation hops within one bounded delivery integration.
  • Parsing, layering, validating, rendering, installing, and adopting sparse per-repository configuration are one bounded configuration-management integration.
  • The changed schema, diagnostics, effective rendering, and adoption proposal all determine the same repository configuration outcome.
Sources

internal/cli/issues.go[504-506]

	stickyCfg := sticky.Config{
		Marker: cfg.marker,
		DryRun: cfg.dryRun,
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Straightforward

  • Before, posting commands resolved keep_history from flags or layered configuration and passed it into sticky posting.
  • After, they omit that state, preserve hidden legacy flag parsing, and retain append-only posting.
  • New correctness condition: pre-cleanup callers must remain parseable while the removed state cannot affect output; this is compatibility handling plus direct field removal, not a new posting algorithm.
Sources

internal/cli/issues.go[504-506]

	stickyCfg := sticky.Config{
		Marker: cfg.marker,
		DryRun: cfg.dryRun,
Potential damage 🟡 Medium 🩹 Temporary loss

  • A regression in compatibility registration or posting configuration construction could stop an affected command before its result comment or review is created; unrelated agent execution is not reached.
  • Reverting restores the prior command wiring.
  • A missed comment or review may still require rerunning the posting command after rollback.
Sources

internal/cli/issues.go[504-506]

	stickyCfg := sticky.Config{
		Marker: cfg.marker,
		DryRun: cfg.dryRun,
Assessed commit 978f412
Diagram

graph TD
  A["CLI post doors"] --> B["sticky.Post"] --> C["New forge comment"]
  D["config.yaml loader"] --> E["Managed overlay check"]
  E -->|"keep_history rejected"| F["Error"]
  G["Jira ADF + reviewdedup"] --> H["Sentinel read shim"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Tolerate keep_history in managed overlays as a warned no-op
  • ➕ No breaking change for existing fleet overlays
  • ➕ Consistent with repo config.yaml behaviour
  • ➕ Upgrade does not fail managed config preflight
  • ➖ The dead key stays in the schema longer
  • ➖ Managed-config strictness is weaker
2. Keep the sticky folding behind a config flag

Recommendation: The new-comment-only posting and the hidden flag shims are sound and match the PR's stated compatibility story. The one choice worth a second look is rejecting keep_history in managed overlays while silently tolerating it in a repo's own config.yaml. That asymmetry is a breaking change for any fleet with an existing overlay. Tolerating the key in both places (warn once, then ignore) would avoid breaking admins on upgrade, at the cost of keeping a dead key in the schema for longer.

Files changed (42) +624 / -864

Enhancement (9) +53 / -301
issues.goReplaces keep-history resolution with hidden legacy flag shims +26/-46

Replaces keep-history resolution with hidden legacy flag shims

• Removes resolveKeepHistory and its warning. Adds addLegacyHistoryFlag (hidden, no-op) and addLegacyFullsendDirFlag (hidden, no-op), both with why-and-until-when comments. sticky.Config no longer receives KeepHistory.

internal/cli/issues.go

postcomment.goMakes post-comment keep-history and fullsend-dir hidden no-ops +10/-29

Makes post-comment keep-history and fullsend-dir hidden no-ops

• Removes keep-history resolution from RunE and stops reading config.yaml. Registers the legacy flags through the shared shims.

internal/cli/postcomment.go

postreview.goMakes post-review keep-history and fullsend-dir hidden no-ops +12/-30

Makes post-review keep-history and fullsend-dir hidden no-ops

• Same change as post-comment: legacy flags become hidden no-ops and the command no longer loads config for keep_history.

internal/cli/postreview.go

config.goRemoves KeepHistory field from perRepoConfig and marshal struct +0/-8

Removes KeepHistory field from perRepoConfig and marshal struct

• Deletes the KeepHistory field and its marshal mapping. Unknown keep_history keys in repo config are no longer stored.

internal/config/config.go

defaults.goRemoves ConfigKeepHistory default accessor +0/-6

Removes ConfigKeepHistory default accessor

• Deletes the perRepoDefaults method that returned the default keep_history true.

internal/config/defaults.go

effective.goDrops keep_history from effective YAML output +2/-3

Drops keep_history from effective YAML output

• Removes the keep_history key from the effective configuration map.

internal/config/effective.go

interfaces.goRemoves ConfigKeepHistory and SetKeepHistory from interfaces +0/-22

Removes ConfigKeepHistory and SetKeepHistory from interfaces

• Deletes the keep_history getter from PerRepoConfigReader, its setter from PerRepoConfigWriter, and both implementations.

internal/config/interfaces.go

managed.goRemoves keep_history clone and merge handling +0/-8

Removes keep_history clone and merge handling

• Drops the KeepHistory copy in clonePerRepo and applyManagedLayer. Managed overlays rely on strict unmarshal to reject the key.

internal/config/managed.go

sticky.goRemoves BuildUpdatedBody, history regexes, and KeepHistory config +3/-149

Removes BuildUpdatedBody, history regexes, and KeepHistory config

• Deletes FooterMarker, KeepHistory, the sentinel constants, detailsRe, legacyDetailsRe, and BuildUpdatedBody. Posting now always creates a new comment.

internal/sticky/sticky.go

Tests (22) +530 / -521
codex.txtUpdates golden post-script comment for keep-history +4/-3

Updates golden post-script comment for keep-history

• Golden fixture matching the template comment rewording. No behaviour change.

internal/agentnew/testdata/golden/codex.txt

pi-openai.txtUpdates golden post-script comment for keep-history +4/-3

Updates golden post-script comment for keep-history

• Golden fixture matching the template comment rewording. No behaviour change.

internal/agentnew/testdata/golden/pi-openai.txt

triage.txtUpdates golden post-script comment for keep-history +4/-3

Updates golden post-script comment for keep-history

• Golden fixture matching the template comment rewording. No behaviour change.

internal/agentnew/testdata/golden/triage.txt

validation-loop.txtUpdates golden post-script comment for keep-history +4/-3

Updates golden post-script comment for keep-history

• Golden fixture matching the template comment rewording. No behaviour change.

internal/agentnew/testdata/golden/validation-loop.txt

issues_test.goDrops KeepHistory fixtures and resolveKeepHistory tests +13/-68

Drops KeepHistory fixtures and resolveKeepHistory tests

• Removes KeepHistory from sticky.Config literals and deletes the resolveKeepHistory test suite. The OnlyIfExists all-clear test drops its keepHistory override.

internal/cli/issues_test.go

keep_history_flag_acceptance_test.goAdds acceptance tests for the hidden keep-history flag +145/-0

Adds acceptance tests for the hidden keep-history flag

• Pins that --keep-history on each of the three posting doors is either removed or a hidden no-op that never prints the deprecation notice.

internal/cli/keep_history_flag_acceptance_test.go

postreview_test.goDrops KeepHistory from sticky.Config fixtures +21/-21

Drops KeepHistory from sticky.Config fixtures

• Removes the KeepHistory field from every sticky.Config literal in the review tests. No assertion changes.

internal/cli/postreview_test.go

postscript_current_cli_keep_history_test.goAdds end-to-end test for generated post-script flags +122/-0

Adds end-to-end test for generated post-script flags

• Renders the current post.sh.tmpl, runs it against a stub CLI whose help lists flags from the real command, and asserts no --keep-history is passed on the ok path.

internal/cli/postscript_current_cli_keep_history_test.go

defaults_test.goRemoves keep_history tests from defaults and YAML round-trip +0/-91

Removes keep_history tests from defaults and YAML round-trip

• Deletes pointer-semantics, marshal, and YAML round-trip tests for KeepHistory. Other default assertions stay.

internal/config/defaults_test.go

effective_test.goRemoves keep_history assertions from effective YAML tests +0/-3

Removes keep_history assertions from effective YAML tests

• Drops keep_history fixture and assertions in the layered and defaults effective-YAML tests.

internal/config/effective_test.go

interfaces_test.goRemoves keep_history accessor and setter tests +0/-19

Removes keep_history accessor and setter tests

• Deletes the ConfigKeepHistory and SetKeepHistory unit tests.

internal/config/interfaces_test.go

keep_history_removal_acceptance_test.goAdds acceptance tests for keep_history removal +42/-0

Adds acceptance tests for keep_history removal

• Asserts a repo config.yaml with keep_history still loads, and that a managed overlay with it fails with an unknown-field error.

internal/config/keep_history_removal_acceptance_test.go

managed_test.goSwaps keep_history fixtures for kill_switch +14/-20

Swaps keep_history fixtures for kill_switch

• Replaces keep_history fixtures with kill_switch in managed marshal, merge, and issue-tracking tests.

internal/config/managed_test.go

trace_context_test.goSwaps keep_history fixtures for kill_switch +4/-4

Swaps keep_history fixtures for kill_switch

• Uses kill_switch instead of keep_history in trace-context WithTraceContext tests.

internal/config/trace_context_test.go

adf_test.goRewords sticky test comments to cite pre-#9334 CLIs +5/-5

Rewords sticky test comments to cite pre-#9334 CLIs

• Comment-only change in two test comments. Test logic is unchanged.

internal/forge/jira/adf_test.go

config_platform_layers_test.goReplaces keep_history fixtures with roles in layered tests +6/-6

Replaces keep_history fixtures with roles in layered tests

• Uses roles instead of keep_history in platform-config precedence and sparse render tests.

internal/repos/config_platform_layers_test.go

managed_config_blocked_install_test.goSwaps keep_history overlays for kill_switch in adoption tests +12/-11

Swaps keep_history overlays for kill_switch in adoption tests

• Changes overlay and preset fixtures and drift-message expectations from keep_history to kill_switch.

internal/repos/managed_config_blocked_install_test.go

managed_config_test.goReplaces keep_history fixtures with kill_switch in repos tests +2/-4

Replaces keep_history fixtures with kill_switch in repos tests

• Swaps keep_history for kill_switch in managed config resolution and render tests.

internal/repos/managed_config_test.go

history_folding_removal_guard_test.goAdds guard against removed history-folding symbols in Go +124/-0

Adds guard against removed history-folding symbols in Go

• Walks production Go sources and fails if BuildUpdatedBody, detailsRe, legacyDetailsRe, KeepHistory, or keep_history appear, or if sentinels appear outside the two allowlisted shims.

internal/sticky/history_folding_removal_guard_test.go

markers_test.goDeletes BuildUpdatedBody marker and footer tests +2/-70

Deletes BuildUpdatedBody marker and footer tests

• Removes history-neutralization and footer-by-last-occurrence tests for the deleted builder. Keeps the across-runs marker test without KeepHistory.

internal/sticky/markers_test.go

post_new_comment_test.goDrops KeepHistory from post-new-comment fixtures +2/-2

Drops KeepHistory from post-new-comment fixtures

• Removes the KeepHistory field from Config literals. Assertions on new-comment-per-run behaviour are unchanged.

internal/sticky/post_new_comment_test.go

sticky_test.goDeletes BuildUpdatedBody tests and testCfg fixture +0/-185

Deletes BuildUpdatedBody tests and testCfg fixture

• Removes all BuildUpdatedBody tests and the shared testCfg. Keeps TruncateBody, FindMarkedComment, and related tests.

internal/sticky/sticky_test.go

Documentation (11) +41 / -42
config-source-inventory.mdDrops keep_history row from the config source inventory +0/-1

Drops keep_history row from the config source inventory

• Removes the keep_history row from the layered-source table. Doc-only change.

docs/contributing/config-source-inventory.md

cli-internals.mdRemoves keep-history and dry-run flag rows from CLI tree +1/-4

Removes keep-history and dry-run flag rows from CLI tree

• Drops --keep-history from the issues and post-review command trees and moves --dry-run to the last entry on post-review, since --fullsend-dir is also gone there.

docs/guides/dev/cli-internals.md

layered-config-reference.mdRemoves keep_history from layered config reference +0/-10

Removes keep_history from layered config reference

• Drops the keep_history field from the field table, its semantics section, and the compiled defaults table.

docs/guides/infrastructure/layered-config-reference.md

issues-commands.mdRemoves --keep-history row from issues post-comment flags +0/-1

Removes --keep-history row from issues post-comment flags

• Removes the --keep-history flag from the post-comment flag table. Doc-only change.

docs/guides/user/issues-commands.md

config-reference.mdRemoves keep_history from config reference +0/-9

Removes keep_history from config reference

• Drops the keep_history example line and its dedicated section.

docs/reference/config-reference.md

post.sh.tmplRewords --keep-history comment in generated post-script +4/-3

Rewords --keep-history comment in generated post-script

• Comment-only change. It records that the flag is a warned no-op from #9399 until this cleanup, and that the script must never pass it to a CLI that has removed it. Generated scripts are not regenerated, so the comment is what ages in.

internal/agentnew/templates/post.sh.tmpl

reviewdedup.goDocuments sentinel read-side shim in reviewHashAndHead +5/-0

Documents sentinel read-side shim in reviewHashAndHead

• Comment-only change. It explains why the sticky history-start cut stays: pre-#9334 reviews still carry it until they age out. No logic change.

internal/cli/reviewdedup.go

adf.goReframes sticky sentinel handling as read-side shim +19/-10

Reframes sticky sentinel handling as read-side shim

• Comment-only change. The sentinel strip and details parsing stay, and the comments now cite pre-#9334 CLIs rather than the deleted builder.

internal/forge/jira/adf.go

run-agent-job.shAdds comment explaining the sticky history cut +4/-0

Adds comment explaining the sticky history cut

• Comment-only change. Adds four lines explaining why the sticky:history-start cut stays while pre-#9334 review comments age out. Protected path.

internal/scaffold/fullsend-repo-gitlab/.gitlab/ci/scripts/run-agent-job.sh

pre-fetch-prior-review-test.shRewords test comment to drop sticky.BuildUpdatedBody reference +3/-3

Rewords test comment to drop sticky.BuildUpdatedBody reference

• Comment-only change. Re-labels the production re-review shape as a legacy shape posted by pre-#9334 CLIs. Protected path.

internal/scaffold/fullsend-repo/scripts/pre-fetch-prior-review-test.sh

pre-fetch-prior-review.shAdds comment explaining the sticky history cut +5/-1

Adds comment explaining the sticky history cut

• Comment-only change. Adds a read-side shim comment above the awk cut. Protected path.

internal/scaffold/fullsend-repo/scripts/pre-fetch-prior-review.sh

The doc edits for fullsend-ai#9517, kept
out of the fix(fullsend-ai#9517) commit so its size reads on its own.

Signed-off-by: Tim Pouyer <tim.pouyer@gmail.com>
@qodo-code-review

qodo-code-review Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Validation error notes spill out as uncommented lines ✗ Dismissed Bug Correctness

Dismissed as Deferred

Dismissal explanation
The leak predates this PR and is tracked in issue #10091.
Description
proposedManifestEntry adds the strict-decode error to the snippet with `fmt.Sprintf("# note:
repos.yaml cannot hold these settings as written: %v", err)`, but that error is almost always
several lines long. decodeManagedConfig joins its field errors with errors.Join, which puts them
on separate lines, and yaml.v3 TypeErrors print as yaml: unmarshal errors:\n  line N: .... Only
the first line gets the #  prefix. Any rejected value then shows up in the advisory repos.yaml
block as bare, uncommented text: the tracker allowed_targetz test case, a create_issues key next
to another error, or two unknown agent fields. That is exactly the leak the PR's new strconv.Quote
handling of dropped keys was written to prevent.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The combined-block note in `proposedManifestEntry` embeds a multi-line strict-decode error (from `errors.Join` or a yaml.v3 TypeError) after a single `# note:` prefix. Every line after the first is printed as uncommented text inside the proposed repos.yaml snippet.

## Fix Focus Areas
- internal/repos/managed_config_adoption.go[309-313]
- internal/repos/managed_config_adoption_test.go[137-145]

## Recommended Fix
Split `err.Error()` on `\n` and prefix each line with `# ` (e.g. `# note: repos.yaml cannot hold these settings as written:` followed by one `#   <line>` per error line). Add a test assertion that every line of the proposal snippet after the YAML entry starts with `#`. Cover both a multi-field `errors.Join` case and the tracker `allowed_targetz` case.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Compatibility shims have no end date ✗ Dismissed Requirement gap Maintainability

Dismissed as Intentional

Dismissal explanation
The user accepts the shim as a deliberate compatibility choice and declines to set an end date now.
Description
The hidden --keep-history flag is kept as a no-op, and its docs say "no removal release is
scheduled yet" (config-reference.md), while the --fullsend-dir shim's test comment only says it
stays "until external callers have moved off it". Neither records an end date or removal version,
which the cleanup rule requires for any deliberate compatibility shim. Without one, nothing marks
when these no-op flags can be deleted, so they can persist indefinitely while later readers have no
basis for removing them.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The hidden `--keep-history` and `--fullsend-dir` no-op flags are kept for compatibility, but no end date or removal version is recorded. The cleanup rule requires each deliberate shim to state both a reason and an end date.

## Fix Focus Areas
- docs/reference/config-reference.md[218-221]
- internal/cli/keep_history_flag_acceptance_test.go[146-150]

## Recommended Fix
In the config reference, replace "no removal release is scheduled yet" with a concrete end point, such as the release or date after which the hidden flags are removed. Add the same end point to the test comment for the `--fullsend-dir` shim and to the flag's help or code comment, so the removal condition is recorded alongside the shim.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

3. Comment wrongly says each key was checked 🐞 Bug ⚙ Maintainability
Description
The new comment above the strict-decode probe says "Every pair was probed on its own and only
removed keys were dropped, so a block that still fails carries a value the strict decode rejects".
No per-pair probe exists, though. The drop filter only looks up each key name in the schema
(manifestHoldsKey), and the one probe decodes the whole block. Also, create_issues is
deliberately kept so that it fails the probe on its key name, not on any value. A later maintainer
who trusts the comment would wrongly assume any probe failure means a bad value, and could rewrite
the note or the filtering based on that.
Code

internal/repos/managed_config_adoption.go[R305-308]

+		// Every pair was probed on its own and only removed keys were
+		// dropped, so a block that still fails carries a value the
+		// strict decode rejects and must be resolved by the operator
+		// before adoption.
Evidence
Lines 281-290 only call manifestHoldsKey (a yaml-tag lookup) and ManagedRemovedKeyError. Nothing
decodes individual pairs. Line 286 keeps create_issues on purpose so the combined probe rejects it
by key name.

internal/repos/managed_config_adoption.go[179-182]
internal/repos/managed_config_adoption.go[280-315]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The comment above the combined-block probe in `proposedManifestEntry` claims every pair was probed individually and that a failure means a rejected value. In fact keys are filtered only by a schema-name lookup, and `create_issues` is intentionally kept so it fails by key name.

## Fix Focus Areas
- internal/repos/managed_config_adoption.go[305-308]

## Recommended Fix
Reword the comment to say that keys unknown to the managed schema were dropped by name, except keys with a dedicated migration error. A remaining failure therefore comes from either a rejected value or a migration-error key, and the operator must resolve it before adoption.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #9399
✅ Compliance rules (platform): 39 rules
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/agents (sha: 9061835a) — View relationship
  Explored: repo: fullsend-ai/.fullsend (sha: 5197782f) — View relationship
  Explored: repo: fullsend-ai/autonomy-analysis (sha: 46717359) — View relationship
✅ Context preparation
  Commit messages: summarized; full text retained for this review
Review mode: Auto: 🧠 Deep: Dense migration logic spans YAML merging, validation, adoption, and compatibility paths.

Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only comments. One finding is inline. The other is below because internal/repos/managed_config_adoption.go is not in this PR's diff, so it cannot take an inline comment.

MEDIUM: Adoption guidance proposes keep_history, which the managed validator now rejects; the leftover fixtures hide this

internal/repos/managed_config_adoption.go:165: proposedManifestEntry copies every top-level key of an existing .fullsend/config.yaml overlay into the proposed repos.yaml entry. It then probes the result with a strict decode and only appends # note: repos.yaml cannot hold these settings as written: ... unknown field "keep_history". config-reference.md used to ship keep_history: true in its sample, so many overlays carry the key. After this PR, fullsend repos status/install hands operators a config block that the new BREAKING validation rejects. The settings diff also says the key "falls back to the base layer or code default", and that default no longer exists.

Several unchanged test fixtures still feed keep_history: overlays through this path: config_layers_test.go:209/221/337, managed_config_allowlist_test.go:93, managed_config_writeback_test.go:358-408 and cli/repos_managed_config_test.go:509. They now exercise the unknown-key path instead of a live setting. config_layers_test.go:221 passes only because the rejection note happens to contain "keep_history". The PR body says keep_history fixtures were swapped for kill_switch or roles, but these were missed.

Suggestion: in proposedManifestEntry and the effective-settings diff, drop keep_history (a key that no longer exists) instead of proposing it with a failure note, and add a test that pins the adoption output for an overlay that still carries it. Switch the leftover fixtures to a live key such as kill_switch: false so they keep their original meaning.

_Verified: read code at head (proposedManifestEntry lines 163-195; git grep keep_history in *test.go) at d5baff6; raised by: Claude, DeepSeek

Comment thread internal/config/trace_context_test.go Resolved
@tpouyer
tpouyer force-pushed the chore/9517-sticky-remove-history-folding-keep branch from d5baff6 to 76cb0c5 Compare December 1, 2026 14:34
@fullsend-ai-review

fullsend-ai-review Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:39 PM UTC · Completed 2:54 PM UTC

Commit: 76cb0c5 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.44

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://5cd6df7f-site.fullsend-ai.workers.dev

Commit: a28d6bc5e46ce7e66edd0e8ff1944618adc6826a

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Dec 1, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Extensive cleanup across 43 files with elevated git churn in touched packages is offset by strong test coverage, no security or CI changes, and full alignment with the linked issue.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [assertion-weakened] internal/config/managed_test.go:632 — TestManagedConfig_WithIssueTracking now seeds the receiver with kill_switch: false (line 624) and asserts IsKillSwitchActive() is false ("existing values are kept"). false is the compiled default, so the check still passes if WithIssueTracking drops the existing setting. The old fixture used keep_history: false, which differed from its default of true, so a dropped value failed the test. internal/config/trace_context_test.go has the same weakening at lines 437/442 and 463/467 in TestManagedConfig_WithTraceContext.
    Remediation: Seed with kill_switch: true and assert IsKillSwitchActive() is true in all three preservation checks, or assert that the marshaled output still declares kill_switch: false.

Low

  • [stale-reference] internal/repos/config_layers_test.go:209 — Test files the PR did not change still use the removed keep_history key as their overlay setting: config_layers_test.go lines 209, 221 and 337, managed_config_writeback_test.go:361-411, managed_config_allowlist_test.go:93 and internal/cli/repos_managed_config_test.go:509. The key is now ignored or rejected, so these fixtures no longer supply a real setting for the adoption and layered-configuration comparisons. No production behavior is affected.
    Remediation: Replace these fixtures with a supported non-default setting such as kill_switch: true. Keep keep_history only in tests that are explicitly about compatibility.

  • [breaking-config] internal/config/managed.go:267 — keep_history was removed from the managed config structs. decodeKnownFields uses KnownFields(true), so a managed overlay that still sets keep_history now fails with unknown field. This is the intended, documented breaking change: the title carries !, the PR body and commit have a BREAKING CHANGE: footer, and issue sticky: remove the history folding and keep_history now that every result is a new comment #9517 allows this option. The remaining risk is a managed overlay in another repo that still declares the key.

  • [breaking-cli] internal/cli/issues.go:863 — --keep-history stays a hidden no-op on post-comment, post-review and issues post-comment, and --fullsend-dir on post-comment and post-review. This preserves already-rendered post-scripts. The no-ops have no removal timeline. Older scripts that relied on --keep-history=false to replace the earlier comment now get a new comment instead.


Labels: Cleanup of deprecated code and config across the CLI, config and sticky packages.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.79832% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/repos/managed_config_adoption.go 93.50% 3 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only comments: two MEDIUM findings, both inline.

The test a review thread asked for.

Signed-off-by: Tim Pouyer <tim.pouyer@gmail.com>
Drop removed settings from adoption guidance.

Addresses review feedback on https://github.com/fullsend-
ai/fullsend/pull/9986.

Signed-off-by: Tim Pouyer <tim.pouyer@gmail.com>
…e tests

The test a review thread asked for.

Signed-off-by: Tim Pouyer <tim.pouyer@gmail.com>
@tpouyer

tpouyer commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

MEDIUM: Adoption guidance proposes keep_history, which the managed validator now rejects; the leftover fixtures hide this

internal/repos/managed_config_adoption.go:165: proposedManifestEntry copies every top-level key of an existing .fullsend/config.yaml overlay into the proposed repos.yaml entry. It then probes the result with a strict decode and only appends # note: repos.yaml cannot hold these settings as written: ... unknown field "keep_history". config-reference.md used to ship keep_history: true in its sample, so many overlays carry the key. After this PR, fullsend repos status/install hands operators a config block that the new BREAKING validation rejects. The settings diff also says the key "falls back to the base layer or code default", and that default no longer exists.

Several unchanged test fixtures still feed keep_history: overlays through this path: config_layers_test.go:209/221/337, managed_config_allowlist_test.go:93, managed_config_writeback_test.go:358-408 and cli/repos_managed_config_test.go:509. They now exercise the unknown-key path instead of a live setting. config_layers_test.go:221 passes only because the rejection note happens to contain "keep_history". The PR body says keep_history fixtures were swapped for kill_switch or roles, but these were missed.

Suggestion: in proposedManifestEntry and the effective-settings diff, drop keep_history (a key that no longer exists) instead of proposing it with a failure note, and add a test that pins the adoption output for an overlay that still carries it. Switch the leftover fixtures to a live key such as kill_switch: false so they keep their original meaning.

Fixed in 585e62f: the adoption proposal now drops the keys the strict validator rejects, naming them in a note, instead of proposing them with a failure note; the settings difference marks such a key as a setting that no longer exists rather than one that falls back to a default; the missed fixtures were switched to kill_switch so they keep their original meaning; and a new test pins the adoption output for an overlay that still carries keep_history; TestAdoptionProposalDropsSettingsTheManifestCannotHold covers it

@tpouyer
tpouyer requested a review from waynesun09 December 1, 2026 20:32
@fullsend-ai-review

fullsend-ai-review Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:32 PM UTC · Completed 8:42 PM UTC

Commit: 585e62f · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.79

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Extensive cleanup across 49 files with elevated git churn and coupling across CLI, config, and sticky packages is offset by high test coverage, absence of CI or dependency changes, and complete alignment with linked issue #9517.

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Review

Findings

Low

  • [injection-vuln] internal/repos/managed_config_adoption.go:202 — The dropped-key note added in this PR puts raw configuration keys (key.Value) into a # note: comment line via fmt.Sprintf without encoding. A YAML key can contain a decoded newline, so it can end the comment early and add text that looks like an active repos.yaml entry (for example one for another repository) to the adoption snippet. Only the dropped-key note skips yaml.Marshal encoding. The output is advisory: an operator must copy it into repos.yaml by hand, and the keys come from the repository's own config file.
    Remediation: Quote each dropped key with an encoding that escapes newlines and control characters (for example strconv.Quote), or keep every physical line of the note a YAML comment. Add a regression test with a multiline unknown key.
  • [breaking-config] internal/config/managed.go:267 — Managed overlays still decode with KnownFields(true), so an overlay that sets keep_history now fails to parse. The break is declared (! and BREAKING CHANGE), but unlike the CLI flags this key gets no accepted-but-ignored window.
    Remediation: Optionally accept and ignore keep_history in managed overlays for one release, with a warning; otherwise make sure release notes tell users to delete the key.
  • [breaking-cli] internal/cli/issues.go:863 — --keep-history is a hidden no-op whose behavior changed and which no longer shows in --help; --fullsend-dir is handled the same way. Removal is not tied to a release.
    Remediation: Record the release in which the hidden flags will be removed.

Earlier findings

  • internal/config/managed_test.go:632, assertion-weakened — resolved: TestManagedConfig_WithIssueTracking now seeds kill_switch: true and asserts IsKillSwitchActive() is true, so the "existing values are kept" check can fail.
  • internal/repos/config_layers_test.go:209, stale-reference — resolved: the fixtures and the assert.Contains now use kill_switch instead of the removed keep_history.

Labels: Go code change across CLI, config and sticky packages.

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review December 1, 2026 20:42

Superseded by updated review

fullsend-ai-review[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

E2E authorized for 978f41251995a0ed37909b92be864a38834b4987 (run). A new push needs a new /ok-to-test <sha>.

@waynesun09
waynesun09 enabled auto-merge December 3, 2026 17:39
@waynesun09 waynesun09 closed this Dec 3, 2026
auto-merge was automatically disabled December 3, 2026 17:40

Pull request was closed

@waynesun09 waynesun09 reopened this Dec 3, 2026
@waynesun09
waynesun09 enabled auto-merge December 3, 2026 17:40
@waynesun09

Copy link
Copy Markdown
Member

/ok-to-test a28d6bc

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

E2E authorized for a28d6bc5e46ce7e66edd0e8ff1944618adc6826a (run). A new push needs a new /ok-to-test <sha>.

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 5:46 PM UTC · Completed 5:59 PM UTC

Commit: a28d6bc · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.86

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Dec 3, 2026
Comment thread docs/reference/config-reference.md Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 978f412

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Extensive cleanup across 50 files with elevated churn and change coupling across CLI, config, and sticky packages is offset by high test coverage, absence of CI or dependency changes, and complete alignment with linked issue #9517.

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Review

Findings

Low

  • [breaking-config] internal/config/managed.go:267 — Managed overlays that still set the removed keep_history key are now rejected with unknown field "keep_history", so existing managed-config layers carrying it will fail to load. A repo's own config.yaml still loads with the key, and the CLI side has hidden no-op shims while the config side has none. The PR declares this as a breaking change (! title, BREAKING CHANGE footer), and issue sticky: remove the history folding and keep_history now that every result is a new comment #9517 allowed either accepting-and-ignoring the key or documenting its removal.
    Remediation: Make sure the release notes carry the BREAKING CHANGE migration step (remove keep_history from managed repos.yaml config blocks). Optionally tolerate and ignore the key for one release.

Earlier findings

  • internal/cli/issues.go:863, breaking-cli — reclassified, informational: the hidden no-op --keep-history and --fullsend-dir flags are still registered (lines 863 and 874), so no caller breaks.

1 finding(s) below the low severity threshold were not posted.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • internal/config/managed.go (file-level): Line 267 ·
    [low] breaking-config

Managed overlays that still set the removed keep_history key are now rejected with unknown field "keep_history" (decodeKnownFields uses KnownFields(true) and the key is gone from perRepoConfig and ManagedConfig), so existing managed-config layers carrying it will fail to load. A repo's own config.yaml still loads with the key, so the two config surfaces differ, and the CLI side has hidden no-op shims while the config side has none. The PR declares this as a breaking change (! title and BREAKING CHANGE footer), and issue #9517 allowed either accepting-and-ignoring the key or documenting its removal.

Suggested fix: Make sure the release notes carry the BREAKING CHANGE migration step (remove keep_history from managed repos.yaml config blocks). Optionally tolerate and ignore the key for one release.

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review December 3, 2026 17:59

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Dec 3, 2026
@tpouyer
tpouyer requested a review from waynesun09 December 3, 2026 18:08
@waynesun09
waynesun09 added this pull request to the merge queue Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Dec 3, 2026
Merged via the queue into fullsend-ai:main with commit a94db02 Dec 3, 2026
121 checks passed

This branch was successfully deployed

1 active deployment
site-preview — a28d6bc5 Deployed Dec 3, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code ready-for-merge All reviewers approved — ready to merge risk/moderate PR risk: moderate tech-debt

Projects

None yet

3 participants