Skip to content

fix(agentnew): use work item URL in generated agents - #8700

Merged
waynesun09 merged 1 commit into
fullsend-ai:mainfrom
Aliciapet11:fix/8648-agentnew-work-item-url
Oct 22, 2026
Merged

waynesun09 merged 1 commit into
fullsend-ai:mainfrom
Aliciapet11:fix/8648-agentnew-work-item-url

Conversation

@Aliciapet11

Copy link
Copy Markdown
Contributor

Summary

Migrate fullsend agent new to the forge-agnostic work item URL variable.

Changes

  • Generate ISSUE_URL from FULLSEND_WORK_ITEM_URL in both env.runner and env.sandbox.
  • Update the generated post-script comment to describe the new source variable.
  • Update the CLI next-step output and docs/cli/agent.md.
  • Regenerate the agent-new golden trees.
  • Add a regression test that pins the new mapping in both environment maps.

Refs #8648.
Unblocks the review finding in #8695.

Testing

  • go test ./internal/agentnew -run 'TestGolden|TestGeneratedHarnessUsesWorkItemURL|TestGeneratedPromptFetchesByNumberAndRepo' -count=1
  • go test ./internal/cli -run 'TestAgentNew' -count=1
  • make lint
  • Focused coverage on the touched functions:
    • internal/agentnew/render.go: buildHarness — 100%
    • internal/cli/agent_new.go: printNextSteps — 94.7%

A full go test ./internal/cli run hit an unrelated pre-existing failure; the focused agent new tests and lint pass on this branch.

Checklist

  • PR title follows Conventional Commits
  • Commits are signed off (DCO)
  • Tests added or updated for changed behavior

@Aliciapet11
Aliciapet11 requested a review from a team as a code owner October 22, 2026 10:48
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

E2E tests are running

Authorization passed for this commit. See the E2E Tests workflow for results.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Use work item URLs in generated agent harnesses

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Map generated agents’ ISSUE_URL to the forge-agnostic work item URL in both environments.
• Align local setup instructions and post-script comments with the new source variable.
• Add a regression test and refresh generated golden fixtures.
Diagram

graph TD
  URL["Work item URL"] --> GEN["Agent generator"] --> RUN["Runner env"] --> POST["Post script"]
  GEN --> SAN["Sandbox env"]
Loading
High-Level Assessment

Keep the existing ISSUE_URL contract and change its source in both generated environment maps. Renaming the downstream variable would expand the change without improving this fix.

Files changed (9) +39 / -17

Bug fix (2) +3 / -3
render.goSource generated ISSUE_URL from the work item URL +2/-2

Source generated ISSUE_URL from the work item URL

• Changes both runner and sandbox harness environment maps to derive 'ISSUE_URL' from 'FULLSEND_WORK_ITEM_URL'.

internal/agentnew/render.go

agent_new.goCorrect the agent-new local setup instructions +1/-1

Correct the agent-new local setup instructions

• Changes the CLI next-step output to request 'FULLSEND_WORK_ITEM_URL' in '.env.local'.

internal/cli/agent_new.go

Tests (5) +34 / -12
render_test.goPin the URL mapping in both generated environments +22/-0

Pin the URL mapping in both generated environments

• Adds a regression test that renders and loads a harness, then checks the runner and sandbox 'ISSUE_URL' values.

internal/agentnew/render_test.go

codex.txtRefresh the Codex generated-tree fixture +3/-3

Refresh the Codex generated-tree fixture

• Updates both harness URL mappings and the post-script comment to reflect the work item URL source.

internal/agentnew/testdata/golden/codex.txt

pi-openai.txtRefresh the Pi OpenAI generated-tree fixture +3/-3

Refresh the Pi OpenAI generated-tree fixture

• Updates both harness URL mappings and the post-script comment to reflect the work item URL source.

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

triage.txtRefresh the triage generated-tree fixture +3/-3

Refresh the triage generated-tree fixture

• Updates both harness URL mappings and the post-script comment to reflect the work item URL source.

internal/agentnew/testdata/golden/triage.txt

validation-loop.txtRefresh the validation-loop generated-tree fixture +3/-3

Refresh the validation-loop generated-tree fixture

• Updates both harness URL mappings and the post-script comment to reflect the work item URL source.

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

Documentation (2) +2 / -2
agent.mdCorrect the documented local environment variable +1/-1

Correct the documented local environment variable

• Lists 'FULLSEND_WORK_ITEM_URL' instead of 'GITHUB_ISSUE_URL' among the variables needed for a local agent run.

docs/cli/agent.md

post.sh.tmplCorrect the post-script environment comment +1/-1

Correct the post-script environment comment

• Identifies 'FULLSEND_WORK_ITEM_URL' as the harness source for the post-script’s required 'ISSUE_URL'.

internal/agentnew/templates/post.sh.tmpl

@qodo-code-review

qodo-code-review Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Documented agent runs still use old URL 📘 Rule violation ⚙ Maintainability
Description
The generated harness consumes FULLSEND_WORK_ITEM_URL, but the BYOA guide and CheckGenerated
comment still describe GITHUB_ISSUE_URL for generated-agent setup and validation behavior. Users
following the local instructions leave the required value unresolved and fail
ValidateRunnerEnvWith before the agent starts, while maintainers can inspect or change the wrong
variable when updating generation-time validation.
Code

internal/agentnew/render.go[103]

+		"ISSUE_URL": "${FULLSEND_WORK_ITEM_URL}",
Relevance

●●● Strong

Recent agent-generation findings and documentation updates are consistently accepted; this directly
fixes the stated environment contract.

PR-#7917
PR-#6972

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The generator maps ISSUE_URL from FULLSEND_WORK_ITEM_URL and emits that reference in both the
sandbox and runner environment maps, whereas the BYOA guide still requires or exports only
GITHUB_ISSUE_URL; unresolved environment references are checked before execution and cause
validation to report the missing variable. The documentation cross-reference guidance identifies
bring-your-own-agent.md as a related guide that must be updated when the agent command’s
environment contract changes, and the CheckGenerated comment still explains the behavior with the
retired variable name.

Rule 2748504: Update docs/ references when changing user-facing behavior
Rule 2806787: Consult documentation guide when modifying cross-referenced docs or CLI/config surfaces
internal/agentnew/render.go[103-103]
docs/guides/user/bring-your-own-agent.md[73-85]
internal/agentnew/render.go[155-155]
docs/guides/user/bring-your-own-agent.md[611-620]
internal/harness/harness.go[829-874]
internal/cli/run.go[1125-1128]
docs/cli/agent.md[53-53]
docs/contributing/documentation.md[9-16]
docs/contributing/documentation.md[56-67]
internal/harness/checkgenerated.go[21-27]

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 generated agent harness changed from `GITHUB_ISSUE_URL` to `FULLSEND_WORK_ITEM_URL`, but the BYOA guide still documents the old variable in local-run instructions and harness examples, and the `CheckGenerated` comment still names the retired variable. Following the guide can leave the generated harness variable unresolved and cause environment validation to fail before the agent starts, while the stale comment can mislead maintainers updating generation-time validation.

## Fix Focus Areas
- docs/guides/user/bring-your-own-agent.md[73-85]
- docs/guides/user/bring-your-own-agent.md[490-493]
- docs/guides/user/bring-your-own-agent.md[611-620]
- docs/guides/user/bring-your-own-agent.md[611-611]
- docs/cli/agent.md[53-53]
- docs/contributing/documentation.md[9-16]
- docs/contributing/documentation.md[56-67]
- internal/harness/checkgenerated.go[21-27]

## Recommended Fix
Update the generated-agent setup instructions, required-variable lists, dry-run examples, and harness examples to use `FULLSEND_WORK_ITEM_URL` wherever they describe the URL consumed by the generated harness, keeping the CLI reference and user guide consistent and retaining `GITHUB_ISSUE_URL` only where it is explicitly documented as migration guidance. Update the `CheckGenerated` comment to refer to `FULLSEND_WORK_ITEM_URL`, or use a variable-neutral description that remains correct when environment mappings change.

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

Dismiss ↗ | View ↗


Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 95 rules
✅ Skills: 5 invoked
  writing-user-docs
  writing-adrs
  check-patch-coverage
  cutting-releases
  adr-corner
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/agents (sha: 797386c1) — View relationship
Review mode: Auto: 🚀 Fast: Localized environment-variable mapping with focused regression coverage and regenerated outputs.

Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread internal/agentnew/render.go
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://49b46208-site.fullsend-ai.workers.dev

Commit: 2165590fadbd6a539fba224716a1c43b6ac8dddf

@ifireball

Copy link
Copy Markdown
Member

/fs-review

Signed-off-by: apetruni <apetruni@redhat.com>
@Aliciapet11
Aliciapet11 force-pushed the fix/8648-agentnew-work-item-url branch from abc1cb8 to 2165590 Compare October 22, 2026 10:57
@fullsend-ai-review

fullsend-ai-review Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:58 AM UTC · Completed 11:09 AM UTC

Commit: abc1cb8 · View workflow run →

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

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Small diff updating generated harness environment variables and golden tests with no protected paths or CI changes, balanced by moderate recent churn and change coupling in CLI and generator files.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [stale-doc] docs/guides/user/bring-your-own-agent.md:73 — fullsend agent new now generates harnesses that map ISSUE_URL to ${FULLSEND_WORK_ITEM_URL}, but the "test a generated agent locally" steps in this guide still tell users to set GITHUB_ISSUE_URL in .env.local (line 73), in the "Pick a route" variable list (line 85) and in the sample local run (line 611). Users following them will leave FULLSEND_WORK_ITEM_URL unset; the failure surfaces at fullsend run time. Open PR docs(#8648): document work item URL transition #8695 updates this guide, so merge the two together.
    Remediation: Replace GITHUB_ISSUE_URL with FULLSEND_WORK_ITEM_URL at lines 73, 85 and 611, or land PR docs(#8648): document work item URL transition #8695 alongside this change. Lines 490/493 (a self-contained triage overlay example) are not made stale by this PR.

Low

  • [scope-exceeded] internal/agentnew/render.go:103 — The fix(#8648) scope in the title points to issue Replace deprecated GITHUB_ISSUE_URL with FULLSEND_WORK_ITEM_URL in the local-run user guides #8648, which covers the two local-run user guides, and this PR touches neither of them. The change itself (moving the agent new generator, CLI next-steps text, post-script comment and docs/cli/agent.md to FULLSEND_WORK_ITEM_URL) is a closely related companion and the body says Refs #8648, not Closes, so this is a labeling mismatch only.
    Remediation: Optionally retitle with the subsystem as scope (e.g. fix(agentnew): use work item URL in generated agents) and keep Refs #8648 in the body.

@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.

See the review comment for full details.

Comment thread internal/agentnew/render.go
@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Oct 22, 2026
@Aliciapet11 Aliciapet11 changed the title fix(#8648): use work item URL in generated agents fix(agentnew): use work item URL in generated agents Oct 22, 2026
@Aliciapet11

Copy link
Copy Markdown
Contributor Author

@rh-hemartin, could you please review and put the ok-to-test label? thanks

@dhshah13 dhshah13 added the ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) label Oct 22, 2026

@rh-hemartin rh-hemartin 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.

Makes sense to me.

@rh-hemartin

Copy link
Copy Markdown
Member

Thanks Dharit for the labels. Merging.

@rh-hemartin
rh-hemartin added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@ascerra
ascerra added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@dhshah13
dhshah13 added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@dhshah13
dhshah13 added this pull request to the merge queue Oct 22, 2026

@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.

LGTM at 2165590.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Oct 22, 2026
Merged via the queue into fullsend-ai:main with commit 212b1d0 Oct 22, 2026
96 checks passed

This branch was successfully deployed

2 active deployments
dev — 2165590f Deployed Oct 22, 2026 by dhshah13 via run / playback #5191
site-preview — 2165590f Deployed Oct 22, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) requires-manual-review Review requires human judgment risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants