Skip to content

Disappearing terminal confirmation editors #260705

@roblourens

Description

@roblourens
  • get a terminal tool confirmation
  • click into it
  • It disappears
Image

This is weird- what happened is that the editor's model was disposed, and the editor was removed from the DOM. That happened when the wordHighlighter contrib disposed its reference and there were no remaining refs. I don't know what changed, and I can't repro reliably.

I'm a little unsure about the proper flow, I think we are using createModel wrong somehow.

const model = this.modelService.createModel(
terminalData.commandLine.toolEdited ?? terminalData.commandLine.original,
this.languageService.createById(langId),
this._getUniqueCodeBlockUri(),
true
);

In some places like

// this is a little weird but otherwise editors and other cusomers
// will dispose my models before they should be disposed...
// And all of this is off the eventloop to prevent endless recursion
queueMicrotask(async () => {
this._disposables.add(await this._textModelResolverService.createModelReference(model!.uri));
});
I see them call createModelReference after createModel, maybe we are supposed to do that.

@Tyriar you've touched this code recently, any idea? I haven't tried to bisect yet.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugcandidateIssue identified as probable candidate for fixing in the next releasechat-agentverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions