[RefImpl] Fix and harden the #571 timeout mapping: read the notice from output, require exit null, validate the hookmap

Open
#728 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend, testing

Research direction

Start in packages/host-adapter at exitStatusOf, then read the OpenCode hookmap and the changes and review context for #571 and #466. Add tests for exit null with the timeout notice, reject hookmap entries with an empty path or trimmed contains value, and measure whether OpenCode 1.18.30 truncates metadata.output with a 30,000+ character command. Done means one tested PR covers all three points and references #466 and #571.

Written by the indexing model from the issue text.

Description

status:needs-triage type:refimpl
Target runtime or language

TypeScript: the AGT host adapter (packages/host-adapter, exitStatusOf) and the OpenCode hookmap, fixing and hardening the mapping merged in #571 for #466.

What this proves

Follow-ups from the review of #571, as committed on #466, plus a correction found while measuring the third one (reported on #571 with captures).

  1. The signal path. #571 reads the timeout notice from $.result.metadata.output, which never carries it at tool.execute.after on OpenCode 1.18.30, so the shipped mapping never fires on a live run and timeouts still arrive as failure. The notice is in $.result.output, also after a truncation. This shows, end to end against the reference Guardian, a plain timeout and a truncated timeout reaching the Guardian as timeout, where #571's path gives failure for the same calls.
  2. A host-reported timeout is only mapped to timeout when the host's own signals agree: the exit value the host declares for its timeout (exit: null on OpenCode) alongside the notice. Tests cover exit 1 and 137 with the notice present: they stay failure. This shows a command that prints the notice text cannot turn a real failure into a timeout.
  3. Hookmap validation rejects a path that splits to no field ($..), a contains that is empty after trim, a timeout_when with no exit, and an exit the adapter already reads as success. This shows a malformed entry fails at load instead of silently switching detection off or matching every result.
  4. Truncation, measured on OpenCode 1.18.30 with 60,000 characters then a 2000 ms timeout: output is cut to a pointer to the saved file and keeps the notice; metadata.output keeps about the last 30,000 characters (truncated: true, outputPath set) and no notice. That case is a test.

Out of scope: what each exit_status value means (#119) and whether "an effect may already have happened" needs its own value (Discussion #128).

Done when one PR covers the four points, with tests and the end-to-end captures, and references #466 and #571.

Do you intend to implement this yourself

Yes, I want this assigned to me

Current Priority Scope

Feeds conformance evidence

Dominant language
TypeScript
Stars
183
Forks
56
Avg merge
3d 1h
Merged PRs (30d)
67

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenAI-Security-Project/agent-control-standard

All issues in GenAI-Security-Project/agent-control-standard

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.