Repository navigation
feat(cli): expose claimed_model on task reads [squash] - #357
Merged
Merged
Conversation
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.
Status
Agent-side verification is complete. Ready for Cheese's merge review. This is not merge or production-release authorization.
Conditions
a1000970d90bb6dcf87b8168a184e5a863b7a7b5, basemainat93ac2140b9ce58564b71b8b48793dcda811d60da. The head ismainmerged into the branch; the diff againstmainis still four files.59bf08b6cf2bb4047263c0f04dc01bdb7b15bd99.Change
multica agent tasksandmultica issue runs(full log, JSON) now returnclaimed_modelon every run. The server reads it from the storedagent_task_queue.claimed_modelcolumn. It does not read the agent's current model.null: nothing stored (unclaimed, or the claim could not record it)."": an empty string was stored.dispatched_at. Task ID, agent ID, issue ID, workspace ID and status were already returned.issue runs --siblingsis a compact coordination read and is unchanged.No new endpoint and no CLI change: the CLI prints the server JSON as is. Existing workspace-membership and private-agent checks stay on both reads. No prompt body, provider environment or token is added.
Remaining gap:
claimed_modelattests what the daemon was told to run at claim. It does not show which upstream model or provider served the run. That stays NOT-VERIFIED. No alias, lab inference or historical backfill is added.Files:
server/internal/handler/agent.go,server/internal/handler/daemon.go,server/internal/handler/task_claimed_model_response_test.go,apps/docs/content/docs/cli.mdx.Evidence
Red, before the fix (
go test ./internal/handler -run TestTaskReads, throwaway pgvector Postgres 17 on X99):The authorization test passed before the fix too: it guards the existing boundary and does not prove the new field.
Green, after the fix:
TestTaskReadsExposeClaimedModel(both reads, string / null / empty) andTestTaskReadsClaimedModelKeepAuthorizationBoundariespass. A private-agent plain member and non-member get 403/404 with no claimed model in the body. A non-member cannot read a foreign-workspace issue's runs. The full./internal/handlerpackage passed (244s) on the pre-merge head. After mergingmain,go build ./...and the targeted tests passed.Not run locally:
server/cmd/multicatests. The author reported workspace tests there fail because of the daemon-task marker in the managed workdir. This PR does not touch the CLI. Current-head CI runs that package and passes (19.817s).CLI examples (also in
apps/docs/content/docs/cli.mdx):Correction after review (P2)
The daemon claim response is built before the claim writes
claimed_model, so it returned a stalenull. It now reports the value this claim stores (daemon.go), including""when the agent model is empty. Foreign-workspace test now seeds a secret task and asserts the body does not leak it.Red, before the correction (
go test ./internal/handler -run TestClaimResponseReportsStoredClaimedModel):Green: that test,
TestTaskReads*andTestVoteGate_ClaimRecordsModelOnTheTaskpass. The full./internal/handlerpackage passed (233s) on the corrected head.CI on the current head
Verified pre-readiness rollup on
a1000970d: 16 SUCCESS, 6 SKIPPED, 0 failed, 0 pending. This is 14 successes by unique check name, with duplicated successful Changelog-line and close-target events. SKIPPED is not PASS. No waiver.CI run 39922117900 passes.
backend-testsandbackendpass. The handler package passes (144.847s), including task-read, claim-response and authorization regressions. The receipt package passes (1.425s). The earlier redTestObserve_EditAfterSettledCreateIsAdmittedAgainstRealBudgetServicewas the CHE-1578 budget-clamp flake, fixed onmainby PR #295.Working PR for CHE-1962 (the child of CHE-1950 that delivers this read): #357
Writing receipt: passive-voice (five) and semicolon (one) advisories are true positives. The unchanged-state warning and the synonym-rotation warning are false positives.
Changelog: none
Closes CHE-1962