Skip to content

feat(cli): expose claimed_model on task reads [squash] - #357

Merged
congvc-dev merged 5 commits into
mainfrom
agent/x99-claude-sonnet/7ed8bca67606
Oct 23, 2026
Merged

congvc-dev merged 5 commits into
mainfrom
agent/x99-claude-sonnet/7ed8bca67606

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Status

Agent-side verification is complete. Ready for Cheese's merge review. This is not merge or production-release authorization.

Conditions

  • No production rollout. A new response field needs the normal reviewed release before live use.
  • Current head a1000970d90bb6dcf87b8168a184e5a863b7a7b5, base main at 93ac2140b9ce58564b71b8b48793dcda811d60da. The head is main merged into the branch; the diff against main is still four files.
  • Independent different-lab review: c00-hermes-devops (OpenAI gpt-6.1-sol), independent of the Sonnet/Anthropic author, signed PASS on the current head/base. The signed delta report includes fresh OCR delegation and manual supplements. It covers the unchanged feature patch and main integration, not every imported main commit independently. The earlier full-feature review covers head 59bf08b6cf2bb4047263c0f04dc01bdb7b15bd99.
  • No direct production database query, no C00 write, no server restart, no CLI replacement.

Change

multica agent tasks and multica issue runs (full log, JSON) now return claimed_model on every run. The server reads it from the stored agent_task_queue.claimed_model column. 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.
  • Key absent: the server predates the field.
  • Claim time is the existing dispatched_at. Task ID, agent ID, issue ID, workspace ID and status were already returned.
  • issue runs --siblings is 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_model attests 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):

    task_claimed_model_response_test.go:91: task 6ad283cd-4e85-46e3-b347-34aa08e1569a: claimed_model key missing
    task_claimed_model_response_test.go:91: task 87d10190-77b6-41a3-9e53-153a9896032b: claimed_model key missing
    task_claimed_model_response_test.go:91: task ed3085d1-1849-4ed5-a82e-26fe8a0767ab: claimed_model key missing
    task_claimed_model_response_test.go:91: task ed3085d1-1849-4ed5-a82e-26fe8a0767ab: claimed_model key missing
    task_claimed_model_response_test.go:91: task 6ad283cd-4e85-46e3-b347-34aa08e1569a: claimed_model key missing
    task_claimed_model_response_test.go:91: task 87d10190-77b6-41a3-9e53-153a9896032b: claimed_model key missing
--- FAIL: TestTaskReadsExposeClaimedModel (0.05s)
    --- FAIL: TestTaskReadsExposeClaimedModel/agent_tasks (0.01s)
    --- FAIL: TestTaskReadsExposeClaimedModel/issue_runs (0.00s)
--- PASS: TestTaskReadsClaimedModelKeepAuthorizationBoundaries (0.05s)
    --- PASS: TestTaskReadsClaimedModelKeepAuthorizationBoundaries/agent_tasks/non-member (0.00s)
    --- PASS: TestTaskReadsClaimedModelKeepAuthorizationBoundaries/agent_tasks/plain_member (0.00s)
FAIL
FAIL	github.com/multica-ai/multica/server/internal/handler	0.166s

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) and TestTaskReadsClaimedModelKeepAuthorizationBoundaries pass. 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/handler package passed (244s) on the pre-merge head. After merging main, go build ./... and the targeted tests passed.

Not run locally: server/cmd/multica tests. 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):

multica issue runs CHE-1962 --output json | jq '.[] | {id, agent_id, issue_id, workspace_id, status, dispatched_at, claimed_model}'
multica agent tasks <agent-id> --output json | jq '.[] | {id, claimed_model}'

Correction after review (P2)

The daemon claim response is built before the claim writes claimed_model, so it returned a stale null. 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):

    task_claimed_model_response_test.go:174: claim response claimed_model = <nil>, want the stored "claim-response-model"
    task_claimed_model_response_test.go:174: claim response claimed_model = <nil>, want the stored ""
--- FAIL: TestClaimResponseReportsStoredClaimedModel (0.19s)
    --- FAIL: TestClaimResponseReportsStoredClaimedModel/model_set (0.11s)
    --- FAIL: TestClaimResponseReportsStoredClaimedModel/agent_model_empty (0.07s)
FAIL
FAIL	github.com/multica-ai/multica/server/internal/handler	0.268s
FAIL

Green: that test, TestTaskReads* and TestVoteGate_ClaimRecordsModelOnTheTask pass. The full ./internal/handler package 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-tests and backend pass. The handler package passes (144.847s), including task-read, claim-response and authorization regressions. The receipt package passes (1.425s). The earlier red TestObserve_EditAfterSettledCreateIsAdmittedAgainstRealBudgetService was the CHE-1578 budget-clamp flake, fixed on main by 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

@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review October 23, 2026 08:48
@congvc-dev
congvc-dev merged commit 353dc3b into main Oct 23, 2026
24 checks passed
@congvc-dev
congvc-dev deleted the agent/x99-claude-sonnet/7ed8bca67606 branch October 23, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant