Repository navigation
Conversation
Signed-off-by: jctanner <tanner.jc@gmail.com>
Signed-off-by: jctanner <tanner.jc@gmail.com>
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer with write access must add the See E2E testing guide for details. |
PR Summary by Qodofeat: add script-led harness entrypoints with Claude integrity checks
AI Description
Diagram
High-Level Assessment
Files changed (31)
|
Code Review by Qodo
1. Some scripts silently lose their runtime
|
| if entrypointWithoutRuntime { | ||
| printer.KeyValue("Runtime", "none (script entrypoint)") |
There was a problem hiding this comment.
2. Script runs have stale command docs 📘 Rule violation ⚙ Maintainability
runAgent now prints Runtime: none (script entrypoint) when an entrypoint runs without runtime provisioning, but docs/cli/run.md still describes every run as executing an agent with a selected runtime. A user following that command reference encounters a plan output and runtime-selection behavior that its examples do not explain.
Agent Prompt
## Issue description
The run command reference does not describe script-led entrypoints or their no-runtime plan output.
## Fix Focus Areas
- docs/cli/run.md[6-53]
- internal/cli/run.go[1311-1315]
## Recommended Fix
Update the command description, runtime-selection explanation, and plan example to cover entrypoints that run without a provisioned runtime.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| runtimePlan, err := resolveEntrypointRuntimePlan(h.Entrypoint != nil, overrides.runtime, runtimeBackend.Runtime.Name(), agentName, runCfg) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| runtimeProvisioning := runtimePlan.ProvisionRuntime | ||
| entrypointWithoutRuntime := runtimePlan.WithoutRuntime |
There was a problem hiding this comment.
3. Entrypoint runs lack end-to-end checks 📘 Rule violation ▣ Testability
runAgent adds an entrypoint execution path under internal/cli, but the available CI workflow does not run the required make e2e-test check. The PR description and commit messages also provide no statement that the check passed locally, leaving this critical-module change without the required execution evidence.
Agent Prompt
## Issue description
Changes under internal/cli require evidence that make e2e-test passed, but the PR provides none.
## Fix Focus Areas
- internal/cli/run.go[1059-1064]
- .github/workflows/lint.yml[14-67]
## Recommended Fix
Run the required end-to-end check and record its passing result for this PR, or add a required CI job that runs it.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if entry.DerivedName() == agentName && entry.Runtime != "" { | ||
| return true |
There was a problem hiding this comment.
1. Some scripts silently lose their runtime 🐞 Bug ≡ Correctness
runtimeConfigured compares agent names case-sensitively, although backend selection uses a case-insensitive lookup. When a configured agent name differs only in case from the name used to launch an entrypoint, the selected runtime is not provisioned; even an otherwise unsupported configured runtime can pass the entrypoint runtime check.
Agent Prompt
## Issue description
Entrypoint runtime planning can miss a per-agent runtime when the launch name differs in case from the configured name.
## Fix Focus Areas
- internal/cli/run.go[416-444]
## Recommended Fix
Use the same case-insensitive effective-agent lookup as backend selection for both per-repo and organization configuration, and test mixed-case launch names.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| } else if _, err = io.Copy(io.MultiWriter(out, os.Stdout), stdout); err != nil { | ||
| cancel() | ||
| return -1, fmt.Errorf("reading entrypoint output: %w", err) |
There was a problem hiding this comment.
6. Script output reaches logs unfiltered 🐞 Bug ⛨ Security
RunEntrypoint copies stream_format: none stdout directly to os.Stdout while also saving it as an artifact. If a script prints a secret or terminal or workflow-control sequence, those bytes reach the caller before the later output security scan can inspect the artifact.
Agent Prompt
## Issue description
Script stdout is forwarded before Fullsend's output scanning and without the control-sequence sanitization used for rendered agent output.
## Fix Focus Areas
- internal/runtime/entrypoint.go[84-96]
- internal/cli/run.go[2921-2930]
## Recommended Fix
Route console output through appropriate control-sequence sanitization and secret protection before emission, while retaining the required output artifact.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
|
||
| func resolveEntrypointRuntimePlan(isEntrypoint bool, runtimeOverride, runtimeName, agentName string, cfg runConfig) (entrypointRuntimePlan, error) { | ||
| provision := !isEntrypoint || runtimeOverride != "" || cfg.runtimeConfigured(agentName) | ||
| plan := entrypointRuntimePlan{ProvisionRuntime: provision, WithoutRuntime: isEntrypoint && !provision} |
There was a problem hiding this comment.
4. Script runs report the wrong runtime 🐞 Bug ◔ Observability
resolveEntrypointRuntimePlan can disable runtime provisioning, but runAgent continues to populate metrics and provider identity from the resolved default backend. For an entrypoint with no selected runtime, its metrics and spans therefore identify a runtime and model provider that did not execute the script.
Agent Prompt
## Issue description
Entrypoints without runtime provisioning inherit the default backend's runtime and provider attribution in metrics and spans.
## Fix Focus Areas
- internal/cli/run.go[473-479]
- internal/cli/run.go[2091-2108]
- internal/cli/run.go[2507-2514]
## Recommended Fix
When WithoutRuntime is true, record a script-only runtime identity and omit model-provider attribution rather than using the backend selected for configuration fallback.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if h.Entrypoint != nil && len(h.Entrypoint.Command) > 0 { | ||
| path := h.Entrypoint.Command[0] | ||
| if filepath.IsAbs(path) || IsURL(path) || strings.Contains(path, "${") { | ||
| return fmt.Errorf("entrypoint.command[0] must be a literal relative local path") | ||
| } | ||
| resolved, resolveErr := resolve("entrypoint.command[0]", path) | ||
| if resolveErr != nil { | ||
| return resolveErr | ||
| } | ||
| h.Entrypoint.Command[0] = resolved | ||
| h.entrypointRoot = filepath.Clean(baseDir) |
There was a problem hiding this comment.
7. Remote harness entrypoints run a local script 🐞 Bug ≡ Correctness
ResolveRelativeTo resolves entrypoint.command[0] against the local .fullsend directory. No URL-composition resolver (resolveBaseScripts, resolveBaseResources) handles the entrypoint the way it handles pre_script, post_script and agent. When a harness or base layer is fetched from a URL, its relative entrypoint is therefore either missing locally (the run fails) or silently runs whatever local file shares that relative path, not the script the remote harness author shipped.
Agent Prompt
## Issue description
When a harness or base is loaded from a URL (ComposeOpts.SourceURL or a URL base), entrypoint.command[0] is never resolved against the source URL. It is later resolved against the local .fullsend directory, so a different local script runs, or the run fails.
## Fix Focus Areas
- internal/harness/harness.go[756-766]
- internal/harness/compose.go[226-270]
- internal/harness/compose.go[875-895]
## Recommended Fix
Track where the entrypoint came from. If the harness or any base that supplies the entrypoint was URL-sourced, return an explicit error during LoadWithBase (e.g. "entrypoint is not supported in URL-sourced harnesses"). Alternatively, fetch the script through the same pinned/allowlisted path used for pre_script, and allow a fullsend cache path in ResolveRelativeTo and ValidateFilesExist. Add a test for both a URL child and a URL base.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| for _, key := range securityKeys { | ||
| lines = append(lines, "export "+key+"="+shellQuote(securityEnv[key])) | ||
| } | ||
| lines = append(lines, "exec claude "+strings.Join(quoted, " ")+" \"$@\"") | ||
| return []byte(strings.Join(lines, "\n") + "\n") |
There was a problem hiding this comment.
8. A planted binary can disable child claude hooks undetected 🐞 Bug ⛨ Security
The fullsend-claude helper ends with exec claude ..., and the hooks run as python3 -B .... Both commands are looked up on the PATH inherited from the sourced workspace .env, and that PATH puts the agent-writable /sandbox/workspace/bin first. The integrity set only pins exact files plus the .fullsend-entrypoint and hooks directories. So a claude or python3 shim that a child Claude run drops into /sandbox/workspace/bin stays in place, and every later child launch runs without hooks or settings while every pre-launch and runner checkpoint still passes.
Agent Prompt
## Issue description
The Claude entrypoint helper execs `claude` through an attacker-influenced PATH whose first entry is the writable /sandbox/workspace/bin. Hook commands invoke `python3` the same way. A shim planted there survives every integrity checkpoint.
## Fix Focus Areas
- internal/runtime/entrypoint.go[19-52]
- internal/cli/entrypoint_setup.go[70-104]
- internal/cli/run.go[2226-2249]
## Recommended Fix
Resolve the absolute claude binary path on the runner side, before the entrypoint runs (the way codexBinaryPin does), and embed it in the helper as `exec '/abs/path/claude' ...`. In the helper, also re-export a fixed PATH that does not start with /sandbox/workspace/bin (e.g. `export PATH=/usr/local/bin:/usr/bin:/bin`) before exec, so hooks resolve the system python3. Alternatively, add /sandbox/workspace/bin to the exact-directory set with its expected entries, so new shims fail the check.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if exitCode != 0 { | ||
| return exitCode, fmt.Errorf("entrypoint exited with status %d", exitCode) | ||
| } |
There was a problem hiding this comment.
5. Timed-out scripts keep running after the run fails 🐞 Bug ☼ Reliability
runEntrypointChecked turns every non-zero exit, including timeout exit 124, into a returned error. runAgent then takes its runErr != nil branch and returns before iterationTimedOut / TerminateStrayProcesses run. Because OpenShell has no per-exec kill, a timed-out entrypoint (and any child Claude calls it started) keeps running and spending inference during the 45s diagnostic copy and afterwards, and the failure is reported as a generic exit status instead of the timeout error.
Agent Prompt
## Issue description
An entrypoint timeout (exit 124) is converted into an error and returned before runAgent terminates stray sandbox processes, so the script and its child Claude calls keep running.
## Fix Focus Areas
- internal/cli/run.go[2993-3013]
- internal/cli/run.go[2655-2681]
## Recommended Fix
In the entrypoint branch, before preserveEntrypointDiagnostics and before returning on runErr, check iterationTimedOut(exitCode, elapsed, timeout) (or ctx cancellation). If it is true, call agentruntime.TerminateStrayProcesses under withSandboxLock, then return the timeout error (the runTerminalError timeout message) instead of the generic "exited with status" message.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Closing this stale draft — it has been untouched since early October and the work has been overtaken by events. I'll reopen a fresh PR with a proper description if/when the entrypoint-harness work resumes. |
Summary
Related Issue
Changes
Testing
make lintpasses (stage changes first, then run)Checklist
!for breaking changes)